Is there a pseudo backup procedure to force Exchange log truncation?

I have several separate test environments running 2008 R2 and Exchange 2010, at varying patch levels and for varying reasons. One consistent issue I encounter is that transaction logs for Exchange are not truncated because no backup solution is in place, nor do I want one.

So, as I see it, that leaves me with three options:

  1. Enable circular logging. This is not desirable for some of the test scenarios, as it may conflict with properly emulating a specific environment.
  2. Dismount all databases and run eseutil /mh. This works, but it's a cumbersome maintenance process.
  3. Some pseudo-backup utility (or some trick with a supported, low-impact one) to "trick" Exchange into believing it is now safe to truncate.

The first two I can do but rather wouldn't. Is there a way to do the third option?


Not to steal JoeQwerty's thunder, as I think his answer to this question is more than valid and definitely applicable in pretty much any scenario, except possibly yours. (Hence why I upvoted it.) However, I did find a way to do what you are after...

Fake VSS backup

Basically what this does is fake a VSS backup on the volume that the Exchange database is on, which ends up causing Exchange to truncate the logs.

Breaks Incremental Backups

This will break any backup softwares incremental backup chain so the next real backup will have to be a full backup.

Use Passive Copies

In a DAG, do this on a passive copy if possible.

Procedure

You have to add both the drive/mount point for the database and the log.

  1. Open Command prompt as Admin
  2. Run diskshadow
  3. Type add volume x: (where "x" is the drive for the Exchange database)
  4. Type add volume y: (where "y" is the drive for the Exchange log)
  5. Type begin backup
  6. Type create. This will take a few minutes while VSS does its thing.
  7. Type end backup. This is where it will set the logs to truncate. You will have to wait for the next log to generate before it starts to happen.

At that point if you look in the Application eventvwr logs you should see an entry similar to:

Screenshot of event

(Or you can try PowerShell like so: Get-EventLog -LogName application -Source msexchangeis | select -first 10)

Hope that helps...

Sources

Citation: http://ilantz.com/2011/10/26/how-to-manually-purge-exchange-server-logs-clean-and-easy/


Use Windows Server Backup to backup the server. It will purge the Exchange Server transaction logs after a successful backup.

http://www.techrepublic.com/blog/datacenter/back-up-exchange-2010-with-this-windows-server-2008-r2-feature/3006

http://technet.microsoft.com/en-us/magazine/jj906377.aspx

Edit

You could try this to forego the backup route. It's a manual process, but it's probably safer than anything else, short of a backup:

http://exchangeshare.wordpress.com/2008/05/22/move-committed-exchange-transaction-logs/

EDIT: This tool doesn't seem to exist in Exchange Server 2010


In this scenario I would:

  1. Enable Circular Logging
  2. Dismount the store/DB to apply this change.
  3. Mount the store/DB this will take some time to sort out the logs.
  4. Disable Circular Logging.
  5. Dismount the store/DB to apply this change
  6. Mount the Store/DB.

Hope this helps,

Ross