One of my user database is showing suspect mode. To repair i have executed below scripts:
EXEC sp_resetstatus axlive’;
ALTER DATABASE axlive SET EMERGENCY
DBCC checkdb (axlive’)
(in this step i got error, please see Code Snippet).
ALTER DATABASE axlive SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DBCC CheckDB ('axlive'’, REPAIR_ALLOW_DATA_LOSS)
(in this step i got the error, please code snippet)
ALTER DATABASE axlive SET MULTI_USER
After step 6, my database (axlive) is not showing in server.
Please let me know how to repair my database.
1. i don't have latest backup.
2. I have backup of MDF & LDF file, I have tried to attach but i got error.
dbcc check db error
Msg 7985, Level 16, State 2, Line 1
System table pre-checks: Object ID 4. Could not read and latch page (1:4206648) with latch type SH. Check statement terminated due to unrepairable error.
DBCC results for 'axlive'.
Msg 5256, Level 16, State 1, Line 1
Table error: alloc unit ID 0, page (1:4206648) contains an incorrect page ID in its page header. The PageId in the page header = (0:0).
CHECKDB found 0 allocation errors and 1 consistency errors not associated with any single object.
CHECKDB found 0 allocation errors and 1 consistency errors in database 'axlive'.
DBCC CheckDB ('axlive', REPAIR_ALLOW_DATA_LOSS)
Warning: The log for database 'axlive' has been rebuilt. Transactional consistency has been lost. The RESTORE chain was broken, and the server no longer has context on the previous log files, so you will need to know what they were. You should run DBCC CHECKDB to validate physical consistency. The database has been put in dbo-only mode. When you are ready to make the database available for use, you will need to reset database options and delete any extra log files.
Msg 926, Level 14, State 1, Line 1
Database 'axlive' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information.
DBCC results for 'axlive'.
CHECKDB found 0 allocation errors and 0 consistency errors in database 'axlive'.
DBCC DBRECOVER ('axlive')
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Msg 824, Level 24, State 2, Line 1
SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 1:4089856; actual 0:0). It occurred during a read of page (1:4089856) in database ID 7 at offset 0x000007cd000000 in file 'E:\New Folder\axlive.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 3414, Level 21, State 1, Line 1
An error occurred during recovery, preventing the database 'axlive' (database ID 7) from restarting. Diagnose the recovery errors and fix them, or restore from a known good backup. If errors are not corrected or expected, contact Technical Support.