Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Restore Transactional Log Backup Expand / Collapse
Author
Message
Posted Monday, April 15, 2013 10:33 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, March 05, 2014 5:08 PM
Points: 14, Visits: 68
Hi,
I am new to this forum.Could anyone help me with this questions please. I am not able to resore my log backup.
My plan for backup is daily full backup, and transactional log backup for every 5 minutes because we do not have much transactions.My data base recovery model is "Full", and I scheduled transactional Backup with time stamp file name, and it works. Now I have problem with restoring transactional log backup. I restored my Full backup with Recovery state " RECOVERY WITH STANDBY" , and Restore options "WITH REPLACE", but when I want to restore transactional log backup, it is grayed out.
Any help would be greatly appreciated.
Thank in advance,
Post #1442403
Posted Monday, April 15, 2013 12:12 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Yesterday @ 5:51 PM
Points: 904, Visits: 4,450
You want to use "With NoRecovery" not "With Standby."

Standby will roll back any uncommited transactions and put the DB in read-only. NoRecovery basically tells SQL Server that there's more to be restored, at which point you begin restoring your TLog backups. On the last TLog backup you intend to restore, you use the "With Recovery," after which you'll have a usable DB.

Jason
Post #1442441
Posted Monday, April 15, 2013 12:17 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 6:31 PM
Points: 22,504, Visits: 30,217
jasona.work (4/15/2013)
You want to use "With NoRecovery" not "With Standby."

Standby will roll back any uncommited transactions and put the DB in read-only. NoRecovery basically tells SQL Server that there's more to be restored, at which point you begin restoring your TLog backups. On the last TLog backup you intend to restore, you use the "With Recovery," after which you'll have a usable DB.

Jason


Not quite true. WITH STANDBY allows you to bring a database into a read only state. Using an UNDO log you should be able to restore additional t-log backups until such time as you use WITH RECOVERY. This is how you can use a log shipped database for reporting.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1442442
Posted Monday, April 15, 2013 12:30 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Yesterday @ 5:51 PM
Points: 904, Visits: 4,450
Lynn Pettis (4/15/2013)
jasona.work (4/15/2013)
You want to use "With NoRecovery" not "With Standby."

Standby will roll back any uncommited transactions and put the DB in read-only. NoRecovery basically tells SQL Server that there's more to be restored, at which point you begin restoring your TLog backups. On the last TLog backup you intend to restore, you use the "With Recovery," after which you'll have a usable DB.

Jason


Not quite true. WITH STANDBY allows you to bring a database into a read only state. Using an UDO log you should be able to restore additional t-log backups until such time as you use WITH RECOVERY. This is how you can use a log shipped database for reporting.


Learn something every day!
I stand corrected!


Jason
Post #1442446
Posted Wednesday, April 17, 2013 12:08 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 2:29 AM
Points: 10, Visits: 123
Hi,
For restoring a db from transactional backup first u need to restore latest full backup with 'RESTORE WITH NORECOVERY' option then transactional log backups(except latest transactional backup) in sequence with 'RESTORE WITH NORECOVERY' option & at last restore latest transactional backup with 'RESTORE WITH RECOVERY' . And now ur db is ready to use :)
Post #1443101
Posted Wednesday, April 17, 2013 12:14 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 11:52 AM
Points: 41,530, Visits: 34,446
pm.praveen.mehta89 (4/17/2013)
Hi,
For restoring a db from transactional backup first u need to restore latest full backup with 'RESTORE WITH RECOVERY' option then transactional log backups(except latest transactional backup) in sequence with 'RESTORE WITH RECOVERY' option & at last restore latest transactional backup with 'RESTORE WITH NORECOVERY' . And now ur db is ready to use :)


Err... no. The complete other way around.

You need to restore the full backup WITH NORECOVERY (or STANDBY), then all the log backups except the last WITH NORECOVERY (or STANDBY), then the last log backup is the one that restores WITH RECOVERY

WITH RECOVERY signals the end of the restore process and brings the DB online. If you restore the full WITH RECOVERY, further log backups will fail to restore because the database is online and available. Attempts to restore logs will be met with an error saying that no files are ready to roll forward.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1443104
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse