Definition and script to use TSM Archive point-in-time restore.
When restoring a archived backup, the User can run the xp_view_tsmcontents or the Graphical User Interface (GUI) can run it from the TSM Object Selection dialog, just as it currently does for backups. Then from the list displayed, the User can select the desired archive to restore. The selected archive has a "tsmpointintime" column in the list, that tsmpointintime can be passed in to the restore via the @tsmpointintime parameter, this is the same parameter that backups can currently pass in for selection of an old retained backup to restore.
If the backup is striped and the pointintimes of the various striped files are different (rare but can be different a second or so), then the most recent of the times must be choosen.
To restore an archive the @tsmarchive=1 parameter is required. However the @tsmpointintime parameter is optional and if not passed in then the engine will choose the most recent archived backup.
The @tsmarchive=1 must have a supporting check box/radio button in the Enterprise Console, Restore Database Wizard. The @tsmpointintime however needs no GUI change since it should work the same way it currently does for backups. Once the user selects an archive to restore the code can pull the tsmpointintime from the XML for that selected archive.
Example:
EXEC master.dbo.xp_restore_database
@database= 'Northwind'
,@tsmclientnode='TSMnode'
,@tsmclientownerpwd='password
',@tsmobject='SLS_Backup_file'
,@tsmconfigfile='C:\Program Files\Tivoli\tsm\baclient\dsm.opt'
,@tsmpointintime='2006-07-24 10:20:25'
,@tsmarchive=1
Applies to LiteSpeed version 4.6 and greater.