How to Restore Backup From a LDF File
Log data files (LDFs) are used in SQL Server to take a snapshot of the data entered and edited by users. The LDF files are saved on the hard drive of your SQL Server. In some cases, database administrators take copies of the LDF files and back up the copies to a CD or external hard drive. They can be used to restore the data to the SQL Server in an effort to recover from a hard drive crash or software failure.
Instructions
-
-
1
Click the Windows Start button and select "All Programs." In the list of program directories, select "SQL Server" and then click "SQL Server Management Studio." Enter the system administrator user name and password to access the SQL Server.
-
2
Click the database server name on the left side of the console. This expands a list of databases on your server. Right-click the database that needs to be restored and select "Tasks" and then "Restore." Select "Database." This opens the backup dialog window.
-
-
3
Select "From Device" in the list of options in the section labeled "Source for Restore." Click the button labeled "..." to open a dialog box. Click the "Add" button to create a new device for the restore process.
-
4
Select your LDF file on the hard drive or external media. Click the "Options" button on the left side of the window. In the list of options, select "Restore with Recovery."
-
5
Click the "OK" button in the dialog box and click "OK" in the main restore template. The database is restored. Restoring a database can take several minutes, depending on the size of your LDF file.
-
1
References
- Photo Credit black database image by .shock from Fotolia.com
Comments
-
xcuzeme
Sep 22, 2010
What version of SQL Server is your instructions for? These steps do not work for me in SQL 2008. ------------------------------ System.Data.SqlClient.SqlError: The media family on device 'C:\OriginalDB_Log.ldf' is incorrectly formed. SQL Server cannot process this media family.