How do I restore a SQL Server DB only having the transaction log?
Some ASP.NET app has removed my data in some SQL Server 2005 DB.
I've the transaction log which has a size of 18MB aprox, but the MDF file is of 4MB.
Do you know if there's any chance of recovering a 开发者_如何学Cfull DB by using the transaction log?
Currently I don't have any DB backup, so I can't use the MSDN guidelines to do this operation.
Thank you in advance.
You cannot. The transaction log alone won't be sufficient to restore your database.
You need to be able to restore your MDF database file, and then you can re-run transactions from the transaction log. But the log alone doesn't contain the whole database.
No.
There is not enough information in the LDF by itself.
You may be able to rewind using a 3rd party log explorer tool, say from Red Gate but I've never known anyone succeed: they aren't designed for this task
The transaction log is a record of changes made to the database. To replay the transaction log, you need a starting point against which all the changes were made. Without the starting point, the changes are meaningless. Hence, as already noted by others, you cannot recover with just the transaction log.
精彩评论