Search This Blog

Wednesday, 25 January 2012

How to restore using TSM?

Dsmc restore
Restore files

The restore command obtains copies of backup versions of your files from a TSM server. To restore files, specify the directories or selected files, or select the files from a list. Restore files to the directory from which you backed them up or to a different directory. TSM uses the preservepath option with the subtree value as the default for restoring files. For more information, see the PRESERVEPATH topic.

When an entire directory or directory tree is restored, and the inactive, latest, pick, todate, and fromdate options are not specified on the restore command, TSM tracks which objects are restored. If the restore process is interrupted for any reason, you can restart the restore at the point of interruption by entering the restart restore command. It is possible to create more than one restartable restore session. Restores are only restartable if the filespec is fully wildcarded. For example, for a restore which is restartable, enter:

   dsmc rest /home/* -sub=yes

For a restore which is not restartable, enter:

   dsmc rest /home/file?.c -sub=yes

Use the query restore command to display a list of your restartable restore sessions in the server database. Further backups of the file system cannot be performed unless the restartable restore completes using the restart restore command or is cancelled using the cancel restore command.

Syntax

>>-REStore---+--------+---+-----------+---+- sourcefilespec---+->
             '- FILE--'   '- options--'   '- "sourcefilespec"-'
>-----+----------------------+---------------------------------><
      '- destinationfilespec-'

Parameters
file
     This parameter specifies that the source file specification is an explicit filename. This parameter is required when you restore a file name from the current path, when you do not specify a relative or absolute path, and when the file name conflicts with one of the reserved restore command keywords, such as restore backupset. See the Using Commands topic for the maximum file size for restore processing.

options
     You can use these command line options with the restore command: dirsonly, filelist, filesonly, fromdate, fromnode, fromowner, fromtime, ifnewer, inactive, latest, pick, pitdate, pittime, preservepath, todate, totime. See the command line topics for more information. You can use these common options with the restore command: replace, restoremigstate, subdir. See the common options topics for more information.

sourcefilespec
     Specifies the path and file name in storage that you want to restore. Use wildcard characters to specify a group of files or all the files in a directory.

destinationfilespec
     Specifies the path and file name where you want to place the retrieved files. If you do not specify a destination, TSM restores the files to the original source path.


Examples

Task
     Restore a single file named budget.
     Command: restore /home/devel/projecta/budget

Task
     Restore a single file named budget.finbudget which resides in the current directory.
     Command: restore file budget

Task
     Restore all files with a file extension of .c from the /home/devel/projecta directory.
     Command: restore "/home/devel/projecta/*.c"

Task
     Restore files in the /user/project directory. Use the pick and inactive options to select active and inactive backup versions.
     Command: restore "/user/project/*" -pick -inactive

Task
     Restore all files from the /home/devel/projecta directory that end with the character .c to the /home/newdevel/projectn/projecta directory. If the projectn or the projectn/projecta directory does not exist, it is created.
     Command: restore "/home/devel/projecta/*.c" /home/newdevel/projectn/

Task
     Restore all objects in the /home/myid/ directory. Since this restore is fully wildcarded, if the restore process is interrupted, a restartable restore session is created. Use the restart restore command to restart a restartable restore session. Use the cancel restore command to cancel a restartable restore session.
     Command: restore /home/myid/*

Task
     Restore files specified in the filelist to a different location.
     Command: restore -filelist=/home/avi/restorelist.txt   /home/NewRestoreLocation/

If the restore operation detects a file by the same name in the target directory, it will prompt you with the following question:
file ‘/home/user/myfile.txt’ exists
Select an appropriate action
Replace this object
Replace all objects that already exist
Skip this object
Skip all objects that already exist
A.  Abort this operation
Action [1,2,3,4,A] :

--------------------------------------------------------------------------------
Dsmc query backup
Query Backup

The query backup command displays a list of backup versions of your files. For each backup version, TSM displays the file specification, file size, backup date, whether the file is active or inactive, and the management class to which the file is assigned. TSM displays only the first ten characters of the management class name.

Syntax
>>-Query Backup---+-----------+---+- filespec---+--------------><
                  '- options--'   '- "filespec"-'

Parameters
options
     You can use these command line options with the query backup command: dirsonly, filelist, filesonly, fromdate, fromnode, fromowner, fromtime, inactive, pitdate, pittime, todate, totime. See the command line topics for more information. With the query backup command, you can use the following common options: subdir, scrolllines, , scrollprompt. See the common options topics for more information.

filespec
     Specifies the path and file name that you want to query. Use wildcard characters to specify a group of files or all the files in a directory. If you use wildcard characters, enclose the file specification in double quotation marks. Specify an asterisk (*) to display information about backup versions for all of your files in the current directory.

Examples
Task
     Display a list of all active and inactive backup versions of your files in the current directory.
     Command: query backup -inactive "*"

Task
     Display a list of files that were backed up from the /home/proj directory with file names that begin with proj.
     Command: query backup "/home/proj/proj*"

Task
     Display a list of active and inactive backup file versions in the /home file system.
     Command: query backup -inactive -sub=yes /home/