Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Do you really need the log file Expand / Collapse
Author
Message
Posted Tuesday, February 5, 2013 10:28 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, September 29, 2014 1:51 PM
Points: 138, Visits: 370
We have a 70 GB mdf w/ a 29GB ldf. After doing full backup, can I truncate the log via the following plan:

<Break mirroring>
alter database xxx set recovery simple

< right click - properties - files - set size to 5GB >
alter database xxx set recovery full

<Reset mirroring>


What do I lose by truncating the log after a full backup?

Thanks,
Mike
Post #1416238
Posted Tuesday, February 5, 2013 11:30 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 11:02 AM
Points: 20,734, Visits: 32,497
One, the ability to do point in time recovery of the database if it is needed. Having a mirror database is good for high availability but it doesn't replace the need for a good set of backups from which to recover if necessary.

Second, breaking and re-establishing the mirror is not really the best thing you can do.

Why do you want to truncate the log, or is shrinking the log what you are actually talking about. They are two entirely different things.




Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1416257
Posted Tuesday, February 5, 2013 11:41 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, September 29, 2014 1:51 PM
Points: 138, Visits: 370
We are running out of space on our mirror server. I though that if I could reduce the log, it would give us some breathing room while we figure out a solution.

We do daily backups at 11pm, a diff backup at 6am and hourly transaction logs from 7 am - 6 pm - plus the mirroring.

I don't think the shrink would work. It hasn't in the past when I restore a backup to my local machine.

Mike
Post #1416259
Posted Wednesday, February 6, 2013 12:31 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 11:31 AM
Points: 40,177, Visits: 36,578
You can't switch to simple recovery with active database mirroring. You'll need to completely drop the database mirroring setup, then you can change recovery models. Recreating the mirror will require copying over and restoring a full or diff backup. That's a fair bit of work and you'll be completely without the mirror while that's done.

We do daily backups at 11pm, a diff backup at 6am and hourly transaction logs from 7 am - 6 pm - plus the mirroring.


That's probably part of the cause of the large log, the lack of log backups for 13 hours a day. I suggest log backups on the hour, every hour.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1416281
Posted Wednesday, February 6, 2013 7:59 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, September 29, 2014 1:51 PM
Points: 138, Visits: 370
We do hourly transaction log backups during the work day.

Mike
Post #1416521
Posted Wednesday, February 6, 2013 8:06 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, October 13, 2014 6:42 AM
Points: 5,216, Visits: 5,111
Between 6pm and 7am you dont do transaction log backups, during that time the log cannot be marked as re-usable so that is why you have a huge transaction log as you have 13 hours worth of transactions waiting to be backed up.

Do your transaction logs every hour on the hour all day, not just during the working day.





Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1416525
Posted Wednesday, February 6, 2013 9:10 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, September 29, 2014 1:51 PM
Points: 138, Visits: 370
A full backup doesn't set the log to re-usable?
Post #1416578
Posted Wednesday, February 6, 2013 9:24 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 11:31 AM
Points: 40,177, Visits: 36,578
mike 57299 (2/6/2013)
A full backup doesn't set the log to re-usable?


No.

Please read through this - Managing Transaction Logs



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1416593
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse