dbTalk Databases Forums  

Tx log restore problems

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Tx log restore problems in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
xo
 
Posts: n/a

Default Tx log restore problems - 07-14-2010 , 06:14 PM






Hi,

I restored a full db backup, then applied point in time TX log restore
(I picked a time that is earlier than the accumulated log backup file
ends) and leave the db at standby/read-only stage. And when I tried to
apply add'l TX, I got this error.

Restore failed
Additional information:
System.Data.SqlClient.SqlError: The log in this backup set terminates
at LSN 3056460000000004100001, which is too early to apply to the
database. A more recent log backup that includes LSN
305653000000032400001 can be restored.

Am I supposed to use a different TX Log backup file? All TX are
accumulative/appended on top of each other. What is the appropriate
steps to restore TX log and applied add'l logs with the same log
backup file?

Thanks in advance.

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Tx log restore problems - 07-15-2010 , 03:23 AM






xo (xo5555ox (AT) gmail (DOT) com) writes:
Quote:
I restored a full db backup, then applied point in time TX log restore
(I picked a time that is earlier than the accumulated log backup file
ends) and leave the db at standby/read-only stage. And when I tried to
apply add'l TX, I got this error.
So you have a backup that was completed at 17:20, and now you want to
make a restore to the state at 17:05? That is not going to work out.
You will need to restore an earlier full backup and then apply log
backups to that one.





--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
  #3  
Old   
xo
 
Posts: n/a

Default Re: Tx log restore problems - 07-16-2010 , 07:07 PM



On Jul 15, 1:23*am, Erland Sommarskog <esq... (AT) sommarskog (DOT) se> wrote:
Quote:
xo (xo555... (AT) gmail (DOT) com) writes:
I restored a full db backup, then applied point in time TX log restore
(I picked a time that is earlier than the accumulated log backup file
ends) and leave the db at standby/read-only stage. And when I tried to
apply add'l TX, I got this error.

So you have a backup that was completed at 17:20, and now you want to
make a restore to the state at 17:05? That is not going to work out.
You will need to restore an earlier full backup and then apply log
backups to that one.

--
Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008:http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005:http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000:http://www.microsoft.com/sql/prodinf...ons/books.mspx

I got a full db backup file and one log backup which contains about 8
hrs worth of tx (tx backup once per hr between 6:30AM - 2:30PM) .
First I restored the full backup and then I restored the tx log up to
11:30AM and tried to leave the db as standby as well as non-
operational so I can restore more tx from the same log backup, but I
couldn't. I got the above messages.

Reply With Quote
  #4  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Tx log restore problems - 07-17-2010 , 07:58 AM



xo (xo5555ox (AT) gmail (DOT) com) writes:
Quote:
I got a full db backup file and one log backup which contains about 8
hrs worth of tx (tx backup once per hr between 6:30AM - 2:30PM) .
First I restored the full backup and then I restored the tx log up to
11:30AM and tried to leave the db as standby as well as non-
operational so I can restore more tx from the same log backup, but I
couldn't. I got the above messages.
So you say that you first did:

RESTORE DATABASE db FROM DISK = 'somefile.bak' WITH NORECOVERY, REPLACE

Then you did:

RESTOTE LOG db FROM DISK = 'trnfile.bak' WITH NORECOVERY,
STOPAT = '20100714 11:30'

And this succeeded successfully?

Next you tried:

RESTOTE LOG db FROM DISK = 'trnfile.bak' WITH NORECOVERY

Using the same file as before, and this failed?

I tried to emulate this situation, and it worked. That is, I was able to
apply the same transaction log twice, with different values for STOPAT.

I think you need to verify that you use the correct file, and also that
you used the correct file number. (The WITH FILE option.)


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.