Score:0

Exchange not truncating Transaction Logs after successful Full-Backup

je flag
rui

I'm using Dell Avamar native Exchange Agent to Full-Backup the Databases on a Stand-Alone Exchange 2013 Server (latest updates and patches). It uses VSS.

It's not an Agent issue, since at the end of the Backup we correctly get Windows Event 2046:

The Microsoft Exchange Replication service VSS Writer instance xxxxx has successfully completed the backup of database 'XXXXXXX'

Database log truncation has been requested for this database. Log truncation will occur on the active copy after the next log generation is created.

But the logs keep piling up at a rate of 560 logs a day.

I've confirmed that CircularLogging is disabled and LastFullBackup attribute gets correctly populated.

What am I missing?

cn flag
How many logs.?
rui avatar
je flag
rui
Hello, Greg. The average rate is 560 logs a day (updated question with this detail)
Score:1
je flag
rui

If anyone else is reading this post, the logs started magically being correctly purged 3 days after I posted for help. I'm closing the issue, but I'm not very assured, since magic is something I don't like in IT.

Let me share the Powershell script I created as a workaround so I didn't run out of space meanwhile

The script:

  1. Checks if The MailboxDatabase is Mounted
  2. Enables Circular-Logging
  3. Dismounts the MailboxDatabase
  4. Mounts the MailboxDatabase

The logs get purged

  1. Disables Circular-Logging
  2. Dismounts the MailboxDatabase
  3. Mounts the MailboxDatabase

`

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn    

#################  Functions  ###############

Function MandaMail{
    Param ( [string]$assunto,[string]$texto )
    Send-MailMessage -To “<[email protected]>” -From “<[email protected]>”  -Subject $assunto -Body $texto -SmtpServer “smtp.server.domain”
}

Function IsMounted{
    Param ( [string]$mdb )
    return [System.Convert]::ToBoolean($(Get-MailboxDatabase $mdb -Status | foreach { $_.Mounted}))
}

Function ReiniciaMDB{

    Param ( [string]$mdb )
    
    Start-Sleep -Seconds 5

    Write-Host "   ...vamos desmontar a Mailboxdatabase:"$mdb
    Dismount-Database -Identity $mdb –confirm:$false 
    Start-Sleep -Seconds 10
        
    Write-Host "   ...confirmar se desmontou... "
    if (IsMounted($mdb)) {
        Write-Host "   ...ERRO ao desmontar -> return False "
        return $false }
    Else {
        Write-Host "   ...ok, desmontou."
        Write-Host "   ...vamos montar a Mailboxdatabase:"$mdb
        Mount-Database $mdb
        Start-Sleep -Seconds 5

        Write-Host "   ...confirmar se montou..."
        if (IsMounted($mdb)) {
            Write-Host "   ...ok. montou"
            return $true }
        Else {
            Write-Host "   ...ERRO ao montar -> return False "
            MandaMail -assunto "Exchange | PurgeTransLogs | ERRO ao montar:"$mdb -texto "." 
            return $false}
    }


}


Function LimpaTransLogs{

    Param ( [string]$mdb )

    if (IsMounted($mdb)) { 
        Write-Host "...a MDB "$mdb" esta montada. /n ...activar o circular logging..: "
        Set-MailboxDatabase -Identity $mdb -CircularloggingEnabled:$true        

        Write-Host "...reiniciar a MBD run1... "
        If (ReiniciaMDB($mdb)) {
            Write-Host "...reiniciou com SUCESSO. /n ...desactivar o circular logging..: "
            Set-MailboxDatabase -Identity $mdb -CircularloggingEnabled:$false

            Write-Host "...reiniciar a MBD run2..: "
            If (ReiniciaMDB($mdb)) {
                Write-Host "...reiniciou com SUCESSO."
                MandaMail -assunto "Exchange | PurgeTransLogs | SUCESSO " -texto "." 
                Write-Host "...FIM!" 
                return $true}
            Else {
                Write-Host "...algo não correu bem :("
                return $false
            }
        }
        Else { Write-Host "...nao reiniciou a MBD run1" }
    }
    Else { 
        Write-Host "...A MDB "$mdb" nao estava montada" 
        MandaMail -assunto "Exchange | PurgeTransLogs | ERRO: nao estava montada " -texto "." 
    }

}

#####################################################################

LimpaTransLogs("MailboxDatabase_01")
LimpaTransLogs("MailboxDatabase_02")
cn flag
Anyway, glad to know this project is completed. You could choose the most helpful post above and mark it as the best answer, this will make answer searching in the forum easier and be beneficial to other community members as well.
Score:0
us flag

Hope you have resolved the issue,

There can be two reasons for this issue:

First: Exchange search indexer service might be stopping to truncate log files. You could try following steps:

  1. Stop Exchange Search services

    Stop-Service MsExchangeSearch
    Stop-Service MsExchangeSearchHostController
    
  2. Delete, rename or move to another location

  3. Restart Exchange Search services

Second: Exchange writer can only backup and restore active Exchange databases. Please check errors with the VSS Exchange writer as well as in logs.

BTW you can enable circular logging for the affected database also, it will truncate the logs by automatically, then disable circular logging. After that, take a full backup of your Exchange database using Windows Server Backup. You can refer this link for detailed information.

Score:0
cn flag

You could consider that enable the Circular logging, It would help you to reduce the log size of the databases Exchange 2019: Enable Circular logging on a Database - TechNet Articles - United States (English) - TechNet Wiki (microsoft.com)

rui avatar
je flag
rui
Yes, Aaron, I do that as a workaround on the post-script after successfull backup to purge the logs, and then disable it again so I don't lose the ability of performing incremental-backups. But that's a workaround. This has to work flawlessly. It's a Windows VSS feature. Hasn't anyone else run into this?
Score:0
cn flag

Have you reviewed this document? EXCHANGE DAG 2016 : Transaction Logs are not truncated if a database copy exists through veeam backup - Microsoft Q&A In this case, the OP said that you have to select all disk that contains Active & Passive database drives in the backup to flush the logs properly.

rui avatar
je flag
rui
Hello, Aaron. That only applies to DAG landscapes. This server is stand-alone. That's what makes the whole thing most intriguing.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.