recover from mdf files

Hi
i have SQL cluster server which failed because of hardware.
i couldnt rebuild the master even with rebuild.exe
so i had to delete the sql cluster and create again
i have the only mdf and ldf files of the old server.
is there a way to recover the master and other database from mdf and ldf and post to the new server.


any help will be highly appreciated.

thanks

HARRY
Stavros26Asked:
Who is Participating?
 
Irwin SantosComputer Integration SpecialistCommented:
What I have done in the past was copy the databases into the MDF/LDF folders..and voila it worked!

But I'm not sure about the master....  if this is a fresh install...backup would be prudent before you apply my voodoo fix.
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
Hi Stavros26,

Do u have the  backup of the master database

1. Stop MSSQLServer and SQLServerAgent services.
2. From a command prompt, enter this command

sqlservr.exe -m

3. then run the following script
USE master

GO

RESTORE DATABASE Mater
     FROM DISK = ''c:\path\backup\master.bak'



Aneesh
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
Moving the master database
1. Change the path for the master data and log files in SQL Server Enterprise Manager.

Note You may also change the location of the error log here.
2. Right-click the SQL Server in Enterprise Manager and then click Properties.
3. Click Startup Parameters to see the following entries:-dD:\MSSQL7\data\master.mdf
   -eD:\MSSQL7\log\ErrorLog
   -lD:\MSSQL7\data\mastlog.ldf
-d is the fully qualified path for the master database data file.

-e is the fully qualified path for the error log file.

-l is the fully qualified path for the master database log file.
4. Change these values as follows: a.  Remove the current entries for the Master.mdf and Mastlog.ldf files.
b.  Add new entries specifying the new location:-dE:\SQLDATA\master.mdf
      -lE:\SQLDATA\mastlog.ldf
 
 
5. Stop SQL Server.
6. Copy the Master.mdf and Mastlog.ldf files to the new location (E:\Sqldata).
7. Restart SQL Server.
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
imran_fastCommented:
do fresh installation of your sql server on the cluster.

1.stop the sql server services
2.replace the new mdf and ldf files with the old one you have
3.start the sql server services
0
 
SatyaSKJCommented:
You cannot attach system databases and follow as suggested above to attach user databases. KBA http://support.microsoft.com/default.aspx?scid=kb;en-us;224071 fyi.

0
 
imran_fastCommented:
hi SatyaSKJ ,
you can do it provided that all the configuration of the server is same. it have tried it and it worked for me.
 it is similar to restoring backup.
and if the current installation of sql server is same as what you had before you can simply replace the files and it will work.
One more thing no need for sp_attach or detach just replace files.
0
 
SatyaSKJCommented:
But that is not a recommended way to recovery from a disaster, backup is always a saviour.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.