Showing posts with label sql2k. Show all posts
Showing posts with label sql2k. Show all posts

Sunday, March 25, 2012

DBCC SHOWCONTIG and SQL2k Maintenance Plan Question

When performing the DBCC SHOWCONTIG will this perform table locks? If
I use the WITH FAST option will this allow data to be written to the file?
Also when using the maintenance plan wizard to perform maintenance, will
tables be locked when the indexes are rebuilt and data is reorganized?
Thanks,
-Ben(I'm assuming you're using SQL Server 2000 as you mention the WITH FAST
option I added in that release)
DBCC SHOWCONTIG ... WITH FAST takes a table IS lock - thus allowing updates.
Without WITH FAST is takes a table S lock. Look in BOL for more details
here.
Rebuilding an index requires a table S lock if you're rebuilding a
non-clustered index, and a table X lock for rebuilding a clustered index.
Running DBCC INDEXDEFRAG only requires a table IX lock - so allows updates.
You should read the whitepaper below for more details:
http://www.microsoft.com/technet/tr...ze/ss2kidbp.asp
Regards.
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ben" <ben@.brainspout.com> wrote in message
news:uoGzfuO5DHA.1368@.TK2MSFTNGP10.phx.gbl...
quote:

> When performing the DBCC SHOWCONTIG will this perform table locks? If
> I use the WITH FAST option will this allow data to be written to the file?
> Also when using the maintenance plan wizard to perform maintenance, will
> tables be locked when the indexes are rebuilt and data is reorganized?
> Thanks,
> -Ben
>

DBCC SHOWCONTIG and SQL2k Maintenance Plan Question

When performing the DBCC SHOWCONTIG will this perform table locks? If
I use the WITH FAST option will this allow data to be written to the file?
Also when using the maintenance plan wizard to perform maintenance, will
tables be locked when the indexes are rebuilt and data is reorganized?
Thanks,
-Ben(I'm assuming you're using SQL Server 2000 as you mention the WITH FAST
option I added in that release)
DBCC SHOWCONTIG ... WITH FAST takes a table IS lock - thus allowing updates.
Without WITH FAST is takes a table S lock. Look in BOL for more details
here.
Rebuilding an index requires a table S lock if you're rebuilding a
non-clustered index, and a table X lock for rebuilding a clustered index.
Running DBCC INDEXDEFRAG only requires a table IX lock - so allows updates.
You should read the whitepaper below for more details:
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/sql/maintain/optimize/ss2kidbp.asp
Regards.
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ben" <ben@.brainspout.com> wrote in message
news:uoGzfuO5DHA.1368@.TK2MSFTNGP10.phx.gbl...
> When performing the DBCC SHOWCONTIG will this perform table locks? If
> I use the WITH FAST option will this allow data to be written to the file?
> Also when using the maintenance plan wizard to perform maintenance, will
> tables be locked when the indexes are rebuilt and data is reorganized?
> Thanks,
> -Ben
>

Wednesday, March 21, 2012

dbcc opentran with tableresults

sql2k sp3
How do I get the results of "dbcc opentran with
tableresults" into an actual table? Something along the
lines of;
create table #temp(c1 varchar(50),c2 varchar(50))
insert into #temp (c1,c2) values
(dbcc opentran with tableresults)
select * from #temp
drop table #temp
TIA, ChrisHi Chris
Once you have the table created, you can use the INSERT/EXEC syntax to
populate it:
insert into #temp
exec ('dbcc opentran(pubs) with tableresults')
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"chris" <anonymous@.discussions.microsoft.com> wrote in message
news:09d701c3ce6b$37e9d640$a001280a@.phx.gbl...
> sql2k sp3
> How do I get the results of "dbcc opentran with
> tableresults" into an actual table? Something along the
> lines of;
> create table #temp(c1 varchar(50),c2 varchar(50))
> insert into #temp (c1,c2) values
> (dbcc opentran with tableresults)
> select * from #temp
> drop table #temp
> TIA, Chris|||create table #temp(c1 varchar(50),c2 varchar(50))
insert into #temp (c1,c2)
exec ('dbcc opentran with tableresults')
select * from #temp
drop table #temp
>--Original Message--
>sql2k sp3
>How do I get the results of "dbcc opentran with
>tableresults" into an actual table? Something along the
>lines of;
>create table #temp(c1 varchar(50),c2 varchar(50))
>insert into #temp (c1,c2) values
>(dbcc opentran with tableresults)
>select * from #temp
>drop table #temp
>TIA, Chris
>.
>

Monday, March 19, 2012

DBCC LOG

Dear all,
I would like to do an application. As frontend VB6 and as backend, of
course, Sql2k or sql25k. Anyway my main goal is that such application might
look for information stored inside .LDF files.
Searches and so on will be done by mean DBCC commands as dbcc log and all
that sort of stuff.
I am stuck on how do I for to stored the info provided for DBCC command to a
Sql table.
It doesn't work:
insert into log_x(current_lsn, operation,,,,,,) dbcc log(mydb,-1)
Thanks for any advice or thought.
This code and information are provided "as is" without warranty of any kind.
Please post statements as well as any error message in order to understand
better your request.I'm guessing your problem might be related to the fact that dbcc log(mydb,-1
)
command returns multiple records sets. One way to get around this is to get
the output of the DBCC command to a flat file then import that flat file int
o
a table.
If you are looking for SQL Server examples check out my Website at
http://www.geocities.com/sqlserverexamples
"Enric" wrote:

> Dear all,
> I would like to do an application. As frontend VB6 and as backend, of
> course, Sql2k or sql25k. Anyway my main goal is that such application migh
t
> look for information stored inside .LDF files.
> Searches and so on will be done by mean DBCC commands as dbcc log and all
> that sort of stuff.
> I am stuck on how do I for to stored the info provided for DBCC command to
a
> Sql table.
> It doesn't work:
> insert into log_x(current_lsn, operation,,,,,,) dbcc log(mydb,-1)
> Thanks for any advice or thought.
> --
> This code and information are provided "as is" without warranty of any kin
d.
> Please post statements as well as any error message in order to understand
> better your request.

Sunday, March 11, 2012

dbcc indexdefrag not doing anything

sql2k sp3
I keep running dbcc indexdefrag on a small(236,492 rows)
table and it doesnt change the output of the Scan Density
(best count:actual count) from dbcc showcontig at all.
Any ideas?
TIA, ChrisDoes your table have a clustered index?
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
"chris" <anonymous@.discussions.microsoft.com> wrote in message
news:556301c3e508$94bae040$a501280a@.phx.gbl...
> sql2k sp3
> I keep running dbcc indexdefrag on a small(236,492 rows)
> table and it doesnt change the output of the Scan Density
> (best count:actual count) from dbcc showcontig at all.
>
> Any ideas?
> TIA, Chris
>|||Yes. Thats the index Im trying to defragment.
>--Original Message--
>Does your table have a clustered index?
>--
>Geoff N. Hiten
>Microsoft SQL Server MVP
>Senior Database Administrator
>Careerbuilder.com
>"chris" <anonymous@.discussions.microsoft.com> wrote in
message
>news:556301c3e508$94bae040$a501280a@.phx.gbl...
>> sql2k sp3
>> I keep running dbcc indexdefrag on a small(236,492 rows)
>> table and it doesnt change the output of the Scan
Density
>> (best count:actual count) from dbcc showcontig at all.
>>
>> Any ideas?
>> TIA, Chris
>
>.
>|||Ok, DBCC IndexDefrag does an in-place defrag thus there are no new
allocations. Therefore the physical page/extent fragmentation will remain,
even though the rows are now in physical order on the pages. One of the
hidden limitations of INDEXDEFRAG vs. DBREINDEX.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
"chris" <anonymous@.discussions.microsoft.com> wrote in message
news:583c01c3e50b$62b95560$a601280a@.phx.gbl...
> Yes. Thats the index Im trying to defragment.
> >--Original Message--
> >Does your table have a clustered index?
> >
> >--
> >Geoff N. Hiten
> >Microsoft SQL Server MVP
> >Senior Database Administrator
> >Careerbuilder.com
> >
> >"chris" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:556301c3e508$94bae040$a501280a@.phx.gbl...
> >> sql2k sp3
> >>
> >> I keep running dbcc indexdefrag on a small(236,492 rows)
> >> table and it doesnt change the output of the Scan
> Density
> >> (best count:actual count) from dbcc showcontig at all.
> >>
> >>
> >> Any ideas?
> >>
> >> TIA, Chris
> >>
> >
> >
> >.
> >|||Just to clarify, this means that the table is actually de-
fraged, it just appears otherwise?
>--Original Message--
>Ok, DBCC IndexDefrag does an in-place defrag thus there
are no new
>allocations. Therefore the physical page/extent
fragmentation will remain,
>even though the rows are now in physical order on the
pages. One of the
>hidden limitations of INDEXDEFRAG vs. DBREINDEX.
>--
>Geoff N. Hiten
>Microsoft SQL Server MVP
>Senior Database Administrator
>Careerbuilder.com
>"chris" <anonymous@.discussions.microsoft.com> wrote in
message
>news:583c01c3e50b$62b95560$a601280a@.phx.gbl...
>> Yes. Thats the index Im trying to defragment.
>> >--Original Message--
>> >Does your table have a clustered index?
>> >
>> >--
>> >Geoff N. Hiten
>> >Microsoft SQL Server MVP
>> >Senior Database Administrator
>> >Careerbuilder.com
>> >
>> >"chris" <anonymous@.discussions.microsoft.com> wrote in
>> message
>> >news:556301c3e508$94bae040$a501280a@.phx.gbl...
>> >> sql2k sp3
>> >>
>> >> I keep running dbcc indexdefrag on a small(236,492
rows)
>> >> table and it doesnt change the output of the Scan
>> Density
>> >> (best count:actual count) from dbcc showcontig at
all.
>> >>
>> >>
>> >> Any ideas?
>> >>
>> >> TIA, Chris
>> >>
>> >
>> >
>> >.
>> >
>
>.
>|||The index rows are in physical order on each page. Page allocations are not
altered so if the pages are scattered around the database, that will not
change.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
"chris" <anonymous@.discussions.microsoft.com> wrote in message
news:557401c3e50e$bf0d2b40$a401280a@.phx.gbl...
> Just to clarify, this means that the table is actually de-
> fraged, it just appears otherwise?
> >--Original Message--
> >Ok, DBCC IndexDefrag does an in-place defrag thus there
> are no new
> >allocations. Therefore the physical page/extent
> fragmentation will remain,
> >even though the rows are now in physical order on the
> pages. One of the
> >hidden limitations of INDEXDEFRAG vs. DBREINDEX.
> >
> >--
> >Geoff N. Hiten
> >Microsoft SQL Server MVP
> >Senior Database Administrator
> >Careerbuilder.com
> >
> >"chris" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:583c01c3e50b$62b95560$a601280a@.phx.gbl...
> >> Yes. Thats the index Im trying to defragment.
> >>
> >> >--Original Message--
> >> >Does your table have a clustered index?
> >> >
> >> >--
> >> >Geoff N. Hiten
> >> >Microsoft SQL Server MVP
> >> >Senior Database Administrator
> >> >Careerbuilder.com
> >> >
> >> >"chris" <anonymous@.discussions.microsoft.com> wrote in
> >> message
> >> >news:556301c3e508$94bae040$a501280a@.phx.gbl...
> >> >> sql2k sp3
> >> >>
> >> >> I keep running dbcc indexdefrag on a small(236,492
> rows)
> >> >> table and it doesnt change the output of the Scan
> >> Density
> >> >> (best count:actual count) from dbcc showcontig at
> all.
> >> >>
> >> >>
> >> >> Any ideas?
> >> >>
> >> >> TIA, Chris
> >> >>
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >|||In addition to Geoff's remarks: DBCC INDEXDEFRAG will skip locked rows.
So if your database has much locking activity during defragmentation,
the DBCC command will be less effective.
Gert-Jan|||And in addition to that Indexdefrag only works on 1 file at a time. This
means extent fragmentation is useless on multiple files.
--
Andrew J. Kelly SQL MVP
"Gert-Jan Strik" <sorry@.toomuchspamalready.nl> wrote in message
news:4016C868.AD86E998@.toomuchspamalready.nl...
> In addition to Geoff's remarks: DBCC INDEXDEFRAG will skip locked rows.
> So if your database has much locking activity during defragmentation,
> the DBCC command will be less effective.
> Gert-Jan|||And in addition to that <g>, scan density is useless in the first place if > 1 data file. Chris,
look at Logical Scan Fragmentation if you have > 1 data file.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Andrew J. Kelly" <sqlmvpnoooospam@.shadhawk.com> wrote in message
news:e8DQroU5DHA.360@.TK2MSFTNGP12.phx.gbl...
> And in addition to that Indexdefrag only works on 1 file at a time. This
> means extent fragmentation is useless on multiple files.
> --
> Andrew J. Kelly SQL MVP
>
> "Gert-Jan Strik" <sorry@.toomuchspamalready.nl> wrote in message
> news:4016C868.AD86E998@.toomuchspamalready.nl...
> > In addition to Geoff's remarks: DBCC INDEXDEFRAG will skip locked rows.
> > So if your database has much locking activity during defragmentation,
> > the DBCC command will be less effective.
> >
> > Gert-Jan
>|||BTW, all of this information is documented very clearly in BOL for DBCC
SHOWCONTIG and DBCC INDEXDFRAG. You can also read the whitepaper nelow for
more details:
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/sql/maintain/optimize/ss2kidbp.asp
Regards
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OYWte4Y5DHA.2412@.TK2MSFTNGP11.phx.gbl...
> And in addition to that <g>, scan density is useless in the first place if
> 1 data file. Chris,
> look at Logical Scan Fragmentation if you have > 1 data file.
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
>
> "Andrew J. Kelly" <sqlmvpnoooospam@.shadhawk.com> wrote in message
> news:e8DQroU5DHA.360@.TK2MSFTNGP12.phx.gbl...
> > And in addition to that Indexdefrag only works on 1 file at a time.
This
> > means extent fragmentation is useless on multiple files.
> >
> > --
> > Andrew J. Kelly SQL MVP
> >
> >
> > "Gert-Jan Strik" <sorry@.toomuchspamalready.nl> wrote in message
> > news:4016C868.AD86E998@.toomuchspamalready.nl...
> > > In addition to Geoff's remarks: DBCC INDEXDEFRAG will skip locked
rows.
> > > So if your database has much locking activity during defragmentation,
> > > the DBCC command will be less effective.
> > >
> > > Gert-Jan
> >
> >
>

dbcc indexdefrag not doing anything

sql2k sp3
I keep running dbcc indexdefrag on a small(236,492 rows)
table and it doesnt change the output of the Scan Density
(best count:actual count) from dbcc showcontig at all.
Any ideas?
TIA, ChrisDoes your table have a clustered index?
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
"chris" <anonymous@.discussions.microsoft.com> wrote in message
news:556301c3e508$94bae040$a501280a@.phx.gbl...
quote:

> sql2k sp3
> I keep running dbcc indexdefrag on a small(236,492 rows)
> table and it doesnt change the output of the Scan Density
> (best count:actual count) from dbcc showcontig at all.
>
> Any ideas?
> TIA, Chris
>
|||Yes. Thats the index Im trying to defragment.
quote:

>--Original Message--
>Does your table have a clustered index?
>--
>Geoff N. Hiten
>Microsoft SQL Server MVP
>Senior Database Administrator
>Careerbuilder.com
>"chris" <anonymous@.discussions.microsoft.com> wrote in

message
quote:

>news:556301c3e508$94bae040$a501280a@.phx.gbl...
Density[QUOTE]
>
>.
>
|||Ok, DBCC IndexDefrag does an in-place defrag thus there are no new
allocations. Therefore the physical page/extent fragmentation will remain,
even though the rows are now in physical order on the pages. One of the
hidden limitations of INDEXDEFRAG vs. DBREINDEX.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
"chris" <anonymous@.discussions.microsoft.com> wrote in message
news:583c01c3e50b$62b95560$a601280a@.phx.gbl...[QUOTE]
> Yes. Thats the index Im trying to defragment.
>
> message
> Density|||Just to clarify, this means that the table is actually de-
fraged, it just appears otherwise?
quote:

>--Original Message--
>Ok, DBCC IndexDefrag does an in-place defrag thus there

are no new
quote:

>allocations. Therefore the physical page/extent

fragmentation will remain,
quote:

>even though the rows are now in physical order on the

pages. One of the
quote:

>hidden limitations of INDEXDEFRAG vs. DBREINDEX.
>--
>Geoff N. Hiten
>Microsoft SQL Server MVP
>Senior Database Administrator
>Careerbuilder.com
>"chris" <anonymous@.discussions.microsoft.com> wrote in

message
quote:

>news:583c01c3e50b$62b95560$a601280a@.phx.gbl...
rows)[QUOTE]
all.[QUOTE]
>
>.
>
|||The index rows are in physical order on each page. Page allocations are not
altered so if the pages are scattered around the database, that will not
change.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
"chris" <anonymous@.discussions.microsoft.com> wrote in message
news:557401c3e50e$bf0d2b40$a401280a@.phx.gbl...[QUOTE]
> Just to clarify, this means that the table is actually de-
> fraged, it just appears otherwise?
>
> are no new
> fragmentation will remain,
> pages. One of the
> message
> rows)
> all.|||Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 5
NNTP-Posting-Date: 27 Jan 2004 21:22:04 CET
NNTP-Posting-Host: 194.109.252.208
X-Trace: 1075234924 news.xs4all.nl 316 [::ffff:194.109.252.208]:2369
X-Complaints-To: abuse@.xs4all.nl
Path: TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!npeer.de.k
pn-eurorings.net!news.cambrium.nl!news.cambrium.nl!news.cambrium.nl!newsgate
.cistron.nl!transit.news.xs4all.nl!newsfeed.xs4all.nl!xs4all!not-for-mail
Xref: TK2MSFTNGP08.phx.gbl microsoft.public.sqlserver.server:327667
In addition to Geoff's remarks: DBCC INDEXDEFRAG will skip locked rows.
So if your database has much locking activity during defragmentation,
the DBCC command will be less effective.
Gert-Jan|||And in addition to that Indexdefrag only works on 1 file at a time. This
means extent fragmentation is useless on multiple files.
Andrew J. Kelly SQL MVP
"Gert-Jan Strik" <sorry@.toomuchspamalready.nl> wrote in message
news:4016C868.AD86E998@.toomuchspamalready.nl...
quote:

> In addition to Geoff's remarks: DBCC INDEXDEFRAG will skip locked rows.
> So if your database has much locking activity during defragmentation,
> the DBCC command will be less effective.
> Gert-Jan
|||And in addition to that <g>, scan density is useless in the first place if >
1 data file. Chris,
look at Logical Scan Fragmentation if you have > 1 data file.
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=...ls
erver
"Andrew J. Kelly" <sqlmvpnoooospam@.shadhawk.com> wrote in message
news:e8DQroU5DHA.360@.TK2MSFTNGP12.phx.gbl...
quote:

> And in addition to that Indexdefrag only works on 1 file at a time. This
> means extent fragmentation is useless on multiple files.
> --
> Andrew J. Kelly SQL MVP
>
> "Gert-Jan Strik" <sorry@.toomuchspamalready.nl> wrote in message
> news:4016C868.AD86E998@.toomuchspamalready.nl...
>
|||BTW, all of this information is documented very clearly in BOL for DBCC
SHOWCONTIG and DBCC INDEXDFRAG. You can also read the whitepaper nelow for
more details:
http://www.microsoft.com/technet/tr...ze/ss2kidbp.asp
Regards
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OYWte4Y5DHA.2412@.TK2MSFTNGP11.phx.gbl...
quote:

> And in addition to that <g>, scan density is useless in the first place if
> 1 data file. Chris,
> look at Logical Scan Fragmentation if you have > 1 data file.
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:

http://groups.google.com/groups?oi=...ublic.sqlserver
quote:

>
> "Andrew J. Kelly" <sqlmvpnoooospam@.shadhawk.com> wrote in message
> news:e8DQroU5DHA.360@.TK2MSFTNGP12.phx.gbl...
This[QUOTE]
rows.[QUOTE]
>

Wednesday, March 7, 2012

dbcc dbreindex problems

sql2k sp3
When running:
dbcc dbreindex ('dev.dbo.transdtl')
I get:
Server: Msg 1505, Level 16, State 1, Line 1
CREATE UNIQUE INDEX terminated because a duplicate key was found for index
ID 1. Most significant primary key is '8216076'.
The statement has been terminated.
Now this doesn't make sense. TransDTLKey is the PK column for this table. No
other unique constraints are defined. So I:
select transdtlkey
from transdtl
group by transdtlkey
having count(transdtlkey) > 1
and get back 0 records.
Ideas?
TIA, ChrisRSmells like data corruption to me. Did you DBCC CHECKTABLE? Also, I vaguely recall this (I might be
have been dreaming, though), I'd search the newsgroups archive as well...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:2C94CEF3-9E9C-4C11-8EE6-B302CEC8ABBD@.microsoft.com...
> sql2k sp3
> When running:
> dbcc dbreindex ('dev.dbo.transdtl')
> I get:
> Server: Msg 1505, Level 16, State 1, Line 1
> CREATE UNIQUE INDEX terminated because a duplicate key was found for index
> ID 1. Most significant primary key is '8216076'.
> The statement has been terminated.
> Now this doesn't make sense. TransDTLKey is the PK column for this table. No
> other unique constraints are defined. So I:
> select transdtlkey
> from transdtl
> group by transdtlkey
> having count(transdtlkey) > 1
> and get back 0 records.
>
> Ideas?
> TIA, ChrisR|||You are correct:
Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 2511: [Microsoft][ODBC SQL
Server Driver][SQL Server]Table error: Object ID 1945773989, Index ID 0. Keys
out of order on page (1:817776), slots 57 and 58.
[Microsoft][ODBC SQL Server Driver][SQL Server]Table error: Object ID
1945773989, Index ID 16. Keys out of order on page (1:637458), slots 128 and
129.
[Microsoft][ODBC SQL Server Driver][SQL Server]CHECKDB found 0 allocation
errors and 2 consistency errors in table 'TransDtl' (object ID 1945773989).
[Microsoft][ODBC SQL Server Driver][SQL Server]CHECKDB found 0 allocation
errors and 2 consistency errors in database 'DEV'.
[Microsoft][ODBC SQL Server Driver][SQL Server]repair_rebuild is the minimum
repair level for the errors found by DBCC CHECKDB (DEV ).
The problem is though that I ran dbcc checkdb with repair_rebuild and it
errors out because of this issue. So the Checkdb cant fix it and neither can
the Reindex. Any other ideas? A few years back at another job we had to:
Put the data into new tables.
Drop the old table.
Rename the new table.
to get rid of other strange behavior and it seemed to do the trick. I may
try this again here.
"Tibor Karaszi" wrote:
> Smells like data corruption to me. Did you DBCC CHECKTABLE? Also, I vaguely recall this (I might be
> have been dreaming, though), I'd search the newsgroups archive as well...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
> news:2C94CEF3-9E9C-4C11-8EE6-B302CEC8ABBD@.microsoft.com...
> > sql2k sp3
> >
> > When running:
> >
> > dbcc dbreindex ('dev.dbo.transdtl')
> >
> > I get:
> >
> > Server: Msg 1505, Level 16, State 1, Line 1
> > CREATE UNIQUE INDEX terminated because a duplicate key was found for index
> > ID 1. Most significant primary key is '8216076'.
> > The statement has been terminated.
> >
> > Now this doesn't make sense. TransDTLKey is the PK column for this table. No
> > other unique constraints are defined. So I:
> >
> > select transdtlkey
> > from transdtl
> > group by transdtlkey
> > having count(transdtlkey) > 1
> >
> > and get back 0 records.
> >
> >
> > Ideas?
> >
> > TIA, ChrisR
>
>|||ChrisR wrote:
> You are correct:
> Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 2511:
> [Microsoft][ODBC SQL Server Driver][SQL Server]Table error: Object ID
> 1945773989, Index ID 0. Keys out of order on page (1:817776), slots
> 57 and 58. [Microsoft][ODBC SQL Server Driver][SQL Server]Table
> error: Object ID 1945773989, Index ID 16. Keys out of order on page
> (1:637458), slots 128 and 129.
> [Microsoft][ODBC SQL Server Driver][SQL Server]CHECKDB found 0
> allocation errors and 2 consistency errors in table 'TransDtl'
> (object ID 1945773989). [Microsoft][ODBC SQL Server Driver][SQL
> Server]CHECKDB found 0 allocation errors and 2 consistency errors in
> database 'DEV'. [Microsoft][ODBC SQL Server Driver][SQL
> Server]repair_rebuild is the minimum repair level for the errors
> found by DBCC CHECKDB (DEV ).
>
> The problem is though that I ran dbcc checkdb with repair_rebuild and
> it errors out because of this issue. So the Checkdb cant fix it and
> neither can the Reindex. Any other ideas? A few years back at another
> job we had to:
> Put the data into new tables.
> Drop the old table.
> Rename the new table.
> to get rid of other strange behavior and it seemed to do the trick. I
> may try this again here.
>
If you script out the table and data, can you try using the
REPAIR_ALLOW_DATA_LOSS option with dbcc checkdb. You can do this under a
user transaction to examine the differences (or data loss) when compared
to the copy of the table. If you find the repairs sufficient, you can
update rows from the table copy and then insert missing rows from the
table copy to get the tables in sync.
You obviously want to script out this whole procedure before you commit
to tying up production data for too long. OTOH, if your production table
is corrupt, the sooner you fix it, the better.
--
David Gugick
Imceda Software
www.imceda.com|||Im lucky in that this is a development db.
"David Gugick" wrote:
> ChrisR wrote:
> > You are correct:
> >
> > Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 2511:
> > [Microsoft][ODBC SQL Server Driver][SQL Server]Table error: Object ID
> > 1945773989, Index ID 0. Keys out of order on page (1:817776), slots
> > 57 and 58. [Microsoft][ODBC SQL Server Driver][SQL Server]Table
> > error: Object ID 1945773989, Index ID 16. Keys out of order on page
> > (1:637458), slots 128 and 129.
> > [Microsoft][ODBC SQL Server Driver][SQL Server]CHECKDB found 0
> > allocation errors and 2 consistency errors in table 'TransDtl'
> > (object ID 1945773989). [Microsoft][ODBC SQL Server Driver][SQL
> > Server]CHECKDB found 0 allocation errors and 2 consistency errors in
> > database 'DEV'. [Microsoft][ODBC SQL Server Driver][SQL
> > Server]repair_rebuild is the minimum repair level for the errors
> > found by DBCC CHECKDB (DEV ).
> >
> >
> > The problem is though that I ran dbcc checkdb with repair_rebuild and
> > it errors out because of this issue. So the Checkdb cant fix it and
> > neither can the Reindex. Any other ideas? A few years back at another
> > job we had to:
> >
> > Put the data into new tables.
> > Drop the old table.
> > Rename the new table.
> >
> > to get rid of other strange behavior and it seemed to do the trick. I
> > may try this again here.
> >
> >
> If you script out the table and data, can you try using the
> REPAIR_ALLOW_DATA_LOSS option with dbcc checkdb. You can do this under a
> user transaction to examine the differences (or data loss) when compared
> to the copy of the table. If you find the repairs sufficient, you can
> update rows from the table copy and then insert missing rows from the
> table copy to get the tables in sync.
> You obviously want to script out this whole procedure before you commit
> to tying up production data for too long. OTOH, if your production table
> is corrupt, the sooner you fix it, the better.
> --
> David Gugick
> Imceda Software
> www.imceda.com
>|||1. Read about the specific error numbers in the updated Books Online. The update includes detailed
explanations for all corruption types of errors, including suggested actions. Execute the DBCC CHECK
command from QA so you get all error numbers back (Maint Wiz only return error number from first
error that a command generates).
2. Generic recommendations:
http://www.karaszi.com/SQLServer/info_corrupt_suspect_db.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:BE9354B5-AB7D-407E-ABCB-60E8A46233F2@.microsoft.com...
> You are correct:
> Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 2511: [Microsoft][ODBC SQL
> Server Driver][SQL Server]Table error: Object ID 1945773989, Index ID 0. Keys
> out of order on page (1:817776), slots 57 and 58.
> [Microsoft][ODBC SQL Server Driver][SQL Server]Table error: Object ID
> 1945773989, Index ID 16. Keys out of order on page (1:637458), slots 128 and
> 129.
> [Microsoft][ODBC SQL Server Driver][SQL Server]CHECKDB found 0 allocation
> errors and 2 consistency errors in table 'TransDtl' (object ID 1945773989).
> [Microsoft][ODBC SQL Server Driver][SQL Server]CHECKDB found 0 allocation
> errors and 2 consistency errors in database 'DEV'.
> [Microsoft][ODBC SQL Server Driver][SQL Server]repair_rebuild is the minimum
> repair level for the errors found by DBCC CHECKDB (DEV ).
>
> The problem is though that I ran dbcc checkdb with repair_rebuild and it
> errors out because of this issue. So the Checkdb cant fix it and neither can
> the Reindex. Any other ideas? A few years back at another job we had to:
> Put the data into new tables.
> Drop the old table.
> Rename the new table.
> to get rid of other strange behavior and it seemed to do the trick. I may
> try this again here.
>
> "Tibor Karaszi" wrote:
>> Smells like data corruption to me. Did you DBCC CHECKTABLE? Also, I vaguely recall this (I might
>> be
>> have been dreaming, though), I'd search the newsgroups archive as well...
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
>> news:2C94CEF3-9E9C-4C11-8EE6-B302CEC8ABBD@.microsoft.com...
>> > sql2k sp3
>> >
>> > When running:
>> >
>> > dbcc dbreindex ('dev.dbo.transdtl')
>> >
>> > I get:
>> >
>> > Server: Msg 1505, Level 16, State 1, Line 1
>> > CREATE UNIQUE INDEX terminated because a duplicate key was found for index
>> > ID 1. Most significant primary key is '8216076'.
>> > The statement has been terminated.
>> >
>> > Now this doesn't make sense. TransDTLKey is the PK column for this table. No
>> > other unique constraints are defined. So I:
>> >
>> > select transdtlkey
>> > from transdtl
>> > group by transdtlkey
>> > having count(transdtlkey) > 1
>> >
>> > and get back 0 records.
>> >
>> >
>> > Ideas?
>> >
>> > TIA, ChrisR
>>

Saturday, February 25, 2012

DBCC DBReindex

Hi,
We have finished SQL upgrade recently from SQL 7 to SQL2K. One thing that we
have noticed is we used to run DBReindex before on SQL 7 but the log file
stay with in the limit. However, with SQL 2K when we run DBReindex. log file
grow crazy.
Is this normal behavior of DBreindex on SQL2K. Can we turn off logging?
We have Full recovery model configured on SQL 2K.
Another neat way in SQL 2K is to use IndexDefrag. I am afraid though, will
IndexFrag also increase the log file size dramatically.
Also, is there any whie paper that talks about the pros and cons of these
two methods of defraging data in SQL.
Your help is appreciated.
Thanks,
MohHere's a new whitepaper that I helped with that discusses pros and cons of
indexdefrag and dbreindex.
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/sql/maintain/optimize/ss2kidbp.asp
Enjoy!
--
Paul Randal
DBCC Technical Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Moh Abb" <mabbas@.aligntech.com> wrote in message
news:eJqKOI6TDHA.3796@.tk2msftngp13.phx.gbl...
> Hi,
> We have finished SQL upgrade recently from SQL 7 to SQL2K. One thing that
we
> have noticed is we used to run DBReindex before on SQL 7 but the log file
> stay with in the limit. However, with SQL 2K when we run DBReindex. log
file
> grow crazy.
> Is this normal behavior of DBreindex on SQL2K. Can we turn off logging?
> We have Full recovery model configured on SQL 2K.
> Another neat way in SQL 2K is to use IndexDefrag. I am afraid though, will
> IndexFrag also increase the log file size dramatically.
> Also, is there any whie paper that talks about the pros and cons of these
> two methods of defraging data in SQL.
> Your help is appreciated.
> Thanks,
> Moh
>

Friday, February 17, 2012

DBCC CHECKDB multiple errors

SQL2K
SP4
Error: 7987, Severity: 22, State: 3
A possible database consistency problem has been detected
Ran DBCC CHECKDB on WV database on both servers (the dbs are not copies
of each other but are based on the same information, 1 is on the
development server, the other on the production server) but received
the same error messages for the same tables in both. At the end of the
message was:
CHECKDB found 0 allocation errors and 8 consistency errors in database
'WV'.
repair_allow_data_loss is the minimum repair level for the errors found
by DBCC CHECKDB (WV ).
When I ran DBCC DBREINDEX (as an alternative to allowing data loss) on
the tables indicated, it appeared to fix a few tables that only had 1
consistency error (they no longer show up with inconsistencies) but
there are 2 tables that still show up with multiple errors.
I haven't found a post with all the error messages (8928, 8944, 8964)
and I'm wondering what the best approach to this is to prevent any
data loss.
Ironically, I've never seen msg 8964 before this week, and we
installed SP4 last week, which is supposed to take care of this bug.
Could this have caused the bug?
DBCC results for 'sde.GDB_STRINGDOMAINS'.
Server: Msg 8928, Level 16, State 1, Line 1
Object ID 1648724926, index ID 0: Page (1:155093) could not be
processed. See other errors for details.
Server: Msg 8944, Level 16, State 1, Line 1
Table error: Object ID 1648724926, index ID 0, page (1:155093), row 25.
Test (offsetNull >= BASEOFFSET) failed. Values are 0 and 4.
Server: Msg 8964, Level 16, State 1, Line 1
Table error: Object ID 1648724926. The text, ntext, or image node at
page (1:313603), slot 10, text ID 41680896 is not referenced.
Server: Msg 8964, Level 16, State 1, Line 1
Table error: Object ID 1648724926. The text, ntext, or image node at
page (1:313603), slot 11, text ID 1340932096 is not referenced.
Server: Msg 8964, Level 16, State 1, Line 1
Table error: Object ID 1648724926. The text, ntext, or image node at
page (1:313603), slot 12, text ID 23986176 is not referenced.
Server: Msg 8964, Level 16, State 1, Line 1
Table error: Object ID 1648724926. The text, ntext, or image node at
page (1:313604), slot 0, text ID 96010240 is not referenced.
Server: Msg 8964, Level 16, State 1, Line 1
Table error: Object ID 1648724926. The text, ntext, or image node at
page (1:313604), slot 1, text ID 817430528 is not referenced.
There are 0 rows in 0 pages for object 'sde.GDB_STRINGDOMAINS'.
DBCC results for 'wvowner.f8'.
Server: Msg 8928, Level 16, State 1, Line 1
Object ID 1648724926, index ID 0: Page (1:155093) could not be
processed. See other errors for details.
Server: Msg 8944, Level 16, State 1, Line 1
Table error: Object ID 1648724926, index ID 0, page (1:155093), row 25.
Test (offsetNull >= BASEOFFSET) failed. Values are 0 and 4.
Server: Msg 8964, Level 16, State 1, Line 1
Table error: Object ID 1648724926. The text, ntext, or image node at
page (1:313603), slot 10, text ID 41680896 is not referenced.
Server: Msg 8964, Level 16, State 1, Line 1
Table error: Object ID 1648724926. The text, ntext, or image node at
page (1:313603), slot 11, text ID 1340932096 is not referenced.
Server: Msg 8964, Level 16, State 1, Line 1
Table error: Object ID 1648724926. The text, ntext, or image node at
page (1:313603), slot 12, text ID 23986176 is not referenced.
Server: Msg 8964, Level 16, State 1, Line 1
Table error: Object ID 1648724926. The text, ntext, or image node at
page (1:313604), slot 0, text ID 96010240 is not referenced.
Server: Msg 8964, Level 16, State 1, Line 1
Table error: Object ID 1648724926. The text, ntext, or image node at
page (1:313604), slot 1, text ID 817430528 is not referenced.
There are 1078620 rows in 30728 pages for object 'wvowner.f8'.
CHECKDB found 0 allocation errors and 7 consistency errors in table
'wvowner.f8' (object ID 1648724926).For both of these tables, CHECKDB has found a row whose structure we cannot
validate (row 25 on page 1:155093). Because the structure of the rest of
the page is suspect due to this problem, DBCC will not process the page any
further. The 8964 errors reported are a result of our not processing any of
the data on this page. Running REPAIR_ALLOW_DATA_LOSS will result in this
page being deallocated. Because it is a data page, you will lose data.
(FYI, error 7987 is the run-time check that is equivalent to the corruption
that CHECKDB is reporting. It is a new error in SP4.)
The only way to ensure that you don't lose any data is to restore your last
known good database backups, plus any transaction log backups.
> Ironically, I've never seen msg 8964 before this week, and we
> installed SP4 last week, which is supposed to take care of this bug.
> Could this have caused the bug?
I'm not sure I understand this statement. Which bug are you referring to?
Thanks,
--
Ryan Stonecipher
Microsoft Sql Server Storage Engine, DBCC
This posting is provided "AS IS" with no warranties, and confers no rights.
<naomimsm@.gmail.com> wrote in message
news:1122478968.737696.309790@.f14g2000cwb.googlegroups.com...
> SQL2K
> SP4
> Error: 7987, Severity: 22, State: 3
> A possible database consistency problem has been detected
> Ran DBCC CHECKDB on WV database on both servers (the dbs are not copies
> of each other but are based on the same information, 1 is on the
> development server, the other on the production server) but received
> the same error messages for the same tables in both. At the end of the
> message was:
> CHECKDB found 0 allocation errors and 8 consistency errors in database
> 'WV'.
> repair_allow_data_loss is the minimum repair level for the errors found
> by DBCC CHECKDB (WV ).
> When I ran DBCC DBREINDEX (as an alternative to allowing data loss) on
> the tables indicated, it appeared to fix a few tables that only had 1
> consistency error (they no longer show up with inconsistencies) but
> there are 2 tables that still show up with multiple errors.
> I haven't found a post with all the error messages (8928, 8944, 8964)
> and I'm wondering what the best approach to this is to prevent any
> data loss.
> Ironically, I've never seen msg 8964 before this week, and we
> installed SP4 last week, which is supposed to take care of this bug.
> Could this have caused the bug?
> DBCC results for 'sde.GDB_STRINGDOMAINS'.
> Server: Msg 8928, Level 16, State 1, Line 1
> Object ID 1648724926, index ID 0: Page (1:155093) could not be
> processed. See other errors for details.
> Server: Msg 8944, Level 16, State 1, Line 1
> Table error: Object ID 1648724926, index ID 0, page (1:155093), row 25.
> Test (offsetNull >= BASEOFFSET) failed. Values are 0 and 4.
> Server: Msg 8964, Level 16, State 1, Line 1
> Table error: Object ID 1648724926. The text, ntext, or image node at
> page (1:313603), slot 10, text ID 41680896 is not referenced.
> Server: Msg 8964, Level 16, State 1, Line 1
> Table error: Object ID 1648724926. The text, ntext, or image node at
> page (1:313603), slot 11, text ID 1340932096 is not referenced.
> Server: Msg 8964, Level 16, State 1, Line 1
> Table error: Object ID 1648724926. The text, ntext, or image node at
> page (1:313603), slot 12, text ID 23986176 is not referenced.
> Server: Msg 8964, Level 16, State 1, Line 1
> Table error: Object ID 1648724926. The text, ntext, or image node at
> page (1:313604), slot 0, text ID 96010240 is not referenced.
> Server: Msg 8964, Level 16, State 1, Line 1
> Table error: Object ID 1648724926. The text, ntext, or image node at
> page (1:313604), slot 1, text ID 817430528 is not referenced.
> There are 0 rows in 0 pages for object 'sde.GDB_STRINGDOMAINS'.
>
> DBCC results for 'wvowner.f8'.
> Server: Msg 8928, Level 16, State 1, Line 1
> Object ID 1648724926, index ID 0: Page (1:155093) could not be
> processed. See other errors for details.
> Server: Msg 8944, Level 16, State 1, Line 1
> Table error: Object ID 1648724926, index ID 0, page (1:155093), row 25.
> Test (offsetNull >= BASEOFFSET) failed. Values are 0 and 4.
> Server: Msg 8964, Level 16, State 1, Line 1
> Table error: Object ID 1648724926. The text, ntext, or image node at
> page (1:313603), slot 10, text ID 41680896 is not referenced.
> Server: Msg 8964, Level 16, State 1, Line 1
> Table error: Object ID 1648724926. The text, ntext, or image node at
> page (1:313603), slot 11, text ID 1340932096 is not referenced.
> Server: Msg 8964, Level 16, State 1, Line 1
> Table error: Object ID 1648724926. The text, ntext, or image node at
> page (1:313603), slot 12, text ID 23986176 is not referenced.
> Server: Msg 8964, Level 16, State 1, Line 1
> Table error: Object ID 1648724926. The text, ntext, or image node at
> page (1:313604), slot 0, text ID 96010240 is not referenced.
> Server: Msg 8964, Level 16, State 1, Line 1
> Table error: Object ID 1648724926. The text, ntext, or image node at
> page (1:313604), slot 1, text ID 817430528 is not referenced.
> There are 1078620 rows in 30728 pages for object 'wvowner.f8'.
> CHECKDB found 0 allocation errors and 7 consistency errors in table
> 'wvowner.f8' (object ID 1648724926).
>|||Ryan, we, too, have had DBCC CHECKDB errors, and the errors we have had
seemed to disappear on subsquent runs of DBCC CHECKDB. Why? Does some
automatic fix happen with some types of errors, or is something getting
swept under the rug?
How does one track down the cause of CHECKDB errors?
Can virus protection software (Avast in our case) ever be a cause of DB
corruption?
The error(s) that disappeared are as follows:
[2] Database VMed1: Check Data and Index Linkage...
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 8928: [Microsoft][ODBC SQL
Server Driver][SQL Server]Object ID 2050874423, index ID 2: Page (1:21349)
could not be processed. See other errors for details.
[Microsoft][ODBC SQL Server Driver][SQL Server]Table error: Object ID
2050874423, index ID 2, page (1:21349), row 339. Test (ColumnOffsets <=(nextRec - pRec)) failed. Values are 13 and 3.
[Microsoft][ODBC SQL Server Driver][SQL Server]CHECKDB found 0 allocation
errors and 2 consistency errors in table 'NodeRelation' (object ID
2050874423).
[Microsoft][ODBC SQL Server Driver][SQL Server]CHECKDB found 0 allocation
errors and 2 consistency errors in database 'VMed1'.
[Microsoft][ODBC SQL Server Driver][SQL Server]repair_allow_data_loss is the
minimum repair level for the errors found by DBCC CHECKDB (VMed1 ).
Thanks,
Randy Neall
"Ryan Stonecipher [MSFT]" <ryanston@.microsoft.com> wrote in message
news:eihMfCukFHA.3380@.TK2MSFTNGP12.phx.gbl...
> For both of these tables, CHECKDB has found a row whose structure we
cannot
> validate (row 25 on page 1:155093). Because the structure of the rest of
> the page is suspect due to this problem, DBCC will not process the page
any
> further. The 8964 errors reported are a result of our not processing any
of
> the data on this page. Running REPAIR_ALLOW_DATA_LOSS will result in this
> page being deallocated. Because it is a data page, you will lose data.
> (FYI, error 7987 is the run-time check that is equivalent to the
corruption
> that CHECKDB is reporting. It is a new error in SP4.)
> The only way to ensure that you don't lose any data is to restore your
last
> known good database backups, plus any transaction log backups.
> > Ironically, I've never seen msg 8964 before this week, and we
> > installed SP4 last week, which is supposed to take care of this bug.
> > Could this have caused the bug?
> I'm not sure I understand this statement. Which bug are you referring to?
> Thanks,
> --
> Ryan Stonecipher
> Microsoft Sql Server Storage Engine, DBCC
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> <naomimsm@.gmail.com> wrote in message
> news:1122478968.737696.309790@.f14g2000cwb.googlegroups.com...
> > SQL2K
> > SP4
> >
> > Error: 7987, Severity: 22, State: 3
> > A possible database consistency problem has been detected
> >
> > Ran DBCC CHECKDB on WV database on both servers (the dbs are not copies
> > of each other but are based on the same information, 1 is on the
> > development server, the other on the production server) but received
> > the same error messages for the same tables in both. At the end of the
> > message was:
> >
> > CHECKDB found 0 allocation errors and 8 consistency errors in database
> > 'WV'.
> > repair_allow_data_loss is the minimum repair level for the errors found
> > by DBCC CHECKDB (WV ).
> >
> > When I ran DBCC DBREINDEX (as an alternative to allowing data loss) on
> > the tables indicated, it appeared to fix a few tables that only had 1
> > consistency error (they no longer show up with inconsistencies) but
> > there are 2 tables that still show up with multiple errors.
> >
> > I haven't found a post with all the error messages (8928, 8944, 8964)
> > and I'm wondering what the best approach to this is to prevent any
> > data loss.
> >
> > Ironically, I've never seen msg 8964 before this week, and we
> > installed SP4 last week, which is supposed to take care of this bug.
> > Could this have caused the bug?
> >
> > DBCC results for 'sde.GDB_STRINGDOMAINS'.
> > Server: Msg 8928, Level 16, State 1, Line 1
> > Object ID 1648724926, index ID 0: Page (1:155093) could not be
> > processed. See other errors for details.
> > Server: Msg 8944, Level 16, State 1, Line 1
> > Table error: Object ID 1648724926, index ID 0, page (1:155093), row 25.
> > Test (offsetNull >= BASEOFFSET) failed. Values are 0 and 4.
> > Server: Msg 8964, Level 16, State 1, Line 1
> > Table error: Object ID 1648724926. The text, ntext, or image node at
> > page (1:313603), slot 10, text ID 41680896 is not referenced.
> > Server: Msg 8964, Level 16, State 1, Line 1
> > Table error: Object ID 1648724926. The text, ntext, or image node at
> > page (1:313603), slot 11, text ID 1340932096 is not referenced.
> > Server: Msg 8964, Level 16, State 1, Line 1
> > Table error: Object ID 1648724926. The text, ntext, or image node at
> > page (1:313603), slot 12, text ID 23986176 is not referenced.
> > Server: Msg 8964, Level 16, State 1, Line 1
> > Table error: Object ID 1648724926. The text, ntext, or image node at
> > page (1:313604), slot 0, text ID 96010240 is not referenced.
> > Server: Msg 8964, Level 16, State 1, Line 1
> > Table error: Object ID 1648724926. The text, ntext, or image node at
> > page (1:313604), slot 1, text ID 817430528 is not referenced.
> > There are 0 rows in 0 pages for object 'sde.GDB_STRINGDOMAINS'.
> >
> >
> > DBCC results for 'wvowner.f8'.
> > Server: Msg 8928, Level 16, State 1, Line 1
> > Object ID 1648724926, index ID 0: Page (1:155093) could not be
> > processed. See other errors for details.
> > Server: Msg 8944, Level 16, State 1, Line 1
> > Table error: Object ID 1648724926, index ID 0, page (1:155093), row 25.
> > Test (offsetNull >= BASEOFFSET) failed. Values are 0 and 4.
> > Server: Msg 8964, Level 16, State 1, Line 1
> > Table error: Object ID 1648724926. The text, ntext, or image node at
> > page (1:313603), slot 10, text ID 41680896 is not referenced.
> > Server: Msg 8964, Level 16, State 1, Line 1
> > Table error: Object ID 1648724926. The text, ntext, or image node at
> > page (1:313603), slot 11, text ID 1340932096 is not referenced.
> > Server: Msg 8964, Level 16, State 1, Line 1
> > Table error: Object ID 1648724926. The text, ntext, or image node at
> > page (1:313603), slot 12, text ID 23986176 is not referenced.
> > Server: Msg 8964, Level 16, State 1, Line 1
> > Table error: Object ID 1648724926. The text, ntext, or image node at
> > page (1:313604), slot 0, text ID 96010240 is not referenced.
> > Server: Msg 8964, Level 16, State 1, Line 1
> > Table error: Object ID 1648724926. The text, ntext, or image node at
> > page (1:313604), slot 1, text ID 817430528 is not referenced.
> > There are 1078620 rows in 30728 pages for object 'wvowner.f8'.
> > CHECKDB found 0 allocation errors and 7 consistency errors in table
> > 'wvowner.f8' (object ID 1648724926).
> >
>|||Randy,
There are a couple of possibilities: the first is hardware, the second is
normal workload processing.
In some circumstances, corruption problems can exist in memory only. For
instance, bad disk firmware can generate single-byte or single-bit
discrepancies when a page is read from disk. If CHECKDB is run on this
data, then it can generate corruption errors. Subsequent reads of the same
page may come back just fine. In SQL Server 2005, we've introduced a page
checksum feature that will help to identify these issues when they happen.
Bad memory can also cause problems like this...
In other cases, true corruption can exist in your database, but your normal
maintenance plans (that rebuild indexes, for instance) could eliminate the
corruption by regenerating the index pages during the rebuild. (The index
rebuild "fix" really only works for nonclustered indexes; if you have hard
corruption in your data pages, then a rebuild won't fix the issue.)
In your case, either is possible. Since this was a nonclustered index,
could a maintenance rebuild have fixed your problem? Have you run complete
hardware diagnostics on your IO stack?
--
Ryan Stonecipher
Microsoft Sql Server Storage Engine, DBCC
This posting is provided "AS IS" with no warranties, and confers no rights.
"Randolph Neall" <randolphneall@.veracitycomputing.com> wrote in message
news:OK2GwxukFHA.3148@.TK2MSFTNGP09.phx.gbl...
> Ryan, we, too, have had DBCC CHECKDB errors, and the errors we have had
> seemed to disappear on subsquent runs of DBCC CHECKDB. Why? Does some
> automatic fix happen with some types of errors, or is something getting
> swept under the rug?
> How does one track down the cause of CHECKDB errors?
> Can virus protection software (Avast in our case) ever be a cause of DB
> corruption?
> The error(s) that disappeared are as follows:
> [2] Database VMed1: Check Data and Index Linkage...
> [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 8928: [Microsoft][ODBC
> SQL
> Server Driver][SQL Server]Object ID 2050874423, index ID 2: Page (1:21349)
> could not be processed. See other errors for details.
> [Microsoft][ODBC SQL Server Driver][SQL Server]Table error: Object ID
> 2050874423, index ID 2, page (1:21349), row 339. Test (ColumnOffsets <=> (nextRec - pRec)) failed. Values are 13 and 3.
> [Microsoft][ODBC SQL Server Driver][SQL Server]CHECKDB found 0 allocation
> errors and 2 consistency errors in table 'NodeRelation' (object ID
> 2050874423).
> [Microsoft][ODBC SQL Server Driver][SQL Server]CHECKDB found 0 allocation
> errors and 2 consistency errors in database 'VMed1'.
> [Microsoft][ODBC SQL Server Driver][SQL Server]repair_allow_data_loss is
> the
> minimum repair level for the errors found by DBCC CHECKDB (VMed1 ).
> Thanks,
> Randy Neall
>
> "Ryan Stonecipher [MSFT]" <ryanston@.microsoft.com> wrote in message
> news:eihMfCukFHA.3380@.TK2MSFTNGP12.phx.gbl...
>> For both of these tables, CHECKDB has found a row whose structure we
> cannot
>> validate (row 25 on page 1:155093). Because the structure of the rest of
>> the page is suspect due to this problem, DBCC will not process the page
> any
>> further. The 8964 errors reported are a result of our not processing any
> of
>> the data on this page. Running REPAIR_ALLOW_DATA_LOSS will result in
>> this
>> page being deallocated. Because it is a data page, you will lose data.
>> (FYI, error 7987 is the run-time check that is equivalent to the
> corruption
>> that CHECKDB is reporting. It is a new error in SP4.)
>> The only way to ensure that you don't lose any data is to restore your
> last
>> known good database backups, plus any transaction log backups.
>> > Ironically, I've never seen msg 8964 before this week, and we
>> > installed SP4 last week, which is supposed to take care of this bug.
>> > Could this have caused the bug?
>> I'm not sure I understand this statement. Which bug are you referring
>> to?
>> Thanks,
>> --
>> Ryan Stonecipher
>> Microsoft Sql Server Storage Engine, DBCC
>> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>> <naomimsm@.gmail.com> wrote in message
>> news:1122478968.737696.309790@.f14g2000cwb.googlegroups.com...
>> > SQL2K
>> > SP4
>> >
>> > Error: 7987, Severity: 22, State: 3
>> > A possible database consistency problem has been detected
>> >
>> > Ran DBCC CHECKDB on WV database on both servers (the dbs are not copies
>> > of each other but are based on the same information, 1 is on the
>> > development server, the other on the production server) but received
>> > the same error messages for the same tables in both. At the end of the
>> > message was:
>> >
>> > CHECKDB found 0 allocation errors and 8 consistency errors in database
>> > 'WV'.
>> > repair_allow_data_loss is the minimum repair level for the errors found
>> > by DBCC CHECKDB (WV ).
>> >
>> > When I ran DBCC DBREINDEX (as an alternative to allowing data loss) on
>> > the tables indicated, it appeared to fix a few tables that only had 1
>> > consistency error (they no longer show up with inconsistencies) but
>> > there are 2 tables that still show up with multiple errors.
>> >
>> > I haven't found a post with all the error messages (8928, 8944, 8964)
>> > and I'm wondering what the best approach to this is to prevent any
>> > data loss.
>> >
>> > Ironically, I've never seen msg 8964 before this week, and we
>> > installed SP4 last week, which is supposed to take care of this bug.
>> > Could this have caused the bug?
>> >
>> > DBCC results for 'sde.GDB_STRINGDOMAINS'.
>> > Server: Msg 8928, Level 16, State 1, Line 1
>> > Object ID 1648724926, index ID 0: Page (1:155093) could not be
>> > processed. See other errors for details.
>> > Server: Msg 8944, Level 16, State 1, Line 1
>> > Table error: Object ID 1648724926, index ID 0, page (1:155093), row 25.
>> > Test (offsetNull >= BASEOFFSET) failed. Values are 0 and 4.
>> > Server: Msg 8964, Level 16, State 1, Line 1
>> > Table error: Object ID 1648724926. The text, ntext, or image node at
>> > page (1:313603), slot 10, text ID 41680896 is not referenced.
>> > Server: Msg 8964, Level 16, State 1, Line 1
>> > Table error: Object ID 1648724926. The text, ntext, or image node at
>> > page (1:313603), slot 11, text ID 1340932096 is not referenced.
>> > Server: Msg 8964, Level 16, State 1, Line 1
>> > Table error: Object ID 1648724926. The text, ntext, or image node at
>> > page (1:313603), slot 12, text ID 23986176 is not referenced.
>> > Server: Msg 8964, Level 16, State 1, Line 1
>> > Table error: Object ID 1648724926. The text, ntext, or image node at
>> > page (1:313604), slot 0, text ID 96010240 is not referenced.
>> > Server: Msg 8964, Level 16, State 1, Line 1
>> > Table error: Object ID 1648724926. The text, ntext, or image node at
>> > page (1:313604), slot 1, text ID 817430528 is not referenced.
>> > There are 0 rows in 0 pages for object 'sde.GDB_STRINGDOMAINS'.
>> >
>> >
>> > DBCC results for 'wvowner.f8'.
>> > Server: Msg 8928, Level 16, State 1, Line 1
>> > Object ID 1648724926, index ID 0: Page (1:155093) could not be
>> > processed. See other errors for details.
>> > Server: Msg 8944, Level 16, State 1, Line 1
>> > Table error: Object ID 1648724926, index ID 0, page (1:155093), row 25.
>> > Test (offsetNull >= BASEOFFSET) failed. Values are 0 and 4.
>> > Server: Msg 8964, Level 16, State 1, Line 1
>> > Table error: Object ID 1648724926. The text, ntext, or image node at
>> > page (1:313603), slot 10, text ID 41680896 is not referenced.
>> > Server: Msg 8964, Level 16, State 1, Line 1
>> > Table error: Object ID 1648724926. The text, ntext, or image node at
>> > page (1:313603), slot 11, text ID 1340932096 is not referenced.
>> > Server: Msg 8964, Level 16, State 1, Line 1
>> > Table error: Object ID 1648724926. The text, ntext, or image node at
>> > page (1:313603), slot 12, text ID 23986176 is not referenced.
>> > Server: Msg 8964, Level 16, State 1, Line 1
>> > Table error: Object ID 1648724926. The text, ntext, or image node at
>> > page (1:313604), slot 0, text ID 96010240 is not referenced.
>> > Server: Msg 8964, Level 16, State 1, Line 1
>> > Table error: Object ID 1648724926. The text, ntext, or image node at
>> > page (1:313604), slot 1, text ID 817430528 is not referenced.
>> > There are 1078620 rows in 30728 pages for object 'wvowner.f8'.
>> > CHECKDB found 0 allocation errors and 7 consistency errors in table
>> > 'wvowner.f8' (object ID 1648724926).
>> >
>>
>|||Thanks much, Ryan. In fact we ARE rebuilding indexes every night (possibly
overkill), and this error occurs AFTER that rebuild, I mean immediately
after (30 minutes) in the wee hours when no one is working. So it appears
that we got the problem as a direct result of the rebuild itself.
Apparently, the following night, the rebuild happens again, and that one
evidently fixes it.
We will check out our hardware with whatever diagnostics are available.
The errors we have seen tend to always be on the same table and possibly the
same index. I'm wondering if some table/index designs are more vulnerable
and unstable than others. This particular table has about seven integers
with overlapping indexes on all columns, including a single-column identity
clustered index and an alternate key on six of the integer columns, plus
others.
Thanks,
Randy Neall|||I would strongly recommend that you open up a case with Microsoft support in
this case (http://support.microsoft.com), as it doesn't sound at all like
normal behavior. To answer your question, there aren't any particular index
structures that are more susceptible to this problem than others. I would
get in touch with the experts in PSS and have them help you narrow down the
problem.
Thanks,
--
Ryan Stonecipher
Microsoft Sql Server Storage Engine, DBCC
This posting is provided "AS IS" with no warranties, and confers no rights.
"Brandon Owensby" <123@.abc.com> wrote in message
news:Og2k4B5kFHA.1148@.TK2MSFTNGP12.phx.gbl...
> Thanks much, Ryan. In fact we ARE rebuilding indexes every night (possibly
> overkill), and this error occurs AFTER that rebuild, I mean immediately
> after (30 minutes) in the wee hours when no one is working. So it appears
> that we got the problem as a direct result of the rebuild itself.
> Apparently, the following night, the rebuild happens again, and that one
> evidently fixes it.
> We will check out our hardware with whatever diagnostics are available.
> The errors we have seen tend to always be on the same table and possibly
> the same index. I'm wondering if some table/index designs are more
> vulnerable and unstable than others. This particular table has about seven
> integers with overlapping indexes on all columns, including a
> single-column identity clustered index and an alternate key on six of the
> integer columns, plus others.
> Thanks,
> Randy Neall
>
>