Solved

Automatically start and stop the enable circular logging option

Posted on 2010-09-03
9
886 Views
Last Modified: 2012-05-10
We are currently archiving mailboxes to the EMC SourceOne archive. Because of this activity the Exchange log files are growing fast. Therefore I want to know if there is a method to enable the circular logging when we start with the archiving activity and disable it when the archiving activity is finished.
0
Comment
Question by:hgeurts
9 Comments
 
LVL 1

Accepted Solution

by:
kurianti earned 500 total points
ID: 33594661
Hi,

You can enable (and disable) circular logging with the set-storagegroup cmdlet. Database needs to be dismounted before. So basically:

Dismount-Database -Identity ExchangeServer1.Contoso.com\MyDatabase -Confirm:$false
Set-StorageGroup -Identity "Storage Group Name" -CircularLoggingEnabled $True
Mount-Database -Identity ExchangeServer1.Contoso.com\MyDatabase -Confirm:$false

save it as .ps1 file and run before archiving activity. To schedule, use syntax:
PowerShell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\Bin\ExShell.Psc1" -Command ". '<Path to Your Script>'"

After the archiving, You can disable the logging:

Dismount-Database -Identity ExchangeServer1.Contoso.com\MyDatabase -Confirm:$false
Set-StorageGroup -Identity "Storage Group Name" -CircularLoggingEnabled $False
Mount-Database -Identity ExchangeServer1.Contoso.com\MyDatabase -Confirm:$false

Scripting with Exchange Management Shell:
http://technet.microsoft.com/en-us/library/bb123798%28EXCHG.80%29.aspx
How to Enable or Disable Circular Logging for a Storage Group:
http://technet.microsoft.com/en-us/library/bb331968%28EXCHG.80%29.aspx

Good luck,

Andreas
0
 

Author Comment

by:hgeurts
ID: 33594694
Thanks for the info.
But for us f there is no need to dismount the databases, I do not want the disks where the logfiles are stored to grow to large and therefore causing the storage groups from becoming dismounted.
Instead of enabling them manually, I just want to schedule this automatically. Isn't this possible via the scheduled tasks in windows. or via powershell?


0
 
LVL 9

Expert Comment

by:MinoDC
ID: 33594794
0
 
LVL 1

Expert Comment

by:kurianti
ID: 33594899
You have to dismount and mount back the database every time the circular logging option is changed.
And You can use scheduled tasks to do it automatically. Example:

save the following three cmdlets as "c:\folder\enable_circular_logging.ps1" and schedule it in Windows before the archiving by executing PowerShell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\Bin\ExShell.Psc1" -Command ". 'c:\folder\enable_circular_logging.ps1'"

Dismount-Database -Identity ExchangeServer1.Contoso.com\MyDatabase -Confirm:$false
Set-StorageGroup -Identity "Storage Group Name" -CircularLoggingEnabled $True
Mount-Database -Identity ExchangeServer1.Contoso.com\MyDatabase -Confirm:$false

This will enable circular logging on the database in SG. After the archiving, You can disable circular logging by scheduling the following, saved as c:\folder\disable_circular_logging.ps1:

Dismount-Database -Identity ExchangeServer1.Contoso.com\MyDatabase -Confirm:$false
Set-StorageGroup -Identity "Storage Group Name" -CircularLoggingEnabled $False
Mount-Database -Identity ExchangeServer1.Contoso.com\MyDatabase -Confirm:$false

How to use Schtasks.exe to Schedule Tasks in Windows Server 2003:
http://support.microsoft.com/kb/814596

Best,
Andreas
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 7

Expert Comment

by:firemanf29
ID: 33604960
With most realtime archiving systems you move to circular logging and stay that way.  Moving back and forth daily would make your log files "unstable".
0
 

Author Comment

by:hgeurts
ID: 33609403
We only want to start the archiving activities on Saturday, so it is only neccessary to enable circular logging during the period the archive activities are running.
Do I really need to dismount the database then before I start the circular logging?
0
 
LVL 1

Expert Comment

by:kurianti
ID: 33610496
Yes, You need to dismount/mount database or restart Information Store for the circular logging to take effect. "To make your changes to the circular logging settings effective, restart the Microsoft Exchange Information Store service, or dismount and then mount all of the databases in the storage group." in the mentioned TechNet article "How to Enable or Disable Circular Logging for a Storage Group" available in http://technet.microsoft.com/en-us/library/bb331968%28EXCHG.80%29.aspx

Best,
Andreas
0
 
LVL 74

Expert Comment

by:Glen Knight
ID: 34740736
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Easy CSR creation in Exchange 2007,2010 and 2013
Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
In this video we show how to create a Distribution Group in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >>…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now