Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System Crash, can i detach from sql server?

Status
Not open for further replies.

markphsd

Programmer
Jun 24, 2002
758
US
A customer had an operating system crash on their system running SQL Server.

Can the database be detached or copied and attached by just accessing the hard drive. (The folder is not secured). If not, what could be done with that database?

Thanks.

Mark P.
Providing Low Cost Powerful Point of Sale Solutions.
 
Is your customer taking regular database and transaction log backups? Are they likely to have lost data or corrupted the database as a result of the crash?

Simply attaching the .mdf file recovered from the HDD won't work if the DB is corrupt.

The ideal solution would be to reinstall SQL Server, Apply the last Full dataase backup, apply the last Differential backup (if applicable) and if available, apply the Transaction Log backups since the last Full/Differential backup.

You need to post a little more info regarding the clients backup/restore capabilities for a more detailed response.

Cheers,
Leigh

"If you had one shot, one opportunity, to seize everything you ever wanted, in one moment, would you capture it, or let it slip?" - Eminem

 
If the SQL services aren't running you can copy the .mdf and .ldf files to another server a simply attach them. But SQLBi is correct. If you follow the copy method you should at least run checkdb to make sure everything is correct.

- Paul
10qkyfp.gif

- If at first you don't succeed, find out if the loser gets anything.
 
Thank you both.

If the log is not recoverable, can it be re-built? The tech was getting a error message when trying to copy, but the mdf can.

Mark P.
Providing Low Cost Powerful Point of Sale Solutions.
 
you don't need the log. you can just copy the .mdf and re-attach it. It will create a new log. (of course you've lost any open transactions that were in the old log.)

- Paul
10qkyfp.gif

- If at first you don't succeed, find out if the loser gets anything.
 
I don't know much about the log files. I know the general purpose is to speed up performance. If they were add 800 records a day, is it likely that the log probably held just a few of those records?

Mark P.
Providing Low Cost Powerful Point of Sale Solutions.
 
When trying attach the database, I get this error:

Error 5159 Operating System Error 997(Overlapped I/0 operation is in progress.) on device: c:\[path to the database] during ForwardLogBlockReadAheadAsync. Could not open new database 'mydatabase'. Create database is aborted.

I'm also getting a cyclic redundancy check when trying to copy the log file. This does not happen with the mdf.

Would this

Mark P.
Providing Low Cost Powerful Point of Sale Solutions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top