Enables implementation of a recovery plan in independent command line operations. Normally the Microsoft application agent builds the recovery plan, ensuring that all the required backups are available and that they run in the proper order and with the proper options. The
-z option removes safety checks.
This option is used in more complex recoveries. The following example commands use the following backup history:
- savetime 1:00 - full backup
- savetime 2:00 - txnlog backup
- savetime 3:00 - txnlog backup
To recover multiple backups and restore a database in a single command, run the following command:
ddbmsqlrc ... -t "savetime 3:00" ...
This command recovers the entire recovery chain, from the first full backup to the last logs-only backup.
To recover this recovery chain and restore a database in a series of independent commands, run the following commands:
ddbmsqlrc ... -z -S norecover -t "savetime 1:00" ...
ddbmsqlrc ... -z -S norecover -t "savetime 2:00" ...
ddbmsqlrc ... -z -S normal -t "savetime 3:00" ...
These three commands recover each backup individually.
The
-z option disables building the recovery plan and recovers only the specified backup. This command is required for all backups except for level full backups.
Use the
-S norecover option with the
-z option to prepare the database for more restores. This command is required for all except the last recovery command. The final command recovers the last logs-only backup and brings the database online.
NOTE A point-in-time restore within the final txnlog can be specified by replacing the save time. For instance, in the previous example, you can replace 3:00 with 2:45. The database is not available for general use until after the final recovery completes. Any missing, incorrect, or out-of-order save times result in SQL Server reporting errors.
Starting with Microsoft application agent 19.2, you can specify the
ddbmsqlrc command option
-S norecover when you restore a read-write (active) filegroup, which leaves the database in the recovering mode. In this mode, you can then apply subsequent transaction logs to complete a point-in-time restore of the active filegroup, for example, when backups are configured as in the following example. The following example commands use the following backup history:
- savetime 6/21/2019 12:10:35 PM - full read/write filegroup backup with
-O "READ_WRITE_FILEGROUPS" option
- savetime 6/21/2019 12:21:30 PM - txnlog backup
- savetime 6/21/2019 12:25:34 PM - txnlog backup
To perform a point-in-time restore of the active filegroup, run the following commands:
-
Restore the filegroup backup in norecover mode:
ddbmsqlrc ... -z -f -t "06/21/2019 12:10:35 PM" -S norecover -O "READ_WRITE_FILEGROUPS" ...
-
Restore the second last log backup in norecover mode:
ddbmsqlrc ... -z -f -t "06/21/2019 12:21:30 PM" -S norecover ...
-
Complete the point-in-time restore in normal mode to a time before the final log backup:
ddbmsqlrc ... -z -f -t "06/21/2019 12:25:34 PM" -S normal ...