Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Attach Database failed with 9004 error.(an error occurred while processing the log for database )


Attach Database failed with 9004 error.(an error occurred while processing the log for database )

Author
Message
Chada
Chada
Valued Member
Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)

Group: General Forum Members
Points: 59 Visits: 72
Hello all,

A Production database has 14 secondary files divided over 6 filegroups with one single log file.
This database skipped into Suspected mode .The database was then detached . Now we are not able to attach the same.It shows "Attach Database failed with 9004 error (an error occurred while processing the log for database )" .

We tried a workaround as

- Rename the exsisting Data and logfiles.

- Create an empty database with the same name and physical file layout (file,filegroup structure (irrespective of file size) )

- Stop the sql services;

- Swap in the files you want to attach in place of the empty DB files, and start the server

- Put the db in emergency mode using " UPDATE master..sysdatabases SET status=-32768 WHERE name=' ' "

- Put the db in single user mode using sp_dboption

- Run DBCC CHECKDB(dbname,repair_allow_data_loss)

we are encountering error at the last step as "Could not run BEGIN TRANSACTION in database because the database is in bypass recovery mode "

Could you please suggest us a alternative workaround so as the database can be brought online.
george sibbald
george sibbald
SSCertifiable
SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)

Group: General Forum Members
Points: 6324 Visits: 13687
do you know why it went into suspect mode?

you're best bet is likely to be restoring the database from a backup before the cause of the suspect status

---------------------------------------------------------------------
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