Log shipping fails when trying to restore transactional log

Posted on 2006-05-23
Last Modified: 2008-03-17
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

Question by:pumaken68
    1 Comment
    LVL 75

    Accepted Solution

    I think SQL lost alog somehow,In order to solve thus take full backup, then restore & fire up  log shipping again.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    This is my first ever Article on EE or elsewhere; therefore, please bear with me if I have some discrepancies in my writing. I read many articles and questions related to "how to pass values to SSIS packages at run-time?"  Hence, this common ques…
    Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
    This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
    Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now