Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 MS SQL Server Data recovery using Transaction Log

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-09-28 : 06:57:36
murty writes "Hi,

by mistake the MDF File was deleted. now i am left with LDF file only... the data is very important. Can recover the Data using LDF? i have a full backup(.BAK) upto lastmonth.


Regards
Murty"

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-09-28 : 07:22:49
There is nothing that SQL Server provides for cases like that...but you can use third-party tool like ApexSQL Log. Check out the following link:

[url]http://www.apexsql.com/sql_tools_log.asp[/url]


Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2006-09-28 : 07:28:30
Here's an idea, but I don't recommend it for anything other than DIRE EMERGENCIES. I've never tested it. You absolutely should NOT use this as a standard data recovery technique. Improve your backup schedule instead, and you'll avoid the problem entirely.

1. Restore the backup to a new database with a different name.
2. Detach the new database.
3. Delete the new LDF file and copy the original LDF file into its place.
4. Attach the new DB using the new MDF and old LDF files.

This probably will NOT work, and it won't work unless your database was in full recovery mode AND you never backed up the log for the entire month. If the DB was in simple recovery, forget it, that data is gone.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-09-28 : 08:20:11
If you attached "any old MDF file" would you be able to do one final Transaction Log Backup? (Assuming: all the Tlog stuff is in the LDF file, and it can be Backed up without referencing, per se, the MDF file - does that sound likely?)

Then restore the last-month's-full-backup followed by any previous TLog backups (since the last full backup) and then finally the just-saved-TLog-backup.

But as Rob said the database would have to be in FULL recovery model

Kristen
Go to Top of Page

Davidpoul
Starting Member

14 Posts

Posted - 2009-10-27 : 05:23:38
Its quite difficult to recover data without mdf file. As you are saying that you have the ldf file. ldf file is the log file while mdf file is the master database file. Your whole data is saved in mdf file. I am not sure that you recover your data but try the suggestion given by others.

David Poul
http://www.mssqldatabaserecovery.com
Go to Top of Page
   

- Advertisement -