Recipe6.14.Turning on Circular Logging for a Storage Group


Recipe 6.14. Turning on Circular Logging for a Storage Group

Problem

You wish to enable circular logging for your Exchange Server transaction logs.

Solution

Using a graphical user interface

  1. Launch the Exchange System Manager (Exchange System Manager.msc).

  2. In the left pane, expand the appropriate Administrative Groups container, and then expand the Servers container.

  3. Expand the server that contains the target SG.

  4. Right-click the storage group and select Properties.

  5. Check the box labeled Enable Circular Logging.

  6. Click OK.

Using VBScript
' This code toggles circular logging for a storage group. ' ------ SCRIPT CONFIGURATION ------  strServerName = "<SERVERNAME>"    ' e.g., "BATMAN"   ' ------ END CONFIGURATION --------- Set theServer = CreateObject("CDOEXM.ExchangeServer") Set theSG = CreateObject("CDOEXM.StorageGroup") theServer.DataSource.Open strServerName arrSG = theServer.StorageGroups theFirstSG = arrSG(0) strURL = "LDAP://" & theServer.DirectoryServer & "/" & theFirstSG theSG.DataSource.Open strURL If (True = theSG.CircularLogging) Then     wscript.echo "Circular logging is enabled; disabling it"     theSG.CircularLogging = false Else     wscript.echo "Circular logging is disabled; enabling it"     theSG.CircularLogging = true End If theSG.DataSource.Save WScript.echo "Circular logging is now " & theSG.CircularLogging & " on SG " & theFirstSG

Discussion

Since a new log file is created whenever the current one fills up, log files can potentially take up a large amount of space on your disk. One solution is to put them on a dedicated disk set; another is to enable circular logging. Normally, every log file is kept until its transactions have been committed; the files are usually purged when online backups are made. When you enable circular logging, Exchange will keep a fixed number of log files, rolling from one to another as transactions arrive. The default number is four, but Exchange may use extra log files if a large set of transactions arrives. As the fourth log file fills up, Exchange will commit transactions from the first file; when the fourth file is completely full, all transactions will be flushed from the first file and it will be reused. However, since these additional log files are never deleted, a very busy server can still use more than the default 25 MB circular logging allocation.

Since circular logging overwrites transaction logs, it can be useful as a temporary space-saving measure on a drive or array that is running out of space. However, the cost is that since a full set of transaction logs don't exist, up-to-the-minute log playback is not available in the case of media failure. I don't recommend using circular logging on mailbox servers; however, on front-end, public folder replica, or SMTP servers, it's often a sensible way to cap the amount of disk space used by those servers (recall that the SMTP service requires a mounted mailbox store to send NDRs for failed messages).

Toggling circular logging is easy, since it's controlled by a single attribute on the SG. All the script does is set this attribute, then use the Save method to persist the change, which takes place immediately.

See Also

MS KB 147524 (How Circular Logging Affects the Use of Transaction Logs) and MS KB 258470 (XADM: How to Modify the Circular Logging Setting)



Exchange Server Cookbook
Exchange Server Cookbook: For Exchange Server 2003 and Exchange 2000 Server
ISBN: 0596007175
EAN: 2147483647
Year: 2006
Pages: 235

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net