Showing posts with label errors. Show all posts
Showing posts with label errors. Show all posts

Tuesday, March 20, 2012

alter table nocheck constraint still some dependencies

Hi.

I'm getting errors like this when I try to run an upgrade script I'm trying to
write/test:

altering labels to length 60
Server: Msg 5074, Level 16, State 4, Line 5
The object 'ALTPART_ANNOT_ANNOTID_FK' is dependent on column 'label'.

I used this to bracket my script:

sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"
go
sp_msforeachtable "ALTER TABLE ? DISABLE TRIGGER all"
go

/* updates here */

sp_msforeachtable @.command1="print '?'",
@.command2="ALTER TABLE ? CHECK CONSTRAINT all"
go
sp_msforeachtable @.command1="print '?'",
@.command2="ALTER TABLE ? ENABLE TRIGGER all"
go

I guess the alter table nocheck constraint isn't disabling the fk's
completely?
Is there a way around this, or do I manually have to do the constraint
dropping/recreating?

Thanks
Jeff KishOn Wed, 17 May 2006 10:25:25 -0400, Jeff Kish wrote:

>Hi.
>I'm getting errors like this when I try to run an upgrade script I'm trying to
>write/test:
>altering labels to length 60
>Server: Msg 5074, Level 16, State 4, Line 5
>The object 'ALTPART_ANNOT_ANNOTID_FK' is dependent on column 'label'.
>I used this to bracket my script:
>sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"
>go
>sp_msforeachtable "ALTER TABLE ? DISABLE TRIGGER all"
>go
>/* updates here */
>
>sp_msforeachtable @.command1="print '?'",
>@.command2="ALTER TABLE ? CHECK CONSTRAINT all"
>go
>sp_msforeachtable @.command1="print '?'",
>@.command2="ALTER TABLE ? ENABLE TRIGGER all"
>go
>I guess the alter table nocheck constraint isn't disabling the fk's
>completely?

Hi Jeff,

ALTER TABLE xxx NOCHECK CONSTRAINT yyy is intended to (temporarily)
disable the checking of the constraint. The constraint is not removed
from the metadata. That means that you still can't perform any
modifications that would invalidate the constraint. (Coonsider what
would happpen if you change the datatype of a column on one end of a
FOREIGN KEY constraint but not on the other end and then try to
re-anable the constraint...)

>Is there a way around this, or do I manually have to do the constraint
>dropping/recreating?

If you google for it, you might be able to find scripts to generate the
code to drop and recreate constraints. I've never used any such code, so
I can't comment on the reliability.

--
Hugo Kornelis, SQL Server MVP|||Jeff Kish (jeff.kish@.mro.com) writes:
> I'm getting errors like this when I try to run an upgrade script I'm
> trying to write/test:
> altering labels to length 60
> Server: Msg 5074, Level 16, State 4, Line 5
> The object 'ALTPART_ANNOT_ANNOTID_FK' is dependent on column 'label'.
> I used this to bracket my script:
> sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"
> go
> sp_msforeachtable "ALTER TABLE ? DISABLE TRIGGER all"
> go

Since you did not include the actual code that implements the change,
I will have to guess. My guess is that you change the length of a
PK column that is referenced by an FK.

If that is the case, you indeed have to drop the FK, as an FK must
always be of the same data type as the key it refers to. SQL Server
cannot know that you are altering both columns, so it only sees that
you are breaking the rule.

> sp_msforeachtable @.command1="print '?'",
> @.command2="ALTER TABLE ? CHECK CONSTRAINT all"

When you reenable constraints, you should use this quirky syntax:

@.command2="ALTER TABLE ? WITH CHEC CHECK CONSTRAINT all"

This forces SQL Server to re-check the constraints. While this take
much longer time, it also means that the optimizer can trust these
constraints and take them in regard when computing a query plan. In
some situations this can have drastic effects on the performance
of the application.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||<snip>
>Since you did not include the actual code that implements the change,
>I will have to guess. My guess is that you change the length of a
>PK column that is referenced by an FK.
>If that is the case, you indeed have to drop the FK, as an FK must
>always be of the same data type as the key it refers to. SQL Server
>cannot know that you are altering both columns, so it only sees that
>you are breaking the rule.
>> sp_msforeachtable @.command1="print '?'",
>> @.command2="ALTER TABLE ? CHECK CONSTRAINT all"
>When you reenable constraints, you should use this quirky syntax:
> @.command2="ALTER TABLE ? WITH CHEC CHECK CONSTRAINT all"
>This forces SQL Server to re-check the constraints. While this take
>much longer time, it also means that the optimizer can trust these
>constraints and take them in regard when computing a query plan. In
>some situations this can have drastic effects on the performance
>of the application.
Thanks to both of you, not only for the quick accurate explanation, but also
the reenable recommendation.

I guess I got kind of spoiled by Oracle (I hope that isn't a dirty word here),
but I was able to get things to work better by dropping then re-creating the
constraints.

Yes, I was changing the length of one of the columns in the primary key .

I took some of Erland's other advice I saw elsewhere, and decided not to rely
on any automated tools, and just sat down and grunted through manually
figuring out and implementing the scripts.

regards,

Jeff Kishsql

Alter table errors due to statistics

I'm attempting to change a column data type from int to nvarchar(16) on a
production database. When executing:
alter table x alter column y nvarchar(16)
I get the error:
ALTER TABLE ALTER COLUMN y failed because STATISTICS hind_61_3 accesses this
column
I would be forever grateful if someone could tell me how to get around this
issue.
Thanks in advance,
GaryRun:
drop statistics hind_61_3
and then do your ALTER TABLE.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
"Gary Johnson" <gary.johnson@.geoffreynyc.com> wrote in message
news:8c236$41c72f45$44a72b52$17509@.msgid.meganewsservers.com...
I'm attempting to change a column data type from int to nvarchar(16) on a
production database. When executing:
alter table x alter column y nvarchar(16)
I get the error:
ALTER TABLE ALTER COLUMN y failed because STATISTICS hind_61_3 accesses this
column
I would be forever grateful if someone could tell me how to get around this
issue.
Thanks in advance,
Gary|||Thank you. If I could trouble you once more, how would this get in there?
We've updated hundreds of customers and have found this error on but one
site...
Again, thank you!
Gary
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:OnHXHCt5EHA.344@.TK2MSFTNGP10.phx.gbl...
> Run:
> drop statistics hind_61_3
> and then do your ALTER TABLE.
> --
> Tom
> ---
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com
>
> "Gary Johnson" <gary.johnson@.geoffreynyc.com> wrote in message
> news:8c236$41c72f45$44a72b52$17509@.msgid.meganewsservers.com...
> I'm attempting to change a column data type from int to nvarchar(16) on a
> production database. When executing:
> alter table x alter column y nvarchar(16)
> I get the error:
> ALTER TABLE ALTER COLUMN y failed because STATISTICS hind_61_3 accesses
> this
> column
>
> I would be forever grateful if someone could tell me how to get around
> this
> issue.
> Thanks in advance,
> Gary
>
>|||You probably have auto-create stats and auto-update stats turned on. This
is normal. If SQL Server figures it needs stats on that column, then it
creates them. However, if you decide to alter the column, the stats are a
dependency on that column in the same wan an index or constraint is. You
have to drop those dependencies first before altering the column.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
"Gary Johnson" <gary.johnson@.geoffreynyc.com> wrote in message
news:15de1$41c73bd8$44a72b52$18777@.msgid.meganewsservers.com...
Thank you. If I could trouble you once more, how would this get in there?
We've updated hundreds of customers and have found this error on but one
site...
Again, thank you!
Gary
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:OnHXHCt5EHA.344@.TK2MSFTNGP10.phx.gbl...
> Run:
> drop statistics hind_61_3
> and then do your ALTER TABLE.
> --
> Tom
> ---
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com
>
> "Gary Johnson" <gary.johnson@.geoffreynyc.com> wrote in message
> news:8c236$41c72f45$44a72b52$17509@.msgid.meganewsservers.com...
> I'm attempting to change a column data type from int to nvarchar(16) on a
> production database. When executing:
> alter table x alter column y nvarchar(16)
> I get the error:
> ALTER TABLE ALTER COLUMN y failed because STATISTICS hind_61_3 accesses
> this
> column
>
> I would be forever grateful if someone could tell me how to get around
> this
> issue.
> Thanks in advance,
> Gary
>
>|||The hind_ statistics are really not statistics, but Hypothetical INDexes,
created by the Index Tuning Wizard, which normally are cleaned up up when
ITW finishes. There are some situations where it doesn't clean up after
itself, so you have to do it with DROP STATISTICS. Since it is a very rare
occurrence to have these left behind, it's not surprising that you don't see
this error very often.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Gary Johnson" <gary.johnson@.geoffreynyc.com> wrote in message
news:15de1$41c73bd8$44a72b52$18777@.msgid.meganewsservers.com...
> Thank you. If I could trouble you once more, how would this get in there?
> We've updated hundreds of customers and have found this error on but one
> site...
> Again, thank you!
> Gary
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:OnHXHCt5EHA.344@.TK2MSFTNGP10.phx.gbl...
>> Run:
>> drop statistics hind_61_3
>> and then do your ALTER TABLE.
>> --
>> Tom
>> ---
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> SQL Server MVP
>> Columnist, SQL Server Professional
>> Toronto, ON Canada
>> www.pinnaclepublishing.com
>>
>> "Gary Johnson" <gary.johnson@.geoffreynyc.com> wrote in message
>> news:8c236$41c72f45$44a72b52$17509@.msgid.meganewsservers.com...
>> I'm attempting to change a column data type from int to nvarchar(16) on a
>> production database. When executing:
>> alter table x alter column y nvarchar(16)
>> I get the error:
>> ALTER TABLE ALTER COLUMN y failed because STATISTICS hind_61_3 accesses
>> this
>> column
>>
>> I would be forever grateful if someone could tell me how to get around
>> this
>> issue.
>> Thanks in advance,
>> Gary
>>
>

Alter table errors due to statistics

I'm attempting to change a column data type from int to nvarchar(16) on a
production database. When executing:
alter table x alter column y nvarchar(16)
I get the error:
ALTER TABLE ALTER COLUMN y failed because STATISTICS hind_61_3 accesses this
column
I would be forever grateful if someone could tell me how to get around this
issue.
Thanks in advance,
Gary
Run:
drop statistics hind_61_3
and then do your ALTER TABLE.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
"Gary Johnson" <gary.johnson@.geoffreynyc.com> wrote in message
news:8c236$41c72f45$44a72b52$17509@.msgid.meganewss ervers.com...
I'm attempting to change a column data type from int to nvarchar(16) on a
production database. When executing:
alter table x alter column y nvarchar(16)
I get the error:
ALTER TABLE ALTER COLUMN y failed because STATISTICS hind_61_3 accesses this
column
I would be forever grateful if someone could tell me how to get around this
issue.
Thanks in advance,
Gary
|||Thank you. If I could trouble you once more, how would this get in there?
We've updated hundreds of customers and have found this error on but one
site...
Again, thank you!
Gary
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:OnHXHCt5EHA.344@.TK2MSFTNGP10.phx.gbl...
> Run:
> drop statistics hind_61_3
> and then do your ALTER TABLE.
> --
> Tom
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com
>
> "Gary Johnson" <gary.johnson@.geoffreynyc.com> wrote in message
> news:8c236$41c72f45$44a72b52$17509@.msgid.meganewss ervers.com...
> I'm attempting to change a column data type from int to nvarchar(16) on a
> production database. When executing:
> alter table x alter column y nvarchar(16)
> I get the error:
> ALTER TABLE ALTER COLUMN y failed because STATISTICS hind_61_3 accesses
> this
> column
>
> I would be forever grateful if someone could tell me how to get around
> this
> issue.
> Thanks in advance,
> Gary
>
>
|||You probably have auto-create stats and auto-update stats turned on. This
is normal. If SQL Server figures it needs stats on that column, then it
creates them. However, if you decide to alter the column, the stats are a
dependency on that column in the same wan an index or constraint is. You
have to drop those dependencies first before altering the column.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
"Gary Johnson" <gary.johnson@.geoffreynyc.com> wrote in message
news:15de1$41c73bd8$44a72b52$18777@.msgid.meganewss ervers.com...
Thank you. If I could trouble you once more, how would this get in there?
We've updated hundreds of customers and have found this error on but one
site...
Again, thank you!
Gary
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:OnHXHCt5EHA.344@.TK2MSFTNGP10.phx.gbl...
> Run:
> drop statistics hind_61_3
> and then do your ALTER TABLE.
> --
> Tom
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com
>
> "Gary Johnson" <gary.johnson@.geoffreynyc.com> wrote in message
> news:8c236$41c72f45$44a72b52$17509@.msgid.meganewss ervers.com...
> I'm attempting to change a column data type from int to nvarchar(16) on a
> production database. When executing:
> alter table x alter column y nvarchar(16)
> I get the error:
> ALTER TABLE ALTER COLUMN y failed because STATISTICS hind_61_3 accesses
> this
> column
>
> I would be forever grateful if someone could tell me how to get around
> this
> issue.
> Thanks in advance,
> Gary
>
>
|||The hind_ statistics are really not statistics, but Hypothetical INDexes,
created by the Index Tuning Wizard, which normally are cleaned up up when
ITW finishes. There are some situations where it doesn't clean up after
itself, so you have to do it with DROP STATISTICS. Since it is a very rare
occurrence to have these left behind, it's not surprising that you don't see
this error very often.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Gary Johnson" <gary.johnson@.geoffreynyc.com> wrote in message
news:15de1$41c73bd8$44a72b52$18777@.msgid.meganewss ervers.com...
> Thank you. If I could trouble you once more, how would this get in there?
> We've updated hundreds of customers and have found this error on but one
> site...
> Again, thank you!
> Gary
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:OnHXHCt5EHA.344@.TK2MSFTNGP10.phx.gbl...
>
sql

Monday, February 13, 2012

Alloocation Errors in Database

I have a customer, who had a problem with their RAID which among others was
hosting their database. They managed to get the data recovered but the
database is facing a lot of problems. In their application they get the
following error :
"Could not continue scan with NOLOCK due to data movement". I get the same
error trying query some of the tables and I get a lot of errors about
allocation errors. I've tried CheckDB and CheckTable. Both reporting that
the errors are so severe that they are unrepairable. So my conclusion is
that the only solution is to restore the latest backup or is there any other
options.. The reason I'm asking is that my customer, of course, doesn't have
a backup!
It come to my mind that maybe a rebuld of the indexes could do the trick ?
Is it worth a try ?
Any suggestions ?
It's a SQL 2005 SP2.
Regards:)
Bobby HenningsenBobby
Remove NOLOCK hint from the queries
http://blogs.msdn.com/craigfr/archive/2007/06/12/query-failure-with-read-uncommitted.aspx
"Bobby Henningsen" <bobhen@.mail.dk> wrote in message
news:D0FAE134-963A-4624-BD83-F00A9F85118E@.microsoft.com...
>I have a customer, who had a problem with their RAID which among others was
> hosting their database. They managed to get the data recovered but the
> database is facing a lot of problems. In their application they get the
> following error :
> "Could not continue scan with NOLOCK due to data movement". I get the same
> error trying query some of the tables and I get a lot of errors about
> allocation errors. I've tried CheckDB and CheckTable. Both reporting that
> the errors are so severe that they are unrepairable. So my conclusion is
> that the only solution is to restore the latest backup or is there any
> other
> options.. The reason I'm asking is that my customer, of course, doesn't
> have
> a backup!
> It come to my mind that maybe a rebuld of the indexes could do the trick ?
> Is it worth a try ?
> Any suggestions ?
> It's a SQL 2005 SP2.
> Regards:)
> Bobby Henningsen
>|||Hi Uri,
thanks for your answer. I'm very aware of this solution.. My problem is that
it's not the case here.. When using a simple "Select * from table" I get the
error. I'm not using NOLOCK and I'm not using "Read Uncommitted". This has
to be about allocation. And as you can se it's not even possible to run
CheckDB.. So far I've found a couple of tables with this problem.. And
CheckTable won't work, either.
All I wanna know is what my options are :) 'cause if only option is to
restore from a backup I know that my customer is pretty f.... :)
Bobby :)
Bobby Henningsen
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uSN0feV5HHA.3940@.TK2MSFTNGP05.phx.gbl...
> Bobby
> Remove NOLOCK hint from the queries
> http://blogs.msdn.com/craigfr/archive/2007/06/12/query-failure-with-read-uncommitted.aspx
>
> "Bobby Henningsen" <bobhen@.mail.dk> wrote in message
> news:D0FAE134-963A-4624-BD83-F00A9F85118E@.microsoft.com...
>>I have a customer, who had a problem with their RAID which among others
>>was
>> hosting their database. They managed to get the data recovered but the
>> database is facing a lot of problems. In their application they get the
>> following error :
>> "Could not continue scan with NOLOCK due to data movement". I get the
>> same
>> error trying query some of the tables and I get a lot of errors about
>> allocation errors. I've tried CheckDB and CheckTable. Both reporting that
>> the errors are so severe that they are unrepairable. So my conclusion is
>> that the only solution is to restore the latest backup or is there any
>> other
>> options.. The reason I'm asking is that my customer, of course, doesn't
>> have
>> a backup!
>> It come to my mind that maybe a rebuld of the indexes could do the trick
>> ? Is it worth a try ?
>> Any suggestions ?
>> It's a SQL 2005 SP2.
>> Regards:)
>> Bobby Henningsen
>|||Bobby
It is really sad that he does not backup of the database as in that case it
would be better solution.
Since you have identified 'problematic' tables try to delete all indexes on
that table a re-create again See if it helped you
"Bobby Henningsen" <bobhen@.mail.dk> wrote in message
news:F1505CF4-E8EC-4F51-871C-2701374326C1@.microsoft.com...
> Hi Uri,
> thanks for your answer. I'm very aware of this solution.. My problem is
> that it's not the case here.. When using a simple "Select * from table" I
> get the error. I'm not using NOLOCK and I'm not using "Read Uncommitted".
> This has to be about allocation. And as you can se it's not even possible
> to run CheckDB.. So far I've found a couple of tables with this problem..
> And CheckTable won't work, either.
> All I wanna know is what my options are :) 'cause if only option is to
> restore from a backup I know that my customer is pretty f.... :)
> Bobby :)
> Bobby Henningsen
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:uSN0feV5HHA.3940@.TK2MSFTNGP05.phx.gbl...
>> Bobby
>> Remove NOLOCK hint from the queries
>> http://blogs.msdn.com/craigfr/archive/2007/06/12/query-failure-with-read-uncommitted.aspx
>>
>> "Bobby Henningsen" <bobhen@.mail.dk> wrote in message
>> news:D0FAE134-963A-4624-BD83-F00A9F85118E@.microsoft.com...
>>I have a customer, who had a problem with their RAID which among others
>>was
>> hosting their database. They managed to get the data recovered but the
>> database is facing a lot of problems. In their application they get the
>> following error :
>> "Could not continue scan with NOLOCK due to data movement". I get the
>> same
>> error trying query some of the tables and I get a lot of errors about
>> allocation errors. I've tried CheckDB and CheckTable. Both reporting
>> that
>> the errors are so severe that they are unrepairable. So my conclusion is
>> that the only solution is to restore the latest backup or is there any
>> other
>> options.. The reason I'm asking is that my customer, of course, doesn't
>> have
>> a backup!
>> It come to my mind that maybe a rebuld of the indexes could do the trick
>> ? Is it worth a try ?
>> Any suggestions ?
>> It's a SQL 2005 SP2.
>> Regards:)
>> Bobby Henningsen
>>
>|||Hi Bobby!
I noticed this in the MCT group, but I felt I didn't have much to suggest. However, just a few
thoughts:
Be prepared for "restore from backup" alternative. Yes, I hear what you are saying, no backups. But
this is at the psychological level, to set the expectation level right for your customer.
The database is most probably toast. So I'd export as much as possible into a new database. Say you
have for instance a SELECT INTO to the other database. Now, SQL Server will stop when it encounters
the physical corruption. So, for the corrupt tables, you have to work in steps. Like forcing an
index forwards and then backwards, and stopping before the corruption with a WHERE clause. Depending
on where the corruption exists, this might not even be doable (perhaps access to the data pages
isn't allowed at all because of the corruption). Looking at it from the bright side, you will tick
income, as you sit and do this... ;-). This work can be anything from mundane to a complete
nightmare or even not doable (depending of type of corruption, complexity and size of database).
I guess you can Google on tools to salvage a corrupt database. I know of one such tool
(http://www.officerecovery.com/mssql/). I've never used any such tools myself...
Open a case with MS support. Whether or not this will get you further than working on your own, I
don't know. But in most cases, the $'s for a support case is dwarfed by the value of the data.
Bobby, can you drop me an email? I have one private matter I like to talk to you about. See MCT
newsgroup if you can't figure out my email address... ;-)
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Bobby Henningsen" <bobhen@.mail.dk> wrote in message
news:F1505CF4-E8EC-4F51-871C-2701374326C1@.microsoft.com...
> Hi Uri,
> thanks for your answer. I'm very aware of this solution.. My problem is that it's not the case
> here.. When using a simple "Select * from table" I get the error. I'm not using NOLOCK and I'm not
> using "Read Uncommitted". This has to be about allocation. And as you can se it's not even
> possible to run CheckDB.. So far I've found a couple of tables with this problem.. And CheckTable
> won't work, either.
> All I wanna know is what my options are :) 'cause if only option is to restore from a backup I
> know that my customer is pretty f.... :)
> Bobby :)
> Bobby Henningsen
> "Uri Dimant" <urid@.iscar.co.il> wrote in message news:uSN0feV5HHA.3940@.TK2MSFTNGP05.phx.gbl...
>> Bobby
>> Remove NOLOCK hint from the queries
>> http://blogs.msdn.com/craigfr/archive/2007/06/12/query-failure-with-read-uncommitted.aspx
>>
>> "Bobby Henningsen" <bobhen@.mail.dk> wrote in message
>> news:D0FAE134-963A-4624-BD83-F00A9F85118E@.microsoft.com...
>>I have a customer, who had a problem with their RAID which among others was
>> hosting their database. They managed to get the data recovered but the
>> database is facing a lot of problems. In their application they get the
>> following error :
>> "Could not continue scan with NOLOCK due to data movement". I get the same
>> error trying query some of the tables and I get a lot of errors about
>> allocation errors. I've tried CheckDB and CheckTable. Both reporting that
>> the errors are so severe that they are unrepairable. So my conclusion is
>> that the only solution is to restore the latest backup or is there any other
>> options.. The reason I'm asking is that my customer, of course, doesn't have
>> a backup!
>> It come to my mind that maybe a rebuld of the indexes could do the trick ? Is it worth a try ?
>> Any suggestions ?
>> It's a SQL 2005 SP2.
>> Regards:)
>> Bobby Henningsen
>>
>|||On Thu, 23 Aug 2007 11:33:05 +0300, "Uri Dimant" <urid@.iscar.co.il>
wrote:
>Since you have identified 'problematic' tables try to delete all indexes on
>that table a re-create again See if it helped you
I would try that on a COPY of the database, but I sure would not want
to try it on the original. I would want to preserve the original
untouched - or at least with no more changes - and only experiment
with copies.
Roy Harvey
Beacon Falls, CT

Allocation Error in Master DB

Hi,
I wanted to find out if there is a way to fix Master DB. I ran DBCC and it
shows some allocation errors. I understand I can run Repaid_Allow_Data_Loss
with other databases but not with Master, Is this correct? Is there another
way to fix the DB rather than having to restore it?
Thank you.1. change sql server to single mode
2.stop sql server service
3.restore database
: RESTORE DATABASE master FROM DISK='C:\SQLDATA\...\...'
cheers|||Thank you but all my backups have the same errors as well so I need fix it
somehow.
"jongwoo" <jongwoo@.discussions.microsoft.com> wrote in message
news:DE879B08-EDAC-4B05-BDFA-0CBAFC9E5F28@.microsoft.com...
> 1. change sql server to single mode
> 2.stop sql server service
> 3.restore database
> : RESTORE DATABASE master FROM DISK='C:\SQLDATA\...\...'
> cheers|||If you give as much error message info as possible, we should be more able t
o
help out.

Allocation Error in Master DB

Hi,
I wanted to find out if there is a way to fix Master DB. I ran DBCC and it
shows some allocation errors. I understand I can run Repaid_Allow_Data_Loss
with other databases but not with Master, Is this correct? Is there another
way to fix the DB rather than having to restore it?
Thank you.1. change sql server to single mode
2.stop sql server service
3.restore database
: RESTORE DATABASE master FROM DISK='C:\SQLDATA\...\...'
cheers|||Thank you but all my backups have the same errors as well so I need fix it
somehow.
"jongwoo" <jongwoo@.discussions.microsoft.com> wrote in message
news:DE879B08-EDAC-4B05-BDFA-0CBAFC9E5F28@.microsoft.com...
> 1. change sql server to single mode
> 2.stop sql server service
> 3.restore database
> : RESTORE DATABASE master FROM DISK='C:\SQLDATA\...\...'
> cheers|||If you give as much error message info as possible, we should be more able to
help out.