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


Database Corruption problems


Database Corruption problems

Author
Message
Quinn-793124
Quinn-793124
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1221 Visits: 466
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
Quinn-793124
Quinn-793124
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1221 Visits: 466
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
GilaMonster
GilaMonster
SSC Guru
SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)

Group: General Forum Members
Points: 414358 Visits: 47128
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, MVP, M.Sc (Comp Sci)
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


Quinn-793124
Quinn-793124
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1221 Visits: 466
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
GilaMonster
GilaMonster
SSC Guru
SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)

Group: General Forum Members
Points: 414358 Visits: 47128
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, MVP, M.Sc (Comp Sci)
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


Quinn-793124
Quinn-793124
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1221 Visits: 466
None at all Gail.

Quinn
GilaMonster
GilaMonster
SSC Guru
SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)

Group: General Forum Members
Points: 414358 Visits: 47128
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, MVP, M.Sc (Comp Sci)
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


Quinn-793124
Quinn-793124
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1221 Visits: 466
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
GilaMonster
GilaMonster
SSC Guru
SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)SSC Guru (414K reputation)

Group: General Forum Members
Points: 414358 Visits: 47128
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, MVP, M.Sc (Comp Sci)
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


TheSQLGuru
TheSQLGuru
SSC Guru
SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)

Group: General Forum Members
Points: 58207 Visits: 8824
Personally I think this is a time to call Microsoft Product Support.

Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
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