Link to home
Start Free TrialLog in
Avatar of jagoodie
jagoodie

asked on

Deleted Master LDF, Need to Recover DB

Is there anyway to get my server back on-line after deleting the Master LDF?
Avatar of mahery
mahery

Your best be is try to use the sp_attach_single_file_db command.  It will create the log file for  you.  EXEC sp_attach_single_file_db @dbname = 'pubs',
   @physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf'

Avatar of jagoodie

ASKER

How do I exec this if the server is not online, as it isn't because it is down, and the master ldf is missing?
Your only option is the sp_attach_single_file_db command.
It is the only procedure that requires only the mdf file.

I have ran into the same problem and it worked.  Give me more detail why you have rejected my answer.


EXEC sp_attach_single_file_db @dbname = 'pubs',
   @physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf'
You could try the rebuild master utility

Rebuildm.exe in the \Mssql7\Binn directory. This runs with the server shut down so has a good chance of working.
So, I tried that, and it said, "Failed to initilize application. Last error returned 1114."

Is there another way around this mess?
You execute this in the Query Analyser
Which cannot be done when the server is not online.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It should work Rebuildm.exe. It will copy the system databases from your installation CD (master, temp, etc). After that you should sp_attach_db for every user database.
The location for Rebuild Master utility is :
Program Files\Microsoft SQL Server\80\Tools\Binn

Hope it works.
This ended up being the only thing that worked.
Thanks for all of your help!
=(