Solved

Automatically start and stop the enable circular logging option

Posted on 2010-09-03
9
897 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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
 
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
In this video we show how to create an email address policy 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 Mail Flow…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

738 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