Few days back our client had ahardware crash and NO backups nothing as usual was there...
So finally RAID was rebuilt and all SQL Files provided ...
Finally we started Attaching these files..Somewhere we succeeeded and somewhere we faced small issuess...
Now we had a SQL Db which was throwing TORN PAGE Errors.. during Attching ..so I proceeded with followings teps..
1. Created a DB of same name...
2. Stopped the services
3. Copied the files on the actual and new DB files with same name
4. Started the services and as expected got the DB in Suspect MODE
5. Moved it to emergency mode to reset the statsu but it didnt reset it to Normal
6. tried to BCP out the data but got Login Error.
7. Tried from Query Analyser to Check Database Health
FIRST ERROR
=========================================
Server: Msg 8944, Level 16, State 4, Line 1
Table error: Object ID 1, index ID 0, page (1:540555), row 6. Test
(offsetNull >= BASEOFFSET) failed. Values are 0 and 4.
Server: Msg 8966, Level 16, State 1, Line 1
Could not read and latch page (1:540555) with latch type SH. sysobjects failed.
====================
8. So used DBCC CHECKTABLE('Sysobjects') as sysobjects was the culprit,Received this Error
======================================================================
Server: Msg 605, Level 21, State 1, Line 1
Attempt to fetch logical page (1:904818) in database 'smw10w100w100w155'
belongs to object '1245663931', not to object 'sysobjects'.
Connection Broken
9. Moved the Db to single User and then tried to Repair with
ALTER DATABASE smw10w100w100w155
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE
====================================================================
DBCC CHECKDB ('smw10w100w100w155', REPAIR_REBUILD )
DBCC CHECKDB ('smw10w100w100w155', REPAIR_ALLOW_DATA_LOSS )
BUt Following error still persisting
=======================
Server: Msg 8966, Level 16, State 1, Line 1
Could not read and latch page (1:540555) with latch type SH. sysobjects failed.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
==================
I ahve solved this issue long back but my Memory and Processor has worn out a bit so need your help ASAP....
DBCC INDEXDEFRAG (smw10w100w100w155, sysobjects,id)
EXEC sp_dboption 'smw10w100w100w155', 'Single user', 'true'
==============
ALTER DATABASE smw10w100w100w155
SET SINGLE_USER
====
ALTER DATABASE smw10w100w100w155
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE
====================================================================
DBCC CHECKDB ('smw10w100w100w155', REPAIR_REBUILD )
DBCC CHECKDB ('smw10w100w100w155', REPAIR_ALLOW_DATA_LOSS )
====================================================================
Server: Msg 8966, Level 16, State 1, Line 1
Could not read and latch page (1:540555) with latch type SH. sysobjects failed.
DBCC execution completed. I
if DBCC printed error messages, contact your system administrator.
====================================================================
sp_help sysobjects
select * from sysobjects
======================================================================
Server: Msg 605, Level 21, State 1, Line 1
Attempt to fetch logical page (1:904818) in database 'smw10w100w100w155'
belongs to object '1245663931', not to object 'sysobjects'.
Connection Broken
========DBCC CHECKTABLE('Sysobjects') After this I ran================
Server: Msg 8944, Level 16, State 4, Line 1
Table error: Object ID 1, index ID 0, page (1:540555), row 6. Test
(offsetNull >= BASEOFFSET) failed. Values are 0 and 4.
Server: Msg 8966, Level 16, State 1, Line 1
Could not read and latch page (1:540555) with latch type SH. sysobjects failed.
====================================================================