INF: Automatic Transaction Log Dumping via Performance Monitor

Last reviewed: April 3, 1997
Article ID: Q110565

The information in this article applies to:

  - Microsoft SQL Server version 4.2

SUMMARY

One of the features of SQL Server for Windows NT is its integration with the Windows NT Performance Monitor. The SQL Server for Windows NT "Configuration Guide" indicates that you can use the "% Full" counter of the SQLServer-Log object to dump or truncate the transaction log.

MORE INFORMATION

Below is an example of how to set up the event.

  1. Set up a text file called DUMP.SQL. This file will contain the TRANSACT-SQL commands to dump or truncate the log. For instance:

    dump tran pubs with truncate_only go

  2. Start Window NT's Performance Monitor and add an alert that will run the script through ISQL when the log is more than 75% full (or whatever threshold you think appropriate.)

  3. Make sure that SQL Server is running.

  4. Start Performance Monitor.

  5. Choose Alert from the View menu.

  6. Click on the + button to add an alert event.

  7. Choose the object SQLServer-Log.

  8. Choose the counter Log Space Used(%).

  9. Choose the instance of the database you wish to monitor--pubs in this example.

  10. Click on the Over button of the Alert if dialog, then enter the percentage at which you want the log to be truncated in the box to the right of this button. For instance, entering "75" will issue the truncate command when the log becomes more than 75% full.

  11. Enter the ISQL command under Run Program on Alert. The command should launch your DUMP.SQL file. For example:

    isql -Sserver -Usa -Ppassword -ic:\sql\dump.sql

  12. Click on the Every Time button so that the log will be truncated every time the percentage full exceeds the specified threshold.

  13. Click on OK.

NOTE: You can save these settings using the File, Save Alert Settings dialog so that you do not have to recreate this alert every time you start Windows NT.

NOTE: If you are using Integrated Security, Performance Monitor will need to be started under an administrator account or one that maps to the database's DBO.


Additional query words: 4.20 PERFMON Windows NT
Keywords : kbother SSrvAdmin
Version : 4.2
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 3, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.