There are several options to apply when restoring the backup file, including the Transaction Log Backup files. Here are some restore options:
NORECOVERY
This option allows to restore additional backup files. You can use it when restoring Full, Differential or Transaction Log Backup. Use the following command:
RESTORE DATABASE NORTHRECOVERY
FROM DISK = 'C: SQLBackupNorth.bak'
WITH NORECOVERY
This is the default option if no options are selected. This hconj option will be applied to the last restore process. When applied, you cannot restore additional backup files; if you want to restore additional backup files, you must perform a restore from scratch. This option can be used when restoring Full, Differential or Transaction Log Backup. To select this option, use the following command:
RESTORE LOG NORTHSTANDBY
DISK FROM = 'C: SQLBackupNorth_Log.bak'
WITH RECOVERY
This option allows you to switch the database to Read-Only mode, but it still allows to restore additional Transation Log files. This option can be used when restoring Full, Differential or Transaction Log Backup. The option to select this option takes the form:
RESTORE LOG NORTHMOVE
DISK FROM = 'C: SQLBackupNorth_Log.bak'
WITH STANDBY = 'c: undo.ldf'
When restoring the database to another server, you may have to use the MOVE option if the servers are not installed by the same method. As mentioned above, when using LogicalName and PhysicalName from the RESTORE FILELISTONLY command. The MOVE option allows you to move physical files to another location on the server. This option should be used for all backup file types including Full, Differential and Transaction Log. The option to select this option takes the form:
RESTORE LOG NORTHStep 5: Select the Restore time
DISK FROM = 'C: SQLBackupNorth_Log.bak'
WITH RECOVERY,
MOVE 'Northwind_Data' TO 'c: dataNorthwind.mdf',
MOVE 'Northwind_Log' TO 'c: dataNorthwind _log.ldf'
In addition to completely restoring Transaction Logs, SQL Server also has options to stop at a specific time or transaction mark. You can choose these options when you know when or where errors occur on this database, you can restore database transactions for a specific point to avoid errors. For example, if someone deletes every record in a table, you may want to restore the database to a point before restoring it to the table that was deleted.
STOPAT
This option restores every delivery performed up to a certain time. For example:
RESTORE LOG NorthwindThe next two commands help you recover transactions that use transaction marks that must be named transactions used in the application. If using unnamed transactions, this option will not work.
DISK FROM = 'C: SQLBackupNorth_Log.bak'
WITH RECOVERY,
STOPAT = 'Sep 22, 2009 09:00 AM'
STOPATMARK
With this option you can restore all transactions that occurred until the Invoice1024 transaction milestone. Add commands with the following syntax to select this option:
RESTORE LOG NorthwindThis option restores all transactions performed before the Invoice1024 transaction milestone. To use this option, please add the command with the following syntax:
DISK FROM = 'C: SQLBackupNorth_Log.bak'
WITH RECOVERY,
STOPATMARK = 'Invoice1024'
STOPBEFOREMARK
RESTORE LOG NorthwindSome recovery options can be used for all backup files and certain options can only be used for Transaction Log Backup files.
DISK FROM = 'C: SQLBackupNorth_Log.bak'
WITH RECOVERY,
STOPBEFOREMARK = 'Invoice1024'