Comprehensive data protection for all workloads
rimvydukas
Enthusiast
Posts: 93
Liked: 5 times
Joined: Jun 04, 2013 8:15 am
Contact:

Feature request: shrink log files

Post by rimvydukas » Jun 21, 2013 6:38 am

Hi,

As we all know it is possible to truncate log files after machine is backed up. Is it possible to add an option which lets shrink these log files? Maybe few additional checkboxes:) Thanks.

v.Eremin
Product Manager
Posts: 15803
Liked: 1251 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Feature request: shrink log files

Post by v.Eremin » Jun 21, 2013 7:53 am

Is it possible to add an option which lets shrink these log files?
May I ask you to elaborate on it a little bit? You mean, the option that lets you to truncate the Exchange logs without performing backup or what? Thanks.

rimvydukas
Enthusiast
Posts: 93
Liked: 5 times
Joined: Jun 04, 2013 8:15 am
Contact:

Re: Feature request: shrink log files

Post by rimvydukas » Jun 21, 2013 8:02 am

No, I want to be able to do backup of sql database, truncate logs after that (can do this with current implementation) and besides of truncate operation I want to have an option to shrink sql transaction logs in addition to truncate operation. As I can understand - truncate operation does not reduce the size of sql transaction logs.

v.Eremin
Product Manager
Posts: 15803
Liked: 1251 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Feature request: shrink log files

Post by v.Eremin » Jun 21, 2013 8:10 am

In fact, log truncate option does reduce the size of corresponding sql transaction logs. Though, it won't affect backup size, since truncation operation takes place after the backup job has finished.

Thanks.

rimvydukas
Enthusiast
Posts: 93
Liked: 5 times
Joined: Jun 04, 2013 8:15 am
Contact:

Re: Feature request: shrink log files

Post by rimvydukas » Jun 21, 2013 8:29 am

Actually I think that you're wrong. One excerpt of the many:

Log truncation does remove transactions from the log file, but it doesn’t actually reduce the amount of space reserved for the file. SQL Server expects that your transaction log will eventually grow to its pre-truncation size, so it doesn’t release the disk space allocated to the log. This can be problematic if your log grows to an artificially large size at one point in time and never reaches that size again.

In that case, you’ll need to manually shrink the transaction log file to reclaim the disk space for other uses. You may shrink your log file using the following Transact-SQL command: DBCC SHRINKFILE(<filename>,<desired_shrink_size>)

v.Eremin
Product Manager
Posts: 15803
Liked: 1251 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Feature request: shrink log files

Post by v.Eremin » Jun 21, 2013 9:54 am

Then I have to admit that there must have been a certain kind of misunderstanding between us ,since I mixed up the way truncation option works in case of SQL server with the way it works in case of Exchange server.

As far as I’m concerned, even though it’s not considered to be a best practice, you can enable auto shrink option in SQL server, and that’s likely to do the trick for you:
http://msdn.microsoft.com/en-us/library/ms365418.aspx

Shrinking database and log files can be set to occur automatically. However, we recommend against automatic shrinking, and the autoshrink database property is set to FALSE by default. If autoshrink is set to TRUE, automatic shrinking reduces the size of a file only when more than 25 percent of its space is unused. The file is shrunk either to the size at which only 25 percent of the file is unused space or to the original size of the file, whichever is larger. For information about changing the setting of the autoshrink property, see View or Change the Properties of a Database—use the Auto Shrink property on the Options page—or ALTER DATABASE SET Options (Transact-SQL)—use the AUTO_SHRINK option.
Hope this helps.
Thanks.

Nikolay
Influencer
Posts: 18
Liked: never
Joined: Dec 01, 2012 9:14 am
Full Name: Nikolay Evdokimov
Contact:

[MERGED] : SQL Server 2008 R2 transaction logs do not trunca

Post by Nikolay » Jul 09, 2013 3:42 pm

Hello,

We have daily Veeam backup job with multiple VMs with two of them with SQL Server 2008 R2 installed. For these two VMs with SQL server application-aware image processing is enabled and job finishes with no errors or warnings. In the job log there is a successful notification "Truncating transaction logs" but when I log in to the virtual server after backup job completion I can see that the logs actually did not truncate.
Please advise!

Thank you,
Nikolay

v.Eremin
Product Manager
Posts: 15803
Liked: 1251 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Feature request: shrink log files

Post by v.Eremin » Jul 09, 2013 4:10 pm

I can see that the logs actually did not truncate.
Hi, Nikolay. Could you elaborate on how you understood this? Are you talking here about the size of corresponding logs and the fact that it hasn't reduced?

If so, please be aware that log truncation operation, as mentioned above, doesn’t reduce the actual log size. In order to do it, you have to enable auto-shrink option, though, MS advices against it. Thanks.

rimvydukas
Enthusiast
Posts: 93
Liked: 5 times
Joined: Jun 04, 2013 8:15 am
Contact:

Re: Feature request: shrink log files

Post by rimvydukas » Jul 10, 2013 11:01 am

Consider log shrink option (user selectable) as a feature request for future versions:)

v.Eremin
Product Manager
Posts: 15803
Liked: 1251 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Feature request: shrink log files

Post by v.Eremin » Jul 10, 2013 11:22 am

Thanks for the feedback; much appreciated. Though, from my perspective, it might be a disputable idea to implement something that is against recommended practice, and that might lead to decreased database performance, etc.

rimvydukas
Enthusiast
Posts: 93
Liked: 5 times
Joined: Jun 04, 2013 8:15 am
Contact:

Re: Feature request: shrink log files

Post by rimvydukas » Jul 10, 2013 11:26 am

Yes, it could, but I think that on less active databases this option would be more that welcomed, at least for us. I'm talking about selectable option and not about some kind of permanent one. But its only my suggestion...

Nikolay
Influencer
Posts: 18
Liked: never
Joined: Dec 01, 2012 9:14 am
Full Name: Nikolay Evdokimov
Contact:

Re: Feature request: shrink log files

Post by Nikolay » Jul 10, 2013 5:40 pm

v.Eremin wrote: Hi, Nikolay. Could you elaborate on how you understood this? Are you talking here about the size of corresponding logs and the fact that it hasn't reduced?

If so, please be aware that log truncation operation, as mentioned above, doesn’t reduce the actual log size. In order to do it, you have to enable auto-shrink option, though, MS advices against it. Thanks.
OK, I understand now. Yes, I talked about not only truncating (moving pointer inside transaction log file) but also about reducing actual log size. And yes, I fully agree that this operation should be done by DBA (when needed). In Exchange case I think Veeam will remove log files with this option?

Thanks,
Nikolay

v.Eremin
Product Manager
Posts: 15803
Liked: 1251 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Feature request: shrink log files

Post by v.Eremin » Jul 11, 2013 7:59 am

Yep, you’re completely right in your assumption.

gerards
Novice
Posts: 4
Liked: never
Joined: Nov 01, 2018 10:18 am
Full Name: Gerard Schoenmakers
Contact:

[MERGED] why are logs not truncated

Post by gerards » Nov 01, 2018 11:11 am

We have an sql 2008
When we enable the marker in veeam to truncate the logging under guest processing/enable application aware processing in veeam backup (9.5.0.1922)

The backup process we don't see the logfile ( 7GB logfile an a 21gb datbase ) getting smaller after the backup is finished
What setting should we allso configure for the logfile to shrink?

Kind Regards
Gerard Schoenmakers

wishr
Veeam Software
Posts: 401
Liked: 44 times
Joined: Aug 07, 2018 3:11 pm
Full Name: Fedor Maslov
Contact:

Re: why are logs not truncated

Post by wishr » Nov 01, 2018 12:37 pm

Hi Gerard,

Welcome to Veeam community forums and thanks for posting.

Could you please make sure that on the "General" tab, "Transaction logs" section, the "Process transaction logs with this job (recommended)" setting is chosen along with the "Truncate Logs" setting on the "SQL" tab.

Also, what is the output/status of the backup job? If the job has not succeeded the logs won't be truncated. Maybe there are some warnings indicating an issue with SQL processing configuration (wrong credentials, etc.)?

Thanks,
F

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 34 guests