How to Enable Circular Logging in Exchange Server

Summary: Circular Logging in Exchange Server helps clean the old transaction logs and make space for new logs. This blog covers information about Circular logging & also the steps to enable Circular Logging in Exchange to avoid database dismounts or corruption due to low or no space.

Circular logging allows Microsoft Exchange to overwrite transaction log files after the data that the log files contain has been committed to the database. Circular logging is not recommended in production environments since by enabling it, you reduce drive storage space requirements.

But without a complete set of transaction log files, you cannot recover any data more recent than the last full backup, thus increasing the chances of database corruption.

However, you can use Exchange recovery tools such as Eseutil or Stellar Repair for Exchange to repair corrupt EDB files and restore mailbox items. 

How Circular Logging Works?

When Circular Logging is disabled, every log file goes into the transactional log database, and no limit exists as to how large that database can get. When circular logging is enabled, the transactional log can only grow to one megabyte (1 MB) in size. When this limit has been reached, the first log file is overwritten automatically to keep the transactional log database from growing any larger.

The term “circular” arises from the fact that the set of log files starts to “rotate” once the disk space limit is reached, something like a LIFO (last-in, first-out) queue.

Circular logging is a feature of the Joint Engine Technology (JET) database, used by all versions of the Exchange Server that can be enabled or disabled by an administrator. In older versions such as Exchange Server 5.5 and earlier, circular logging was enabled by default However, with Exchange 2000 Server and continuing to Exchange 2010 and newer versions, it is disabled by default.

It is suggested that you should not enable circular logging on an Exchange database if you are doing backups as they will be inconsistent. This includes incremental backups as well. If you do however decide to enable it, then it is recommended to take a full back up immediately, after the databases have been mounted and you have disabled it again.

Circular Logging Considerations

When you enable circular logging, check following points-

Enabling Circular Logging Exchange Server

This can be done by using both PowerShell and the Exchange Admin Center (EAC).

Let us start with the EAC. Follow these steps:

To enable circular logging by using PowerShell, you need to open the Exchange Management Shell and use the below command.

Set-MailboxDatabase -Identity “database1” -CircularloggingEnabled:$true

Alternatively, if you want to do it for all the databases, you can use the below command.

Get-MailboxDatabase | Set-MailboxDatabase CircularloggingEnabled:$true

After the databases have been dismounted and remounted, it is strongly suggested to perform a full backup of your Exchange database.

Use Circular Logging Without Backup

Let’s now look at a scenario where the Exchange backups have not been taking place and the volume where the database is stored is filling up. Once you hit that specific backpressure threshold, then you risk the fact that the Exchange Databases will not mount.

If you are in this situation, do not just jump and enable circular logging so you can get rid of the log files to reclaim the space they have used. Instead, follow these steps:

However, if you still have a problem after enabling circular logging in Exchange 2010, such as database dismount or Exchange database won’t mount, then you need to look at a third-party Exchange Recovery tool such as Stellar Repair for Exchange to repair the corrupt EDB file without the need for the log files.

The software can repair large .EDB files as well as multiple files, simultaneously. You can even open the offline .EDB file with the tool and just extract the data to another live database or Office 365 tenant, or even to a .PST file. The software supports all Exchange server versions such as 2019, 2016, 2013, 2010, 2007, 2003 , 2000 & 5.5.

FAQ

Q. How do I turn off circular logging in exchange?

A. Circular Logging can be disabled from the Exchange Admin Center (EAC), from the Servers/Databases tab and from the maintenance mode, untick Enable circular logging. Alternatively, one can use the Exchange Management Shell (EMS) PowerShell command Set-MailboxDatabase example below.

Set-MailboxDatabase "<database name>" -CircularLoggingEnabled $False

Q. Should I enable circular logging?

A. Circular logging should only be used when there is an issue as for recoverability of data and integrity of data, it is strongly suggested not to have the feature enabled. It should only be used when there is a reason why, example out of storage or to resolve a quick issue.

Q. Is DAG compatible with circular logging?

A. Yes, it is supported, and it will not affect the Database Availability Group (DAG), but it is strongly not recommended to enable circular logging in a production environment as this would cause restorability and integrity issues.

Q. Should we have circular logging disabled to create the database copy?

A. No, by default (as it is recommended), circular logging is disabled when creating a new Exchange Mailbox Database.

Q. I have enabled Circular Logging and I took a backup with Windows Server Backup, the firsts  backup ended fine, but  now it is ended with problems with the re-build of system and system state?

A. Yes, as mentioned in this article and by Microsoft enabling circular logging should only be enabled when troubleshooting storage issues as a last resort, or when having a test server which is not in production. Recovering data without all the transaction logs to replay them, will cause data integrity and data loss.

Q. After incremental backup, a set of logs is deleted by the Exchange server. Can you please help me to understand how the Exchange server knows these are the logs that it must delete. Will the backup application update Exchange server that I made a copy these log files  and succeeded in backup, now you go ahead delete the logs?

A. After an incremental application aware backup (with circular logging disabled), the Exchange Server will receive a message from the backup software that the database has been successfully backed up with the list of transaction logs which are committed. After this the Exchange Server can safely (automatically) purge the transaction logs. You should never manually delete the transaction logs. If the backup is supported and is application aware, the transaction logs should be purged automatically. If there is a huge load on the server and a big volume of transaction logs are generated, one should consider increasing the frequency of the backup.

Related Post

Stellar Data Recovery

Trial Download is for Desktop or Laptop. Put your email id to receive the download link




Exit mobile version