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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

urgent - data recovery with SQL 7

Status
Not open for further replies.

devys

Programmer
Joined
Sep 28, 2001
Messages
1
Location
FR
My system has crashed and all I have left are the .mdf and .ldf files.

How can I access to the datas ?
 
I assume you had to rebuild a system and reinstall SQL Server. I also assume that you don't have SQL backups but do have the MDF and LDF files. If this is so try the following.

1- If you haven't installed SQL Server do that first.
Make sure you place the data files in the same drive and directory as the previous installation.
2- Backup the master, msdb, and model databases.
3- Stop the SQL Server service.
4- Backup the MDF and LDF files for master, msdb and model databases.
4- Copy the MDF and LDF files for your databases, including master, msdb and model, into the SQL data directory.
5- Restart SQL Server.

If you are lucky, SQL Server will start and your databases will be available. However, SQL may fail to start for a number of reasons. If it does fail do the following.

6- Restore the MDF and LDF files for the master, msdb and model databases that were created with the new installation of SQL Server.
7- Restart SQL Server.
8- Add all your logins.
9- Use the sp_attach_db stored procedure to attach your user database.
10- Use sp_change_users_login to verify the logins and users match. The SP is documented in books online. You can also read an article about fixing broken logins at Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top