Quantcast
Channel: SQL Backup Archives - SQL Authority with Pinal Dave
Viewing all articles
Browse latest Browse all 110

SQL SERVER – Restore Database With Just Log File

$
0
0

Restoring the database with Just Log File is not possible. If you are looking for the answer to this question, you have bad news. I am writing this blog post for a simple reason, when I get an email asking for the same question again, I answer the question quickly with a link to the blog post.

SQL SERVER - Restore Database With Just Log File JustLogFile-800x246

Here are the top 5 questions I have received in the last 3 months about restoring a database with just a log file.

Q1: Is it possible to recreate the database with just a log file, I have do not have a data file?

Q2: How to generate mdf file from the ldf file?

Q3: I have multiple data file in my database and I have all the datafiles except one file and all the log file, can I restore my database?

Q4: I have all my log file backup and not datafile backup, is there any way to stitch the log files to generate data files?

Q5: I have no backup and ransomware is encrypted all my data and log file and I have no backup, what is the workaround?

Unfortunately, the answer to all the questions is – No, it is not possible.

If you do not have your data file or its backup, only having a log file or log file’s backup is not good at all. If you only have a log file (and no data files), you can’t generate your database from log files even if you have a third party tool that claims that they will regenerate the database for you. At the most third party tool can read the log file and give you some idea about the recent data which was modified there is no way, it can help you to regenerate the database at all.

Let me re-iterate if there is no good backup with you, in most cases when the accident happens, the situation is extremely unfortunate. Always take your backup and test it regularly. Here is my most popular blog post about the backup timeline: SQL SERVER – Backup Timeline and Understanding of Database Restore Process in Full Recovery Model.

Here are blog posts which you may find relevant to this topic:

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – Restore Database With Just Log File


Viewing all articles
Browse latest Browse all 110

Trending Articles