Comprehensive data protection for all workloads
Post Reply
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Truncate transaction logs

Post by baber »

Dear all

Hi
can you say me in simple with an example what is your means about truncate transaction logs ?
for example is this sentences " If you truncate transaction logs with Veeam Backup & Replication, the chain of transaction logs will be broken, and the Microsoft SQL Server log backup job will not be able to produce a consistent log backup "

BR
Babak
rhys.hammond
Veeam Software
Posts: 75
Liked: 16 times
Joined: Apr 07, 2013 10:36 pm
Full Name: Rhys Hammond
Location: Brisbane , Australia
Contact:

Re: Truncate transaction logs

Post by rhys.hammond »

Truncate meaning to delete. If logs records were never deleted from the transaction log, it would eventually fill all the disk space that is available to the physical log files.
Log truncation automatically frees space in the logical log for reuse by the transaction log.

Regarding the warning, It's not recommended to truncate logs with Veeam Backup & Replication if you use another backup tool which also truncates the logs.

For example, you can use Veeam Backup & Replication to create a VM image backup and instruct the native Microsoft SQL Server log backup job to back up transaction logs. If you truncate transaction logs with Veeam Backup & Replication, the chain of transaction logs will be broken, and the Microsoft SQL Server log backup job will not be able to produce a consistent log backup.
Veeam Certified Architect | Author of http://rhyshammond.com | Veeam Vanguard | vExpert
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: Truncate transaction logs

Post by baber »

now in sql tab when enable application aware processing we have 3 choise:
1- truncate transaction logs
2-don't truncate logs
3-backup logs periodically

now i understand difference between case1 and case3 is:

in case1
it will truncate transaction logs on main vm after backup from vm has been finished and will be saved transaction logs in vm baclup file

in case3: after get backup from vm it will get a seprate backup from transaction logs and will be save them on repository seprately

are that correct?
rhys.hammond
Veeam Software
Posts: 75
Liked: 16 times
Joined: Apr 07, 2013 10:36 pm
Full Name: Rhys Hammond
Location: Brisbane , Australia
Contact:

Re: Truncate transaction logs

Post by rhys.hammond »

Yep pretty much.

Source: https://helpcenter.veeam.com/docs/backu ... 5#truncate

1 - If the job completes successfully, Veeam Backup & Replication produces a backup file or VM replica and truncates transaction logs on the original VM. As a result, you have the backup file or replica that contains a VM image at a specific point in time.
In this scenario, you can recover a database to the point in time when the backup file or replica was created. As transaction logs on the VM are truncated, you cannot use them to get the restored database to some point in time between job sessions.

2 - You can choose not to truncate transaction logs on the VM. This option is recommended if together with Veeam Backup & Replication you use another backup too

3 - To protect Microsoft SQL Server VMs, you can instruct the backup job to create image-level VM backups and periodically back up database transaction logs. If Microsoft SQL Server fails, you can restore the Microsoft SQL Server VM from the necessary restore point of the image-level backup. After that, you can use Veeam Explorer for Microsoft SQL Server to apply transaction logs and get databases on the Microsoft SQL Server to the necessary state between backups.
Veeam Certified Architect | Author of http://rhyshammond.com | Veeam Vanguard | vExpert
baber
Veteran
Posts: 665
Liked: 4 times
Joined: Nov 21, 2013 12:02 pm
Full Name: Babak Seyedi nejad
Contact:

Re: Truncate transaction logs

Post by baber »

Can we say this mode is such as full or incremental backup forever forward inc backup just in this mode after get backup , truncate transaction logs from source vm but full or incremental backup is contain all transaction logs and for restore there is no difference between them if get backup in mode1 while we restored it will be restore with all transaction logs and when we get normal backup from sql machine without select this mode while restore that also will be restore with all of transaction logs

is that correct?
BR
foggy
Veeam Software
Posts: 21139
Liked: 2141 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Truncate transaction logs

Post by foggy »

Backing up transaction logs allows for using the granular point-in-time restore functionality available in Veeam Explorer for Microsoft SQL Server (restore up to a specific transaction).
masonit
Service Provider
Posts: 327
Liked: 23 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Maso
Contact:

Re: Truncate transaction logs

Post by masonit »

Hi!

I have setup transaction log backup of a vm according to this guide: https://www.veeam.com/blog/how-to-back- ... n-log.html

I wonder now how the truncate works. For example if the vm backup runs every 3 hours and log backup every 15 min. As soon as a new vm backup is initiated also a new log backup job session is initated. Lets say vm backup starts 10:00. First log backup is then done 10:01 and I guess every log backup also truncate the log? Log backup is done every 15 min. 10:50 the vm backup is done and logs is truncated aswell in the vm job session. Log backup will continue to run until new vm job session is initiated.

What I want to know is. The truncate of logs in the vm job session at 10:50. Wont that brake the chain for the log job session?

\Magnus
foggy
Veeam Software
Posts: 21139
Liked: 2141 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Truncate transaction logs

Post by foggy »

Hi Magnus, do you mean another job backs up the same VM at 10:50? I believe Veeam B&R will not allow it to truncate logs as only one job should manage logs truncation and this is controlled by the product.
masonit
Service Provider
Posts: 327
Liked: 23 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Maso
Contact:

Re: Truncate transaction logs

Post by masonit »

If I look at a the vm job session. Truncate of logs is always done at the end of the job. After snapshot is removed. Thats what I mean with 10:50. It is the end of the vm backup that started 10:00.

\Magnus
Mildur
Product Manager
Posts: 9846
Liked: 2607 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Truncate transaction logs

Post by Mildur »

masonit wrote: May 11, 2021 8:22 am I guess every log backup also truncate the log?
Veeam Log Backup will not truncate the Logs.
This Feature will only copy the logs every 15 minute away from the sql server to the backup repo. The Log Chain will not be closed until the next VM Backup from Veeam.
Product Management Analyst @ Veeam Software
r2d2
Novice
Posts: 6
Liked: 1 time
Joined: May 10, 2011 1:30 pm
Full Name: arth
Contact:

Re: Truncate transaction logs

Post by r2d2 »

Veeam Log Backup will not truncate the Logs.
This Feature will only copy the logs every 15 minute away from the sql server to the backup repo. The Log Chain will not be closed until the next VM Backup from Veeam.
So periodic backup of logs will not truncate anything? Logs are truncated after the main backup job run only?

Image

We need to wait until the Agent's job run to have these logs properly truncated? Is that correct?
Mildur
Product Manager
Posts: 9846
Liked: 2607 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Truncate transaction logs

Post by Mildur »

Correct.
Logs will be truncated when the full or incremental backup runs for this machine.

Best,
Fabian
Product Management Analyst @ Veeam Software
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 255 guests