SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Restore Transactional Log Backup


Restore Transactional Log Backup

Author
Message
mp5387
mp5387
SSC Veteran
SSC Veteran (260 reputation)SSC Veteran (260 reputation)SSC Veteran (260 reputation)SSC Veteran (260 reputation)SSC Veteran (260 reputation)SSC Veteran (260 reputation)SSC Veteran (260 reputation)SSC Veteran (260 reputation)

Group: General Forum Members
Points: 260 Visits: 90
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,
jasona.work
jasona.work
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17964 Visits: 13338
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
Lynn Pettis
Lynn Pettis
SSC Guru
SSC Guru (166K reputation)SSC Guru (166K reputation)SSC Guru (166K reputation)SSC Guru (166K reputation)SSC Guru (166K reputation)SSC Guru (166K reputation)SSC Guru (166K reputation)SSC Guru (166K reputation)

Group: General Forum Members
Points: 166530 Visits: 39451
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.

Cool
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)
jasona.work
jasona.work
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17964 Visits: 13338
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!
Cool

Jason
pm.praveen.mehta89
pm.praveen.mehta89
SSC Rookie
SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)

Group: General Forum Members
Points: 25 Visits: 156
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 Smile
GilaMonster
GilaMonster
SSC Guru
SSC Guru (411K reputation)SSC Guru (411K reputation)SSC Guru (411K reputation)SSC Guru (411K reputation)SSC Guru (411K reputation)SSC Guru (411K reputation)SSC Guru (411K reputation)SSC Guru (411K reputation)

Group: General Forum Members
Points: 411493 Visits: 47113
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 Smile


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, MVP, M.Sc (Comp Sci)
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


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search