Search This Blog

Thursday, August 2, 2007

Recover last Transaction Log When the Master and the Database Files Are Damaged

If the master database and the data file of a user database are bad, but the transaction log file of the database is still accessible, you can still backup the last active transaction log of the database to reduce the loss of data by following these steps:
1) Rename the transaction log files. 2) Rebuild the master database. 3) Create a similar database. The new database does not have to be the same size; however, it must contain the same number of data and log files. 4) Stop SQL Server. 5) Delete all the data files of the newly created database so that it will fail recovery.
Replace the log files of the new database with the original log files so that you can backup the transaction log.
6) Restart SQL Server.
7) Run this command to back the tail of the log:Backup Log to Disk = With NO_TRUNCATE
8) Use the sp_dbremove stored procedure to remove the database.

No comments: