Link to home
Start Free TrialLog in
Avatar of ananthu
ananthuFlag for United States of America

asked on

Database has a Corrupt Table...

Hi All,

   The result of running DBCC NEWALLOC in SQL 6.5 showed the following error message:

***************************************************************
TABLE: syslogs  OBJID = 8
INDID=0  FIRST=868010  ROOT=868010  DPAGES=262146 SORT=0
Msg 2503, Level 16, State 1
Table Corrupt: Page linkage is not consistent; check the following pages: (current page#=868010;  page# pointing to this page=0; previous page# indicated in this page=868011)
 Data level: 0.  0 Data  Pages in 1 extents.
TOTAL # of extents = 0
***************************************************************


The table is corrupt. The option or remeady I found was it said restore the database from the previous known good backup. I dont want to do that!!! Is there anyway I can solve this without resoration. I have important data. If there is an option can sombody tell me a detailed steps repair this table.

Thanks,
Ananth.
Avatar of nigelrivett
nigelrivett

If you have indexes on the table then you can get the data around the corrupt area probably.

try select * from tbl

This will tell you where the corrupt area is.
If you have a clustered index then select from the table using that index you shuold be able to access a page before the corrupt are and a page after it.

Now create two views one selecting the data before the corruption and one after.
Now bcp the data out into files from these views - then bcp back from the files into a new table and you will have all the data except that which is corrupt.
(you could do the first bcp with just batch size 1 and it will stop at the corruption)
Avatar of ananthu

ASKER

This is a syslogs table no indexs...
Avatar of ananthu

ASKER

This is a syslogs table no indexs...
Oops - sorry, that's the transaction log.
That means that the system can't reliably recover the database - i.e. it won't be able to commit/rollback transactions.

Best bet as it says is to restore the backup - you can restore transaction log backups too if you have them to get clse to the live state, but you won't be able to back up any more transactions since the last backup so that's the best you can do.

You could try creating a new database of the same size on another server and copying the data dat file over it but doubt if it would work - and you would have to be doubtful about the state of the data anyway.
Avatar of ananthu

ASKER

This is a syslogs table no indexs...
Avatar of ananthu

ASKER

i dont know how the previous comment was added wait for me thatnks
Avatar of ananthu

ASKER

Hi All,

     Can anybody try on this and let me know if it is possible to recover a corrupt table without restoring the database. The error is 605 severity 21.

Thanks,
Ananth.
Avatar of ananthu

ASKER

Hi All,

Error 605 severity 21 has occured. Can anybody tell me what are the conditions in which this error occurs. There are NO Dynamic Cursors or sp_cursorfetch and sp_cursoropen used in any of the stored procs in this database.

We are basically trying to replicate this which we could not. The corrupt table was undergoing a continues truncation and mass insertion and updation.

Thanks,
Ananth.
Avatar of ananthu

ASKER

Nobody has answer to this!!!
ASKER CERTIFIED SOLUTION
Avatar of nigelrivett
nigelrivett

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ananthu:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
Avatar of Anthony Perkins
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Award points to nigelrivett

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Anthony
EE Cleanup Volunteer