Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

601: Could not continue scan with NOLOCK due to Data movement Expand / Collapse
Author
Message
Posted Friday, February 15, 2013 7:58 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, December 16, 2013 1:13 AM
Points: 24, Visits: 74
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??!


Post #1420561
Posted Friday, February 15, 2013 9:11 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, August 29, 2014 5:09 PM
Points: 901, Visits: 7,180
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
Post #1420615
Posted Friday, February 15, 2013 9:14 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, December 16, 2013 1:13 AM
Points: 24, Visits: 74
i have no NOLOCK statement in my procedure
Post #1420616
Posted Friday, February 15, 2013 9:19 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, August 29, 2014 5:09 PM
Points: 901, Visits: 7,180
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
Post #1420619
Posted Monday, February 18, 2013 5:09 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, December 16, 2013 1:13 AM
Points: 24, Visits: 74
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
Post #1421142
Posted Monday, February 18, 2013 9:40 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, August 29, 2014 5:09 PM
Points: 901, Visits: 7,180
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
Post #1421281
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse