RESTORE
Example
Section titled “Example”RESTORE DATABASE TestDBFROM DISK = 'C:\BackupFolder\TestDB.bak'WITH RECOVERYOutput
Section titled “Output”5 percent processed.10 percent processed....100 percent processed.Database 'TestDB' restored successfully.Explanation
Section titled “Explanation”The given code is used to restore a SQL Server database named ‘TestDB’ from a backup file located at ‘C:\BackupFolder\TestDB.bak’. The ‘WITH RECOVERY’ option brings the database online immediately after the restore operation is finished. The output indicates the process of restoration in percentages and confirms successful restoration upon completion.
Example
Section titled “Example”RUN {SET UNTIL SCN 1000;RESTORE DATABASE;RECOVER DATABASE;}Output
Section titled “Output”executing command: SET until clause...executing command: RESTORE...executing command: RECOVER...Explanation
Section titled “Explanation”The above example script runs restore and recovery on a database up to System Change Number (SCN) 1000. If you know the SCN, you can use it to recover the database to a specific point in time.