|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 5:00 AM
Points: 24,
Visits: 91
|
|
Good Morning Everyone,
I hope everyone is having a nice Monday morning I came into work today and I noticed something while checking my backups and I was wondering if I could get some advice. We currently have two jobs running deleting records from two tables every hour to prune back our database, the problem I have is that the transaction logs are now the same size as the .bak's. I know this is as a result of deleting the records, and we are deleting the minimum number we can to reduce the database over a long period. My question is more to do with shrinking the logs and what would be the best way to go about it? Or is this even the best approach?
Any help would be greatly appreciated especially considering its Monday, and nobody wants to get into this stuff on a Monday haha
Thanks Everyone, Craig
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Yesterday @ 9:14 AM
Points: 4,428,
Visits: 7,196
|
|
Craig
Don't shrink the logs, but make sure you're backing them up regularly. Search the web for "SQL Server Transaction Log Maintenance" for more information.
John
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Saturday, May 18, 2013 1:28 AM
Points: 62,
Visits: 1,140
|
|
I would not recommend shrinking the transaction log as the log will probably grow again. How often are you performing your transaction log backups? You could increase the amount of transaction log backups, this would reduce the size of the transaction log backups and may also help prevent the transaction log growing
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Yesterday @ 11:48 PM
Points: 37,723,
Visits: 29,979
|
|
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
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 5:00 AM
Points: 24,
Visits: 91
|
|
Hi John, Hi BeetleJuice,
Thanks for getting back to me so quickly I had a look over a few topics on your advice John and I seem to be doing things as advised. I have a backup maintenance plan taking my transaction log backups once daily (beetlejuice) and I take a full backup once weekly. Would it be advised to take them more regularly?
Thanks again, Craig
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 5:00 AM
Points: 24,
Visits: 91
|
|
Hi GilaMonster,
Going to have a look now. Thank you.
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Yesterday @ 11:48 PM
Points: 37,723,
Visits: 29,979
|
|
craig.dixon (1/7/2013) Would it be advised to take them more regularly?
Yes. Daily log backups mean that you can lose up to 24 hours data in the case of a disaster. If that's acceptable, consider simple recovery model and daily differential backups. If that's not acceptable, then you need log backups to match your data loss allowance.
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
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 5:00 AM
Points: 24,
Visits: 91
|
|
Hi GilaMonster,
Thanks for the advice, I read through the article you recommended to see if I could work out a solution and I think I mite be getting somewhere. Im just wondering though, if I was to use simple recovery mode and differential backups, would the differential backups not be as large as my transaction logs? I thought that as its the two jobs I have deleting records causing the issue I would encounter the same problem?
Thanks again for your help, I really appreciate it, Craig
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Yesterday @ 3:40 PM
Points: 13,380,
Visits: 25,164
|
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Yesterday @ 11:48 PM
Points: 37,723,
Visits: 29,979
|
|
craig.dixon (1/7/2013) Im just wondering though, if I was to use simple recovery mode and differential backups, would the differential backups not be as large as my transaction logs?
Maybe, maybe not. Depends what changes you do.
Log backups record each and every change (the operations that make the changes). Differential backups record the net result of those changes (the data after)
The major difference would be in the size of your log files, as they would no longer need to store 24 hours of log records.
Honestly though, the decision which should not be based on 'which is larger', but on 'which allows me to meet my SLAs'. If you have a max 2 hour data loss SAL, then your current backup strategy does not support it, neither does the switch to simple recovery and diff backups option.
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
|
|
|
|