601: Could not continue scan with NOLOCK due to Data movement

  • SCENARIO 1

    Hi, i'm getting the error msg 601: Could not continue scan with NOLOCK due to Data movement‎ - from a job scheduled to run. This is how the error comes about;

    I have two sql servers, (both 2000) lets say A and B. server A is my production server while server B is my standby server. I scheduled a database and log backup on server A in which the destination for the backup files are on server B where its to be recovery (sort of like the log shipping we have in sql 2008).

    Now I have two jobs( say job1 and job2) scheduled on server A. Job1 is a procedure which is to perform a full backup and then a log backups to server B. Job2 is a procedure that is to recovery(restore) the backups from server B onto the standby server B in the order they were backed up.

    Pls note that job2 will also fail if job1 fail because there are no backup files for job2 to recovery.

    One day i noticed job1 had been failing causing job2 to also fail. On checking the job history and log files i saw that full backup will complete but log backup will fail with the above error causing the the job to fail...

    I have no NOLOCK statement in my procedure

    I have upgraded my service pack to SP4 because i was told its a service pack issue but still nothing

    I have ran DBCCC CHECKDB and no error was displayed

    SCENARIO 2

    This scenario is exactly like Scenario 1, the only difference is that i get the above error when recovery of the 'log files' is being performed on server B (that means full database recovery is successful but log recovery fails) . So in the case, job1 is fine but job2 is failing.

    Pls can anyone help??!

  • The first question would be: What's the purpose of the NOLOCK? Can you just take it out?


    And then again, I might be wrong ...
    David Webb

  • i have no NOLOCK statement in my procedure

  • Sorry, I mis-read that. What command in the job is actually issuing the error? Do you have the complete error log from the package execution?


    And then again, I might be wrong ...
    David Webb

  • Thank you very much for your response.

    Here is the actual procedure that recovers the log file;

    use master

    if exists (SELECT * from sysobjects where id = object_id('dbo.sp_ApplyStandByLog') and sysstat & 0xf = 4)

    drop procedure dbo.sp_ApplyStandByLog

    GO

    CREATE PROCEDURE sp_ApplyStandByLog

    @DBName sysname,

    @BackupFileName nvarchar(256),

    @UndoFile nvarchar(256)

    AS

    DECLARE @RestoreCmd nvarchar(510)

    DECLARE @ErrDesc nvarchar(510)

    SET @RestoreCmd =

    'RESTORE LOG ' + @DBName

    + ' FROM DISK=''' + @BackupFileName

    + ''' WITH STANDBY=''' + @UndoFile

    PRINT 'Executing ' + @RestoreCmd

    RESTORE LOG @DBName FROM DISK=@BackupFileName WITH STANDBY=@UndoFile

    IF @@ERROR <> 0

    BEGIN

    SET @ErrDesc =

    'sp_ApplyStandByLog Error ' + convert(varchar(9),@@Error) + ' occurred on '

    + 'database %s restoring backup file %s'

    RAISERROR (@ErrDesc,19,1,@DBName, @BackupFileName)

    END

    RETURN

    Here is the error message from the job history;

    Executed as user: BRANCHSERVER1\BackupAdmin. ...TE 42000] (Error 601) Processed 1 pages for database 'failsafe', file 'failsafe_Log' on file 1. [SQLSTATE 01000] (Error 4035) Processed 696 pages for database 'failsafe', file 'failsafe_Data' on file 1. [SQLSTATE 01000] (Error 4035) Executing RESTORE FULL BACKUP failsafe FROM DISK='\\branchserver2\e$\backup\failsafe_001_000003768_20130218_1014_FULL.bak' WITH STANDBY='e:\backup\failsafe_undo.dat, REPLACE [SQLSTATE 01000] (Error 0) RESTORE DATABASE successfully processed 697 pages in 4.316 seconds (1.321 MB/sec). [SQLSTATE 01000] (Error 3014) Could not continue scan with NOLOCK due to data movement. [SQLSTATE 42000] (Error 601) Processed 1 pages for database 'ngricao', file 'NGRICAO_Log' on file 1. [SQLSTATE 01000] (Error 4035) Processed 287544 pages for database 'ngricao', file 'NGRICAO_Data' on file 1. [SQLSTATE 01000] (Error 4035) Executing RESTORE FULL BACKUP ngricao FROM DISK='\\branchserver2\e$\backupgricao_001_000003395_2013... The step failed.

    Thank you

  • The package you're running does more thasn the stored proc you've shown. Looks like a full DB restore was doen, then something ran that caused this error, then the proc you've shown ran. What does the whole package do? What happens just before this proc runs?


    And then again, I might be wrong ...
    David Webb

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply