Aug 31, 2005
I'm having a problem where I see consistency errors in my databases on a regular basis (at least twice a week).
I have several databases running on the same instance of SQL Server. During any given week, at least one of the databases will show consistency errors. At times, more than one at the same time will show these errors. These have odd effects on queries, sometimes making a SELECT (for instance) that should run in 5 seconds have to be killed after running for over an hour.
I'm running SQL Server 2000, version 8.00.194. The host OS is Windows 2000 with the latest service pack. RAID 5 is the storage solution.
Below are two DBCC outputs from different databases on the same machine. They are slightly different in that one starts out with "Parent node for page was not encountered"; and the other with "Page is missing a reference from previous page".
My hardware guys assure me there is no hardware failure going. I don't see anything that would suggest there is one in any of the event logs or in the Dell OpenManage system checks.
These DBCC errors are repairable without data loss, yet the databases have to be taken down to single user mode to do so (unacceptable during the day). But at the same time, certain operations in the database become impossible to perform when these errors crop up (such as the aforementioned infinite SELECT problem).
Any help in diagnosing why these pop up, or how to prevent them would be greatly appreciated.
The DBCC outputs:
-----------------------------------------
dbcc checkdb('ValidValues') with no_infomsgs
==========
Server: Msg 8978, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 3. Page (1:10921) is missing a reference from previous page (1:75359). Possible chain linkage problem.
Server: Msg 8976, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 3. Page (1:75354) was not seen in the scan although its parent (1:75424) and previous (1:75352) refer to it. Check any previous errors.
Server: Msg 8980, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 3. Index node page (1:75424), slot 19 refers to child page (1:75355) and previous child (1:75354), but they were not encountered.
Server: Msg 8980, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 3. Index node page (1:75424), slot 20 refers to child page (1:75356) and previous child (1:75355), but they were not encountered.
Server: Msg 8980, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 3. Index node page (1:75424), slot 21 refers to child page (1:75357) and previous child (1:75356), but they were not encountered.
Server: Msg 8980, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 3. Index node page (1:75424), slot 22 refers to child page (1:75358) and previous child (1:75357), but they were not encountered.
Server: Msg 8980, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 3. Index node page (1:75424), slot 23 refers to child page (1:75359) and previous child (1:75358), but they were not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:10931) was not encountered.
Server: Msg 8979, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Page (1:10932) is missing references from parent (unknown) and previous (page (1:75671)) nodes. Possible bad root entry in sysindexes.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:10933) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:10934) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:10937) was not encountered.
Server: Msg 8979, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Page (1:10940) is missing references from parent (unknown) and previous (page (0:0)) nodes. Possible bad root entry in sysindexes.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:10941) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:75664) was not encountered.
Server: Msg 8980, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Index node page (0:0), slot 0 refers to child page (1:75665) and previous child (0:0), but they were not encountered.
Server: Msg 8981, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. The next pointer of (1:75664) refers to page (1:75666). Neither (1:75666) nor its parent were encountered. Possible bad chain linkage.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:75673) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:75674) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:75675) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:75676) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:75705) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:75706) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:75707) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:75708) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:75737) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:75738) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:75739) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 926626344, index ID 5. Parent node for page (1:75740) was not encountered.
CHECKDB found 0 allocation errors and 29 consistency errors in table 'Company' (object ID 926626344).
CHECKDB found 0 allocation errors and 29 consistency errors in database 'ValidValues'.
repair_rebuild is the minimum repair level for the errors found by DBCC CHECKDB (ValidValues ).
-----------------------------------------
dbcc checkdb('Revenue') with no_infomsgs
==========
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:110576) was not encountered.
Server: Msg 8980, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Index node page (0:0), slot 0 refers to child page (1:110577) and previous child (0:0), but they were not encountered.
Server: Msg 8981, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. The next pointer of (1:110576) refers to page (1:110578). Neither (1:110578) nor its parent were encountered. Possible bad chain linkage.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:110585) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:110586) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:110587) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:110588) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:110617) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:110618) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:110619) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:110620) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:110649) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:110650) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:110651) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:110652) was not encountered.
Server: Msg 8979, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Page (1:124495) is missing references from parent (unknown) and previous (page (1:110581)) nodes. Possible bad root entry in sysindexes.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:124512) was not encountered.
Server: Msg 8979, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Page (1:124513) is missing references from parent (unknown) and previous (page (0:0)) nodes. Possible bad root entry in sysindexes.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:124521) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:124650) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:124651) was not encountered.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2089058478, index ID 2. Parent node for page (1:125214) was not encountered.
CHECKDB found 0 allocation errors and 22 consistency errors in table 'Operational_Reporting' (object ID 2089058478).
CHECKDB found 0 allocation errors and 22 consistency errors in database 'Revenue'.
repair_rebuild is the minimum repair level for the errors found by DBCC CHECKDB (Revenue ).
View 2 Replies
View Related
Apr 3, 2007
Hello!
I have a really small database in terms of number of objects, but very big in terms of data (possibly millions of records). I always try to design my databases to be in the 3rd normal form (at least I hope they are!), but sometimes (for databases consisting of just a few tables) maintaining M:N relationships looks like an over-bloated approach to me... Let's see an actual example. I have a table like this:
Code SnippetCreate table [Airfares]
(
[OriginCity] Char(3) NOT NULL,
[DestCity] Char(3) NOT NULL,
[FareDate] Datetime Default getdate() NOT NULL,
[Price] Decimal(9,2) Default 0 NOT NULL,
[PriceChange] Decimal(9,2) Default 0 NOT NULL,
[Wrong] Bit Default 0 NOT NULL,
Primary Key ([OriginCity],[DestCity],[FareDate])
)
go
Now, at first there also was an Airline nvarchar(50) field, which stored the airline name. But now the client requested to store fares for a few airlines if it's the same price and city pair. This way we can have 3 airlines offering the same price on the same itinerary for example. So I added a dictionary table called Airlines:
Code SnippetCreate table [Airlines]
(
[AirlineCode] Char(2) NOT NULL,
[Name] Nvarchar(50) NOT NULL,
Primary Key ([AirlineCode])
)
go
Now, there are two things I can do. We are obviously dealing with the M:N relationship type here. I can either add another nvarchar column in the first table, like Airlines nvarchar(255) and store something like 'AA,AB,AC' there - those would be airline codes. OR I could do it the proper way and create a cross-reference table which will connect both Airfares and Airlines tables (this will store as many records as there are airlines for that particular itinerary, offerring the same price):
Code SnippetCreate table [AirfareAirlines]
(
[AirlineCode] Char(2) NOT NULL,
[OriginCity] Char(3) NOT NULL,
[DestCity] Char(3) NOT NULL,
[FareDate] Datetime Default getdate() NOT NULL,
Primary Key ([AirlineCode],[OriginCity],[DestCity],[FareDate])
)
go
But this is starting to look overly complicated, isn't it? The pros of this are I'm going to get real relationships, referential integrity, etc., but cons are more difficult code to query all this. What would you do? Do we really need referential integrity everywhere? Are there times when we're better not using relationships? I have seen many programmers skip referential integrity before, which always made me think they are missing something important in a Relational Database Management System.
View 13 Replies
View Related