• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • Last Modified:

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.
0
ananthu
Asked:
ananthu
1 Solution
 
nigelrivettCommented:
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)
0
 
ananthuAuthor Commented:
This is a syslogs table no indexs...
0
 
ananthuAuthor Commented:
This is a syslogs table no indexs...
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
nigelrivettCommented:
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.
0
 
ananthuAuthor Commented:
This is a syslogs table no indexs...
0
 
ananthuAuthor Commented:
i dont know how the previous comment was added wait for me thatnks
0
 
ananthuAuthor Commented:
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.
0
 
ananthuAuthor Commented:
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.
0
 
ananthuAuthor Commented:
Nobody has answer to this!!!
0
 
nigelrivettCommented:
If the transaction log is corrupt then the database cannot guarantee it's integrity and you will need to restore a backup.
0
 
CleanupPingCommented:
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.
0
 
Anthony PerkinsCommented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now