Log shipping vs shrinking Log Files

TYzermans
Member Posts: 10
I have a customer who uses log shipping.
He shrinked the transaction log of a database.
Is the log shipping still working after a file-shrink for the log files and if not, what is the eaiest way to re-enable the log shipping?
Thanks for the help,
Regards,
Timothy Yzermans
He shrinked the transaction log of a database.
Is the log shipping still working after a file-shrink for the log files and if not, what is the eaiest way to re-enable the log shipping?
Thanks for the help,
Regards,
Timothy Yzermans
0
Comments
-
I don't think one has anything to do with the other. Did you observe that log shipping stopped working though?
By the way, you should only shrink the transaction log if it has grown exceptionally large, and you want to reclaim some of the space. Shrinking the log as a regular task is not recommended. It will fragment the file, because it will grow again suring daily use. It also causes performance hits when the system grows the file, which is usually at the busiest times.0 -
No did not observe it stopped working.
No the whole story is that the client gave me call this afternoon telling me his log file was growing over 40Gb (for a NAV test database) and he asked me what he can do to shrink this file. I told him, if his daily backup was running without errors, he could try to shrink his transaction log file (since it is a test database he wouldn't have to wurry about restoring transactions).
After a while he called me that it worked but then he told me that they use log shipping and I am/was not shure how it will affect the log shipping.
Thanks for your answer.
Regards,
Tim0 -
Hi!
Normally the shrinking of the TLog file - e.g. using the DBCC SHRINKFILE command - will not affect the Log Shipping. But this shrinking is only possible if the TLog has been truncated by a BACKUP LOG before, means the committed data has been saved to the backup file and the space has been released.
If you clear the TLog by using a BACKUP LOG TRUNCATE ONLY command, then also the committed data would be removed, but NOT saved into a backup file!
In this case you interrupt the consistent chain of backups and you need to restart the Log Shipping by copying a new FULL backup!
Regards,
JörgJörg A. Stryk (MVP - Dynamics NAV)
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool0 -
stryk wrote:Hi!
Normally the shrinking of the TLog file - e.g. using the DBCC SHRINKFILE command - will not affect the Log Shipping. But this shrinking is only possible if the TLog has been truncated by a BACKUP LOG before, means the committed data has been saved to the backup file and the space has been released.
If you clear the TLog by using a BACKUP LOG TRUNCATE ONLY command, then also the committed data would be removed, but NOT saved into a backup file!
In this case you interrupt the consistent chain of backups and you need to restart the Log Shipping by copying a new FULL backup!
Regards,
Jörg
Dear Jörg,
Thanks for your answer!
One final question: when performing the shrink from the SSMS. Right-click on the database -> tasks -> Shrink -> Files. Then choose "Log" at File type. Is this procedure the same as the DBCC SHRINKFILE or is it the same as the BACKUP LOG TRUNCATE ONLY?
Thanks..
Regards,
Timothy0 -
Well, if you execute the "Right-click on the database -> tasks -> Shrink -> Files the Log" then, depending on the "Option" you selected, either a DBCC SHRINKFILE (N'Navision_Log' , 0, TRUNCATEONLY) or a DBCC SHRINKFILE (N'Navision_Log' , 2000) or a DBCC SHRINKFILE (N'Navision' , EMPTYFILE).
SO it's all a DBCC SHRINKFILE. PLease regards that the TRUNCATEONLY option of the DBCC is a different thing than the BACKUP LOG TRUNCATE_ONLY:
The DBCC just moves the data and shrinks the file; a BACKUP LOG TRUNCATE_ONLY will erase the data!
(See "Books Online" for details)
Regards,
Jörg
P.S.: In SSMS you could oftenly find a button "Script" on top of a form, e.g. when doing the "Shrink File". By clicking on that the TSQL for this operation is generated, so you could see what's actually going on!Jörg A. Stryk (MVP - Dynamics NAV)
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions