Link to home
Start Free TrialLog in
Avatar of pumaken68
pumaken68

asked on

Log shipping fails when trying to restore transactional log

Hi,
I am trying to implement log shipping. For this purpose i did a back up of the databas from the production server and restored it on the stand-by server.Now for restoring the transaction log i am running a job that runs after every 1 hr . The steps in the jobs are as below:
Step 1: Backup Log
BACKUP LOG PrePaidCard TO PrePaidCard_log_backup_device WITH INIT, NO_TRUNCATE
WAITFOR DELAY '00:00:05'

Step 2: Copy Log
xcopy d:\SQL2000\MSSQL\BACKUP\PrePaidCard_log_backup_device.BAK   \\LEONING\d$\PrePaidCard-TransationBackUp\ /c

Step 3: Restore Log
EXEC LEONING.master.dbo.restore_PrePaidCard_log_backups

Now because the path was not correct in step 2 the job failed for the first instance. So i corrected the path and ran the job again.
But it failed in step 3 with the following error:

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

Now ,if i do a back up of the database from Production server agian and restore it on backup server and then run the job for transaction log it works fine.

So ,is it that since the job failed initially i always need  to do back up of the database again and then restore it on the stand by server and then execute the job set for transaction log.OR is there some othere way with which successful restore of transaction log could be achived?
Pl. let me know

ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial