Restore command
Use the restore command to restore all or part of one or more SQL Server databases.
Use this command to restore all or part of one or more SQL Server databases from IBM Storage® Protect storage to an SQL Server.
- You cannot restore SQL Server databases that are in use. By placing SQL Server databases to be restored in single-user mode, you can avoid attempting such restores. If you are restoring the master database, start the SQL Server in single-user mode by using the -m SQL SERVER startup option. In addition, the single user of the SQL Server databases or server must be the same user that Data Protection for SQL Server uses to log on to the SQL Server for the restore. SQL Enterprise Manager, SQL Server Application Client, and other SQL Server services can be users of databases and the SQL Server.
- The user used by Data Protection for SQL Server to log on to the SQL Server must have the SQL Server SYSADMIN fixed server role.
- You can use the TRANSACT-SQL database consistency checker statement DBCC CHECKDB ('DBNAME') to verify the integrity of the restored SQL Server databases.
During SQL Server database restore processing, the SQL Server prepares the database files after first restoring a minimal amount of metadata. For large SQL Server databases, the preparation of the database files can be time consuming. To prevent a restore operation from ending prematurely, specify a value of at least 10000 in the commtimeout option. If the restore operation is performed in a LAN free environment, this value must be specified for the Storage Agent.
Date and time recovery (Legacy only)
The restoredate and restoretime parameters
allow restore and recovery of the specified database to the date and
time specified. These parameters automate the restore of the appropriate
full backup, related differential and log backups, and recovers the
database to the specified point in time. The behavior when these parameters
are used is as follows:
- If only full plus log backups exist, then the following actions
occur:
- The most recent full backup prior to the specified restoredate and restoretime is restored.
- All logs up to the first log backed up after the specified restoredate and restoretime is restored.
- Recovery up to the specified restoredate and restoretime (using stopat) is completed.
- If only full backups or full plus differential backups exist,
then the following actions occur:
- The most recent full backup prior to the specified restoredate and restoretime is restored.
- The most recent differential backup (if any exists) prior to the specified restoredate and restoretime is restored.
- If full plus differential plus log backups exist, then the following
actions occur:
- The most recent full backup prior to the specified restoredate and restoretime is restored.
- The most recent differential backup prior to the specified restoredate and restoretime is restored.
- All log backups after the differential and up to the first log backed up after the restoredate and restoretime is restored.
- Recovery up to the specified restoredate and restoretime (using stopat) is completed.