![]() |
![]() |
Use this command for the following tasks:
Before you perform any of these operations, you should be familiar with the procedures as they are described in the Administrator's Guide.
The restore operation uses database backups created with the BACKUP DB command or created automatically based on the settings specified in the DEFINE DBBACKUPTRIGGER command. You cannot use the DSMSERV RESTORE DB command to load a dump created with the DSMSERV DUMP DB command.
Notes:
Attention: If the log mode is set to roll-forward after a point-in-time database restoration, a database backup starts when the server is brought up for the first time. This can cause loss of data: a tape can have current data on it, but because of the point-in-time restoration, it can be marked as scratch. When the server starts for the first time, it may use this tape to write the database backup, thus destroying the original data on this tape.
This situation could occur if roll-forward mode is enabled, but the administrator restored the database as if the server was operating in normal mode, not roll-forward mode. For example: the database is to be backed up at midnight everyday Monday through Friday. On Friday, the database was restored to a point-in-time of midnight Wednesday. Thursday's database backup was not used; this tape exists and does contain valid data. But because the database was restored to Wednesday at midnight, the Thursday's tape was marked as scratch. This tape was then inadvertently chosen and written with the database backup information. Therefore, the data for Thursday was lost.
You can restore a database to its most current state (roll-forward recovery) only if the following are true:
A device configuration file with the applicable device information (library, drive, and device class definitions) must also be available, or you must manually create one (see Administrator's Guide).
Tivoli Storage Manager requests volume mounts to load the most recent backup series and then uses the recovery log to update the database to its most current state.
Snapshot database backups cannot be used to restore a database to its most current state.
Syntax
.-Preview--=--No------. >>-DSMSERV RESTORE DB--+---------------------+----------------->< '-Preview--=--+-No--+-' '-Yes-'
Parameters
Examples
Task
Restore the database to its most current state. The recovery log is available and intact.
Sample JCL:
//TIVSM JOB , // REGION=256M,TIME=1440,CLASS=A,MSGCLASS=H //TIVSM EXEC PGM=ANRSERV,DYNAMNBR=300,TIME=NOLIMIT, // PARM='/RESTORE DB' //OPT DD DSN=TIVSM.OPTIONS,DISP=SHR,FREE=CLOSE //DSMAMENG DD DSN=TIVSM.ANRMSG(ANRMENU),DISP=SHR //HLPAMENG DD DSN=TIVSM.ANRHLP(ANRHENU),DISP=SHR //DSK DD DSN=TIVSM.DISKLOG,DISP=SHR //SYSPRINT DD SYSOUT=* //SYSTERM DD SYSOUT=*
You can restore a single database volume to its most current state (roll-forward recovery) only if the following are true:
A device configuration file with the applicable device information (library, drive, and device class definitions) must also be available, or you must manually create one (see Administrator's Guide).
Tivoli Storage Manager requests volume mounts to load the most recent backup series and then uses the recovery log to update the volume to its most current state.
When Tivoli Storage Manager restores a mirrored database volume, only one copy of the volume is restored. Use the VARY command to bring the mirrored volume online. The mirrored volume is then synchronized the with the restored volume.
Snapshot database backups cannot be used to restore a database to its most current state.
Syntax
>>-DSMSERV RESTORE DB-------------------------------------------> .-Preview--=--No------. >--DBVol--=--volume_name--+---------------------+-------------->< '-Preview--=--+-No--+-' '-Yes-'
Parameters
Examples
Task
Restore database volume ADSMSRV0.DB01 to its most current state. The recovery log is available and intact.
Sample JCL
//TIVSM JOB , // REGION=256M,TIME=1440,CLASS=A,MSGCLASS=H //TIVSM EXEC PGM=ANRSERV,DYNAMNBR=300,TIME=NOLIMIT, // PARM='/RESTORE DB DBV=TIVSM.DB01' //OPT DD DSN=TIVSM.OPTIONS,DISP=SHR,FREE=CLOSE //DSMAMENG DD DSN=TIVSM.ANRMSG(ANRMENU),DISP=SHR //HLPAMENG DD DSN=TIVSM.ANRHLP(ANRHENU),DISP=SHR //DSK DD DSN=TIVSM.DISKLOG,DISP=SHR //SYSPRINT DD SYSOUT=* //SYSTERM DD SYSOUT=*
If a volume history file is available, you can restore a database to a point in time. A device configuration file with the applicable device information (library, drive, and device class definitions) must also be available, or you must manually create one (see Administrator's Guide).
If the volume history file is not available, use the method described in Restoring a Database to a Point in Time -- Volume History File Unavailable.
Full and incremental database backups or snapshot database backups can be used to restore a database to a point-in-time.
Syntax
>>-DSMSERV RESTORE DB--TODate--=--date--------------------------> .-TOTime--=--23:59:59-. .-Source--=--DBBackup-------. >--+---------------------+--+---------------------------+-------> '-TOTime--=--time-----' '-Source--=--+-DBBackup---+-' '-DBSnapshot-' .-Preview--=--No------. >--+---------------------+------------------------------------->< '-Preview--=--+-No--+-' '-Yes-'
Parameters
For example, if you issue the DSMSERV RESTORE DB command at 9:00 with TOTIME=NOW, the database is restored using the last backup series created on or prior to 9:00 on the specified date.
For example, if you issue the DSMSERV RESTORE DB command at 9:00 with TOTIME=NOW-3:30 or TOTIME+-3:30, the database is restored using the last backup series created on or prior to 5:30 on the specified date.
Examples
Task
Restore the database to its state on May 12, 1999 at 2:25 pm. The volume history file is available.
Sample JCL:
//TIVSM JOB , // REGION=256M,TIME=1440,CLASS=A,MSGCLASS=H //TIVSM EXEC PGM=ANRSERV,DYNAMNBR=300,TIME=NOLIMIT, // PARM='/RESTORE DB TODATE=05/12/1999 TOTIME=14:25:08' //OPT DD DSN=TIVSM.OPTIONS,DISP=SHR,FREE=CLOSE //DSMAMENG DD DSN=TIVSM.ANRMSG(ANRMENU),DISP=SHR //HLPAMENG DD DSN=TIVSM.ANRHLP(ANRHENU),DISP=SHR //DSK DD DSN=TIVSM.DISKLOG,DISP=SHR //SYSPRINT DD SYSOUT=* //SYSTERM DD SYSOUT=*
If the volume history file is unavailable, you can use one or more DSMSERV RESTORE DB commands to restore the database to a specific point in time. For example, to load a full backup and one or more incremental backups, issue a DSMSERV RESTORE DB command for the full backup and an additional DSMSERV RESTORE DB command for each incremental backup. When you use multiple DSMSERV RESTORE DB commands, specify COMMIT=NO for each command except the last one. For the last command, specify COMMIT=YES. The database remains in an inconsistent and unusable state until you issue a DSMSERV RESTORE DB command with a COMMIT=YES. A device configuration file with the applicable device information (library, drive, and device class definitions) must also be available, or you must manually create one (see Administrator's Guide).
Full and incremental database backups or snapshot database backups can be used to restore a database to a point-in-time.
To restore the database using snapshot backup volumes, you must:
Notes:
Syntax
>>-DSMSERV RESTORE DB--DEVclass--=--device_class_name-----------> .-Source--=--DBBackup-------. >--+---------------------------+--------------------------------> '-Source--=--+-DBBackup---+-' '-DBSnapshot-' .-,-----------. V | >--VOLumenames--=--+---volume_name-+-+--------------------------> +-FILE:file_name--+ '-FILE:DD:ddname--' .-COMMIT--=--No------. >--+--------------------+-------------------------------------->< '-COMMIT--=--+-No--+-' '-Yes-'
Parameters
If you need to restore a full backup and one or more incremental backups, you can issue one DSMSERV RESTORE DB command for the full backup, and issue an additional DSMSERV RESTORE DB command for each incremental backup.
To restore the database using snapshot database backup volumes, you must:
Examples
Task 1
Restore the database to the time of its most recent incremental backup. The volume history file is not available. Tape volumes FULL1, FULL2, INCR1, and INCR2 contain the database backup series.
Sample JCL:
//SERVER EXEC PGM=DSMSERV, // PARM='/RESTORE DB DEV=CARTRIDGE VOL=FILE:DD:TAPES' //OPT DD DSN=TIVSM.ANRSERV.OPTIONS,DISP=SHR //DSMAMENG DD DSN=TIVSM.ANRMSG(ANRMENU),DISP=SHR //HLPAMENG DD DSN=TIVSM.ANRHLP(ANRHENU),DISP=SHR //DSK DD DSN=TIVSM.DISKLOG,DISP=SHR //SYSPRINT DD SYSOUT=H //SYSTERM DD SYSOUT=H //TAPES DD * FULL1 FULL2 INCR1 INCR2 /*