dbTalk Databases Forums  

Could not continue scan with NOLOCK due to data movement.

microsoft.public.sqlserver.server microsoft.public.sqlserver.server


Discuss Could not continue scan with NOLOCK due to data movement. in the microsoft.public.sqlserver.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ching-ju Lee
 
Posts: n/a

Default Could not continue scan with NOLOCK due to data movement. - 03-19-2007 , 03:14 PM






I received the error message
Could not continue scan with NOLOCK due to data movement.

when I run the following SQL
update statistics PCR_Value with fullscan

I don't get any error if I run
update statistics PCR_Value with sample 75 percent
or any percentage smaller than 75. But if I go over 75 percent, then I get
the "Could not continue scan with NOLOCK due to data movement." I've run
dbcc checktable and receive no errors. Any suggestions?

Reply With Quote
  #2  
Old   
Kevin G. Boles
 
Posts: n/a

Default Re: Could not continue scan with NOLOCK due to data movement. - 03-19-2007 , 04:34 PM






Try running the stats update during a period of no/low activity. To improve
performance I would guess that process does not take a table lock and thus
can get 'confusled' when it tries to hit data that has changed underneath of
it.

Also, if you REALLY need to make it happen, what about opening a
transaction, doing a select top 1 * using an exclusive table lock hint,
running the update stats in the same tran, then committing the tran? Not
sure if the update stats would even be allowed to run there though. NOTE
that you would lock out ALL access to the table during the time this was
going on, even if it took hours!!


--
TheSQLGuru
President
Indicium Resources, Inc.


"Ching-ju Lee" <Ching-ju Lee (AT) discussions (DOT) microsoft.com> wrote

Quote:
I received the error message
Could not continue scan with NOLOCK due to data movement.

when I run the following SQL
update statistics PCR_Value with fullscan

I don't get any error if I run
update statistics PCR_Value with sample 75 percent
or any percentage smaller than 75. But if I go over 75 percent, then I
get
the "Could not continue scan with NOLOCK due to data movement." I've run
dbcc checktable and receive no errors. Any suggestions?



Reply With Quote
  #3  
Old   
Ching-ju Lee
 
Posts: n/a

Default Re: Could not continue scan with NOLOCK due to data movement. - 03-19-2007 , 05:36 PM



Kevin,

Thanks for the advice. My main concern about getting this error is what
caused it. Updating statistics of large tables in the database is part of a
server installation program and our installer made sure that all of the
applications on the server were terminated before the installation program
started. We have repeated this process twice on the server and encountered
the same error. The same migration process was executed for users at other
sites with a lot more rows in the same table and the process ran without
error. Could this be a SQL bug for MS SQL 2000?

"Kevin G. Boles" wrote:

Quote:
Try running the stats update during a period of no/low activity. To improve
performance I would guess that process does not take a table lock and thus
can get 'confusled' when it tries to hit data that has changed underneath of
it.

Also, if you REALLY need to make it happen, what about opening a
transaction, doing a select top 1 * using an exclusive table lock hint,
running the update stats in the same tran, then committing the tran? Not
sure if the update stats would even be allowed to run there though. NOTE
that you would lock out ALL access to the table during the time this was
going on, even if it took hours!!


--
TheSQLGuru
President
Indicium Resources, Inc.


"Ching-ju Lee" <Ching-ju Lee (AT) discussions (DOT) microsoft.com> wrote in message
news:6AEF167B-F5D9-43B9-88CD-1C02A74130DA (AT) microsoft (DOT) com...
I received the error message
Could not continue scan with NOLOCK due to data movement.

when I run the following SQL
update statistics PCR_Value with fullscan

I don't get any error if I run
update statistics PCR_Value with sample 75 percent
or any percentage smaller than 75. But if I go over 75 percent, then I
get
the "Could not continue scan with NOLOCK due to data movement." I've run
dbcc checktable and receive no errors. Any suggestions?




Reply With Quote
  #4  
Old   
Kevin G. Boles
 
Posts: n/a

Default Re: Could not continue scan with NOLOCK due to data movement. - 03-19-2007 , 11:24 PM



I suppose it could be a bug somewhere. But I think it is caused due to some
form of DML during data read operations. Are you absolutely certain there
was NO DML activity (even from your own package/installer thing) concurrent?
Are you also certain it was an update statistics run?

See http://support.microsoft.com/kb/815008 for a known bug which returns
this error message. Perhaps that will help.


--
TheSQLGuru
President
Indicium Resources, Inc.

"Ching-ju Lee" <ChingjuLee (AT) discussions (DOT) microsoft.com> wrote

Quote:
Kevin,

Thanks for the advice. My main concern about getting this error is what
caused it. Updating statistics of large tables in the database is part of
a
server installation program and our installer made sure that all of the
applications on the server were terminated before the installation program
started. We have repeated this process twice on the server and
encountered
the same error. The same migration process was executed for users at
other
sites with a lot more rows in the same table and the process ran without
error. Could this be a SQL bug for MS SQL 2000?

"Kevin G. Boles" wrote:

Try running the stats update during a period of no/low activity. To
improve
performance I would guess that process does not take a table lock and
thus
can get 'confusled' when it tries to hit data that has changed underneath
of
it.

Also, if you REALLY need to make it happen, what about opening a
transaction, doing a select top 1 * using an exclusive table lock hint,
running the update stats in the same tran, then committing the tran? Not
sure if the update stats would even be allowed to run there though. NOTE
that you would lock out ALL access to the table during the time this was
going on, even if it took hours!!


--
TheSQLGuru
President
Indicium Resources, Inc.


"Ching-ju Lee" <Ching-ju Lee (AT) discussions (DOT) microsoft.com> wrote in message
news:6AEF167B-F5D9-43B9-88CD-1C02A74130DA (AT) microsoft (DOT) com...
I received the error message
Could not continue scan with NOLOCK due to data movement.

when I run the following SQL
update statistics PCR_Value with fullscan

I don't get any error if I run
update statistics PCR_Value with sample 75 percent
or any percentage smaller than 75. But if I go over 75 percent, then I
get
the "Could not continue scan with NOLOCK due to data movement." I've
run
dbcc checktable and receive no errors. Any suggestions?






Reply With Quote
  #5  
Old   
Ching-ju Lee
 
Posts: n/a

Default Re: Could not continue scan with NOLOCK due to data movement. - 03-20-2007 , 10:17 AM



I am pretty sure the UPDATE STATISTICS with full scan caused the error
message because I can reproduce the exact error using ISQL on my test machine
when I restored the database from the user's site. I can eliminate the error
if I run UPDATE STATISTICS with 75 or lower percent. I read the article
before. The resolution was to install the latest service pack. The user,
and my test machine both have SQL 2000 SP4 installed. So still not sure what
caused the problem.

"Kevin G. Boles" wrote:

Quote:
I suppose it could be a bug somewhere. But I think it is caused due to some
form of DML during data read operations. Are you absolutely certain there
was NO DML activity (even from your own package/installer thing) concurrent?
Are you also certain it was an update statistics run?

See http://support.microsoft.com/kb/815008 for a known bug which returns
this error message. Perhaps that will help.


--
TheSQLGuru
President
Indicium Resources, Inc.



Reply With Quote
  #6  
Old   
rahul
 
Posts: n/a

Default Re: Could not continue scan with NOLOCK due to data movement. - 09-28-2011 , 01:15 AM



I had similar problem yesterday with a table scan on sqlserver 2005. fixed by running the same script for few seconds and abort . then let it run normally .
it scans through all records of whole database .
stopping iis and apps access mssql didn't help.


weird fix ?

Quote:
On Monday, March 19, 2007 4:14 PM Ching-ju Le wrote:

I received the error message
Could not continue scan with NOLOCK due to data movement.

when I run the following SQL
update statistics PCR_Value with fullscan

I don't get any error if I run
update statistics PCR_Value with sample 75 percent
or any percentage smaller than 75. But if I go over 75 percent, then I get
the "Could not continue scan with NOLOCK due to data movement." I've run
dbcc checktable and receive no errors. Any suggestions?

Quote:
On Monday, March 19, 2007 5:34 PM Kevin G. Boles wrote:

Try running the stats update during a period of no/low activity. To improve
performance I would guess that process does not take a table lock and thus
can get 'confusled' when it tries to hit data that has changed underneath of
it.

Also, if you REALLY need to make it happen, what about opening a
transaction, doing a select top 1 * using an exclusive table lock hint,
running the update stats in the same tran, then committing the tran? Not
sure if the update stats would even be allowed to run there though. NOTE
that you would lock out ALL access to the table during the time this was
going on, even if it took hours!!


--
TheSQLGuru
President
Indicium Resources, Inc.


"Ching-ju Lee" <Ching-ju Lee (AT) discussions (DOT) microsoft.com> wrote in message
news:6AEF167B-F5D9-43B9-88CD-1C02A74130DA (AT) microsoft (DOT) com...

Quote:
On Monday, March 19, 2007 6:36 PM ChingjuLe wrote:

Kevin,

Thanks for the advice. My main concern about getting this error is what
caused it. Updating statistics of large tables in the database is part of a
server installation program and our installer made sure that all of the
applications on the server were terminated before the installation program
started. We have repeated this process twice on the server and encountered
the same error. The same migration process was executed for users at other
sites with a lot more rows in the same table and the process ran without
error. Could this be a SQL bug for MS SQL 2000?

"Kevin G. Boles" wrote:

Quote:
On Tuesday, March 20, 2007 12:24 AM Kevin G. Boles wrote:

I suppose it could be a bug somewhere. But I think it is caused due to some
form of DML during data read operations. Are you absolutely certain there
was NO DML activity (even from your own package/installer thing) concurrent?
Are you also certain it was an update statistics run?

See http://support.microsoft.com/kb/815008 for a known bug which returns
this error message. Perhaps that will help.


--
TheSQLGuru
President
Indicium Resources, Inc.

"Ching-ju Lee" <ChingjuLee (AT) discussions (DOT) microsoft.com> wrote in message
news:4E41D7B0-66E0-4B6D-9F15-1BDAC9C7EAF1 (AT) microsoft (DOT) com...

Quote:
On Tuesday, March 20, 2007 11:17 AM ChingjuLe wrote:

I am pretty sure the UPDATE STATISTICS with full scan caused the error
message because I can reproduce the exact error using ISQL on my test machine
when I restored the database from the user's site. I can eliminate the error
if I run UPDATE STATISTICS with 75 or lower percent. I read the article
before. The resolution was to install the latest service pack. The user,
and my test machine both have SQL 2000 SP4 installed. So still not sure what
caused the problem.

"Kevin G. Boles" wrote:

Reply With Quote
  #7  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Could not continue scan with NOLOCK due to data movement. - 09-28-2011 , 02:13 AM



rahul (ray.777b (AT) gmail (DOT) com) writes:
Quote:
I had similar problem yesterday with a table scan on sqlserver 2005.
fixed by running the same script for few seconds and abort . then let
it run normally . it scans through all records of whole database .
stopping iis and apps access mssql didn't help.
The proper fix is to stop using NOLOCK, and turn on READ_COMMITTED_SNAPSHOT
to avoid locking issues in a busy environment.

Using NOLOCK means that not only can you see uncommitted data, but also fail
to read committed which can lead to considerable errors.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.