Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Transaction Log error (DR)

Author  Topic 

bobgie
Starting Member

4 Posts

Posted - 2005-05-10 : 18:23:03
Hi there,

We have the below error message, any help will be appreciated. Thanks.

RESTORE LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013) The log in this backup set begins at LSN 68233000000032300001, which is too late to apply to the database. An earlier log backup that includes LSN 68183000000045400001 can be restored. [SQLSTATE 42000] (Error 4305). The step failed.

bobgie
Starting Member

4 Posts

Posted - 2005-05-10 : 18:27:00
The stored procedures that produced this error (from Production):

CREATE procedure call_standby
@vdatabase varchar(20)
as
declare @vfile varchar(100)
select top 1 @vfile='e:\solomonbackup\'+@vdatabase+'\'+@vdatabase+'_tlog_'+convert(varchar(4),datepart(yyyy,backup_start_date))+right('0'+convert(varchar(2),datepart(MM,backup_start_date)),2)
+right('0'+convert(varchar(2),datepart(dd,backup_start_date)),2)+right('0'+convert(varchar(2),datepart(hh,backup_start_date)),2)
+right('0'+convert(varchar(2),datepart(mi,backup_start_date)),2)+'.TRN'
from msdb..backupset
where database_name = @vdatabase and type = 'L'
order by backup_start_date desc

exec dr3.master..trans_restore @vdatabase,@vfile
GO
----

create procedure trans_restore
@vdatabase varchar(20)
,@vfile varchar(100)
as
declare @vcmd varchar(200)
select @vcmd='restore log '+@vdatabase+' from disk='''+@vfile+''' with standby=''e:\solomondb\'+@vdatabase+'.standby'''

exec (@vcmd)
---
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-05-10 : 23:35:28
if you have a series of backup files or multiple files in one backup device, make sure you restore them by order of backup, restoring file 1...n with standby (read-only) or norecovery option, then the last restore with recovery option if you used norecovery

i use the with standby option so that i can determine if i've restored the file to a certain state, ofcourse not knowing which time i need (otherwise, point-in-time recovery is the option) and i rarely restore on the production database (i prefer to isolate the problem rows and just migrate the restored rows)

--------------------
keeping it simple...
Go to Top of Page

bobgie
Starting Member

4 Posts

Posted - 2005-05-12 : 00:03:16
Maraming salamat kabayan.
The SP on Prod runs the "trans_restore" procedure which is on our DR box using linked server. A while ago, I did a full backup followed by a log backup, then restore it to DR, and applied the log backup. But it again produced the same error on step 3 (which is the log restore to DR). I ran the same script script as above. Why is it giving me the same messages when in fact the log restore is coming from a complete db restore, followed by log restore ? Is there anything I should be aware of or look for? Or can I run the backup and restore manually on our standby db?
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-05-12 : 22:43:34
can you post or email me the procedure you're using? including the way you're backing up and restoring?

sino pa ba ang magtutulungan kundi tayo tayo din naman?

--------------------
keeping it simple...
Go to Top of Page

bobgie
Starting Member

4 Posts

Posted - 2005-05-16 : 23:42:02
thanks jen. we're using "manual" log shipping and i think you're right the log has been truncated in prod then backed up, that's why the error. The job that refresh DR during weekends, dbresfresh _standby, returned to normal (after 2 weeks of daily errors). everything is fine now. pag may problema ulit I'll send you the additional scripts. the scripts which is posted here are the main ones we used.
Go to Top of Page
   

- Advertisement -