Solved

After running repairs, database remains in SUSPECT mode

Posted on 2009-07-14
2
1,581 Views
Last Modified: 2012-05-07
Hi guys!  I maxed the points on this one because I think (I hope I'm wrong) that this is a hard one.
Last Thursday someone decided to shut the SQL server down dirty because it was taking too long to reboot.  As a result the most important database went into suspect mode. Initially, I was not worried because of the backups. To my chagrin, I found out from the backup admin that the backups were failing for weeks and he was working on it!  I'm passed the pissed off point and now I need help from people smarter than myself.  After researching the erros I was pleased to find out that there were no torn pages.  Error 3414 Serverity 21 State 1, Error 3313 Severity 21 State 2, Error 824 Severity 24 State 2.  This is what I have done thus far:
Set the db in emergency mode with this query

use master
alter database sx set emergency
go
use sx

Then I checked for errors with this command

use sx
dbcc checkdb

There were over 500 allocation errors and over 7400 consistency errors so I fixed the erros and allowed for data loss with this command

alter database sx set single_user with rollback immediate
go
dbcc checkdb ('sx', repair_allow_data_loss)
go
alter database sx set multi_user
go
alter database sx set online

After that completed, the database was back online and seemingly happy.  So I followed the Wolfman's advice and ran maintenance plan job to rebuild the indexes. It ran for 34 minutes than stopped without finishing.  The history stated that it was in progress but it was not working so I executed this to rebuild the indexes:

USE [sx]
GO
ALTER INDEX [alp_order] ON [dbo].[alp] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = OFF, ONLINE = OFF )
GO
USE [sx]
GO
ALTER INDEX [alp_pri] ON [dbo].[alp] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = OFF, ONLINE = OFF )
GO
USE [sx]
GO
ALTER INDEX [PK_categories] ON [dbo].[categories] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = OFF, ONLINE = OFF )
GO
USE [sx]
GO
ALTER INDEX [UQ_catname] ON [dbo].[categories] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = OFF, ONLINE = OFF )
GO
USE [sx]
GO
ALTER INDEX [PK_cds] ON [dbo].[cds] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = OFF, ONLINE = OFF )
GO
USE [sx]
GO
ALTER INDEX [SK_cds_description] ON [dbo].[cds] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = OFF, ONLINE = OFF )
GO
USE [sx]
GO
ALTER INDEX [UK_cds_hash] ON [dbo].[cds] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = OFF, ONLINE = OFF )
GO
USE [sx]
GO
ALTER INDEX [PK_devices] ON [dbo].[devices] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = OFF, ONLINE = OFF )
GO
USE [sx]
GO
ALTER INDEX [PK_devparams] ON [dbo].[devparams] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = OFF, ONLINE = OFF )
GO
USE [sx]
GO
ALTER INDEX [PK_file2cat] ON [dbo].[file2cat] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = OFF, ONLINE = OFF )
GO
USE [sx]
GO

It finished in about 5 seconds sucessfully.  I opened the logs to see if it really completed and the logs said that the db was back in suspect mode!  I refreshed the db and it was marked suspect again.  So I put it in emergency mode, and ran a DBCC  CHECKDB.  That came back with zero errors.  The database was out of Suspect mode but it was marked Emergency, so I ran this T-SQL:

alter database sx set online

After running for 20 hours without finishing, I stopped it and ran this command:

alter database sx set single_user with rollback immediate
go
dbcc checkdb
go
alter database sx set multi_user
go
alter database sx set online
After running for 35 minutes it back with these errors:

CHECKDB found 0 allocation errors and 0 consistency errors in database 'sx'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Msg 608, Level 16, State 1, Line 1
No catalog entry found for partition ID 72057594053132288 in database 15. The metadata is inconsistent. Run DBCC CHECKDB to check for a metadata corruption.
Msg 926, Level 14, State 1, Line 1
Database 'sx' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information.
Failed to restart the current database. The current database is switched to master.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 3414, Level 21, State 2, Line 1
An error occurred during recovery, preventing the database 'sx' (database ID 15) 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.

What can I do?  Thanks in advance!




0
Comment
Question by:hdk001
2 Comments
 
LVL 7

Assisted Solution

by:60MXG
60MXG earned 150 total points
ID: 24851088
CHECKDB found 0 allocation errors and 0 consistency errors in database 'sx'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Msg 608, Level 16, State 1, Line 1
No catalog entry found for partition ID 72057594053132288 in database 15. The metadata is inconsistent. Run DBCC CHECKDB to check for a metadata corruption.
Msg 926, Level 14, State 1, Line 1
Database 'sx' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information.
Failed to restart the current database. The current database is switched to master.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Msg 3414, Level 21, State 2, Line 1
An error occurred during recovery, preventing the database 'sx' (database ID 15) 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.

Check 4 of these Errors indicated by the Server.  Check one of them at a time.
0
 

Accepted Solution

by:
hdk001 earned 0 total points
ID: 24861920
I used a backup to restore the database.  Now I am having a different problem.  The database has been "restoring" for almost 16 hours and I think something is wrong.  Any help will be appreciated.  
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now