Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Database Corruption problems Expand / Collapse
Author
Message
Posted Tuesday, June 24, 2008 8:25 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, February 22, 2013 1:36 PM
Points: 110, Visits: 429
We had a server reboot the other night and it seams to have corrupted several files. I have a database in SQL Express that is corrupt and one in regular SQL that was labeled suspect. I found this on a web site for fixing suspect DB's.

ALTER DATABASE koochdata SET EMERGENCY
DBCC checkdb('koochdata')
ALTER DATABASE koochdata SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ('koochdata', REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE koochdata SET MULTI_USER

When I issue these one at a time I can see in the log files that the DB is changing status but when I run the dbcc commands I get this result.

Msg 922, Level 14, State 1, Line 1
Database 'KoochData' is being recovered. Waiting until recovery is finished.

Query completed with errors

I haven't been able to find msg 922 anywhere. Is there a reason that dbcc doesn't want to work? It didn't leave a message in the log file just the changes in the DB status.

Also. Can I use the same procedure in Sqlserver express?

Thank you in advance.

Quinn McCarthy
Post #522582
Posted Tuesday, June 24, 2008 9:39 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, February 22, 2013 1:36 PM
Points: 110, Visits: 429

Also

When I right click on the DB and go to properties I get the same 922 message however it says it is in recovery mode. When I look at sys.databases I see the state is 3 and state_desc is recovery pending. Do these have to be changed to be able to do DBCC?

Thanks again

Quinn
Post #522650
Posted Tuesday, June 24, 2008 11:53 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 1:36 AM
Points: 42,488, Visits: 35,556
Do you have a backup?

Can you look at the error log and see if there's any entry there that indicates why the database is in recovery-pending?



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #522786
Posted Tuesday, June 24, 2008 12:37 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, February 22, 2013 1:36 PM
Points: 110, Visits: 429
Gail

We found out yesterday that the backup of both the sql and sql express DB's had not been working. We are not exactly sure why.

There isn't anything in either log files that stands out as making it go into recovery mode.

Here is the part where it finds a problem starting up the DB.

2008-06-23 08:29:13.21 spid55 Starting up database 'KoochData'.
2008-06-23 08:29:13.21 spid55 Error: 9003, Severity: 20, State: 1.
2008-06-23 08:29:13.21 spid55 The log scan number (145:4893:239) passed to log scan in database 'KoochData' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
2008-06-23 08:29:13.21 spid55 Error: 3414, Severity: 21, State: 1.
2008-06-23 08:29:13.21 spid55 An error occurred during recovery, preventing the database 'KoochData' (database ID 8) 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.

Before that was a bunch of messages that show the state of the DB. Like emergency mode, single user mode, and multi user mode. That was from me exucuting the code from the first thread.

I wanted to get it out of suspect mode and read online the way to do that was to change to emergency mode. I was trying to get to a point where I could run dbcc.

Do you know of any good recovery software?

Thanks

Quinn
Post #522826
Posted Tuesday, June 24, 2008 11:53 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 1:36 AM
Points: 42,488, Visits: 35,556
Do you have replication on either of these databases?
Is there any chance that someone has been messing with the files?

Very important, do you have a backup?



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #523031
Posted Wednesday, June 25, 2008 8:29 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, February 22, 2013 1:36 PM
Points: 110, Visits: 429
None at all Gail.

Quinn
Post #523411
Posted Wednesday, June 25, 2008 11:35 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 1:36 AM
Points: 42,488, Visits: 35,556
I'm not sure how to recover from that problem without loosing some data.

If you try to set the database into emergency mode, can you view the tables? Can you select data from them?
Don't try running repair. It won't help in this scenario.

How big is the database?



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #523584
Posted Wednesday, June 25, 2008 12:37 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, February 22, 2013 1:36 PM
Points: 110, Visits: 429

Gail,

I appreciate all of your help.

I think I am going to call it a loss. THe DB is a holding area for as400 data for use with our GIS system and I think it can be recreated after I talk to the as400 people.

Thanks Again

Quinn
Post #523627
Posted Thursday, June 26, 2008 1:03 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 1:36 AM
Points: 42,488, Visits: 35,556
Excellent.

If you find there is data you can't recreate, post again here and I'll try and help you salvage as much as possible from the DB.

You may also want to do some checks on the hardware on that server, specifically on the storage system, to see if you can find a cause for the corruption.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #523908
Posted Friday, June 27, 2008 7:32 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Friday, July 25, 2014 3:19 AM
Points: 4,320, Visits: 6,113
Personally I think this is a time to call Microsoft Product Support.

Best,

Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru at GMail
Post #524983
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse