Solved

Set recovery model to full.  What to do with existing log (.ldf) files?

Posted on 2016-09-08
5
39 Views
Last Modified: 2016-09-08
A consultant changed the recovery model from full to simple for our production SQL databases.  I would like to set the recovery model back to full.  However, the log files (.ldf) have a date/time which is the same as the .mdf files.  I'm not sure what to do with the log files.  Should I delete them or leave them alone?  I wonder why the log files have the same date/time as the the .mdf files if the recovery model is set to simple?  Thank you.Screenshot of date/time for mdf and ldf files
0
Comment
Question by:davidrobertbristow
  • 3
  • 2
5 Comments
 
LVL 69

Expert Comment

by:ScottPletcher
ID: 41790081
DON'T EVER DELETE LOG FILES!

Log files are still needed, even in simple mode.
0
 
LVL 69

Accepted Solution

by:
ScottPletcher earned 500 total points
ID: 41790084
Instead, simply change the mode back to FULL and take a full database backup as soon as you can.  Then start taking regular log backups again, as you would any time a db is in FULL recovery model.  That's all you need to do, nothing extra/special.
0
 

Author Comment

by:davidrobertbristow
ID: 41790090
Can I change the recovery model back to full during production or does it need to be done off-hours?
0
 
LVL 69

Expert Comment

by:ScottPletcher
ID: 41790110
You can do it any time.  

But it won't actually provide any additional recovery possibilities until you've taken a full db backup.  That is, the point of full recovery mode is to allow you to recover changes lost if the db fails; the log file is used "forward recover" (as it's called), i.e. reapply data, to the db.  

But you can't use the log to forward recover until you have a full db backup from which to work.  And a full backup made when in SIMPLE recovery mode won't work.  You have to have a full backup made after the db was put back into full mode to use as a valid starting recovery point.
0
 

Author Comment

by:davidrobertbristow
ID: 41790114
I understand.  Set the recovery mode to full.  Then, take a full DB backup to start the log file chain.  Thank you!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MS SQL 2014 get SPIDs of users 6 27
Creating Alerts in sql sever 2 13
Stored procedure 23 24
select over clause 1 10
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now