SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


WHAT TO DO WHEN DBCC CHECKDB(REPAIR_ALLOW_DATA_LOSS) FAILS


WHAT TO DO WHEN DBCC CHECKDB(REPAIR_ALLOW_DATA_LOSS) FAILS

Author
Message
gyansackey
gyansackey
SSC-Enthusiastic
SSC-Enthusiastic (156 reputation)SSC-Enthusiastic (156 reputation)SSC-Enthusiastic (156 reputation)SSC-Enthusiastic (156 reputation)SSC-Enthusiastic (156 reputation)SSC-Enthusiastic (156 reputation)SSC-Enthusiastic (156 reputation)SSC-Enthusiastic (156 reputation)

Group: General Forum Members
Points: 156 Visits: 11
Hello, our server hard disk crashed due to power failure and all the backups were on the hard disk. Before just before it did we had managed to copy the mdf file but power failed while copying the log file. The mdf can't be attached on a different machine now cos there was a transaction in progress when it was detached. So I created a new database, stopped the service and replaced the new mdf with the corrupt one and started the service again. Its state was Recovery_Pending. So I tried to run emergency mode repair using the following commands:

ALTER DATABASE HealthBookDB Set Single_User
GO
ALTER DATABASE HealthBookDB Set Emergency
GO
DBCC CHECKDB('HealthBookDB',REPAIR_ALLOW_DATA_LOSS)
GO

And the results were as follows:

Msg 5173, Level 16, State 1, Line 1
One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files. If this is an existing database, the file may be corrupted and should be restored from a backup.
Log file 'C:\HealthBookDB\HealthBookDB_log.ldf' does not match the primary file. It may be from a different database or the log may have been rebuilt previously.
DBCC results for 'HealthBookDB'.
CHECKDB found 0 allocation errors and 0 consistency errors in database 'HealthBookDB'.
Msg 824, Level 24, State 2, Line 1
SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 1:227761; actual 0:0). It occurred during a read of page (1:227761) in database ID 9 at offset 0x0000006f362000 in file 'C:\HealthBookDB\HealthBookDB.mdf'. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
Msg 824, Level 24, State 2, Line 1
SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 1:227761; actual 0:0). It occurred during a read of page (1:227761) in database ID 9 at offset 0x0000006f362000 in file 'C:\HealthBookDB\HealthBookDB.mdf'. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
Msg 824, Level 24, State 2, Line 1
SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 1:227761; actual 0:0). It occurred during a read of page (1:227761) in database ID 9 at offset 0x0000006f362000 in file 'C:\HealthBookDB\HealthBookDB.mdf'. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
Msg 7909, Level 20, State 1, Line 1
The emergency-mode repair failed.You must restore from backup.

I'm really at my wits end now can anyone help
HanShi
HanShi
One Orange Chip
One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)

Group: General Forum Members
Points: 29743 Visits: 4215
Duplicate of this thread. Only respond on the other thread.

** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
Lincoln Burrows
Lincoln Burrows
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16717 Visits: 2105
REPAIR_ALLOW_DATA_LOSS is the minimum repair level provided for the errors found by DBCC CHECKDB. The REPAIR_ALLOW_DATA_LOSS option requires deleting data to obtain structural consistency of the database. Usually, this error occurs when DBCC CHECKDB command finds Torn Page, Short Transfer, Bad Page Id, Stale Read, Page Audit Failure. When REPAIR_ALLOW_DATA_LOSS fails, users may try SQL Database Repair tool to overcome these kinds of issues.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search