Solved

Automatically start and stop the enable circular logging option

Posted on 2010-09-03
9
889 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Are end users causing IT problems again?

You’ve taken the time to design and update all your end user’s email signatures, only to find out they’re messing up the HTML, changing the font and ruining the imagery. What can you do to prevent this? Find out how you can save your signatures from end users today.

Question has a verified solution.

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

Suggested Solutions

Find out what you should include to make the best professional email signature for your organization.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we show how to create an Accepted Domain 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 >> Ac…
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…

920 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

14 Experts available now in Live!

Get 1:1 Help Now