How To Remove Exchange Server 2010 Transaction Log Files
- How To Remove Exchange Server 2010 Transaction Log Files List
- How To Remove Exchange Server 2010 Transaction Log Files
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:
- Enable
circular logging
. This is not desirable for some of the test scenarios, as it may conflict with properly emulating a specific environment. - Dismount all databases and run
eseutil /mh
. This works, but it's a cumbersome maintenance process. - 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?
DELETE OLD TRANSACTION LOG FILES IN EXCHANGE 2010 Hi, As the first post, I would like to share the world on how to delete the old transaction logs in an Exchange Server. Before starting, one should understand what transaction logs are. The transaction logs simply are logs of what all activities an Exchange Server has. How to manually remove Exchange Server Log Files It is well known that Exchange Server transaction logs keeps the full record of the performed changes in the Exchange Server database, and these log files should be periodically removed from the hard disk because these log files gather or acquire all the available free disk space. For instance: when sending a email message, firstly, it is recorded in the transaction log. Before the transaction is transferred to the Exchange database, these data exist only in the system memory and transaction logs. In case of a failure, the system memory is lost, and all you have is the transaction logs.
TohuwTohuw4 Answers
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...
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.
- Open Command prompt as Admin
- Run
diskshadow
- Type
add volume x:
(where 'x' is the drive for the Exchange database) - Type
add volume y:
(where 'y' is the drive for the Exchange log) - Type
begin backup
- Type
create
. This will take a few minutes while VSS does its thing. - 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:
(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/
TohuwUse Windows Server Backup to backup the server. It will purge the Exchange Server transaction logs after a successful backup.
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:
EDIT: This tool doesn't seem to exist in Exchange Server 2010
joeqwertyjoeqwertyIn this scenario I would:
- Enable
Circular Logging
- Dismount the store/DB to apply this change.
- Mount the store/DB this will take some time to sort out the logs.
- Disable
Circular Logging
. - Dismount the store/DB to apply this change
- Mount the Store/DB.
How To Remove Exchange Server 2010 Transaction Log Files List
Hope this helps,
Ross
(Adding a new answer because I don't have a high enough reputation to add comments to @TheCleaners existing answer)
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.
- Open Command prompt as Admin
- Run
diskshadow
- Type
add volume x:
(where 'x' is the drive for the Exchange database) - Type
add volume y:
(where 'y' is the drive for the Exchange log) - Type
begin backup
- Type
create
. This will take a few minutes while VSS does its thing. - 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.