Saturday, March 01, 2008

Monitoring SQL Server on the cheap

Use WMI with Python. Thanks to Tim Golden, Python on Win32 (I use ActiveState Python) can use COM to talk to WMI. WMI allows you to run SQL-like queries to determine available memory, free disk space, database size, transaction log size, transaction log space available, when a database was last backed up, ... all of the good stuff.

Any DBA knows that databases need free disk space and frequent backups. I don't want to imply that this is the only work a DBA would perform, but I have worked at shops where there really wasn't a DBA in our department. My programs occasionally failed because there was no disk space, and the transaction logs had not been backed up for a few weeks (sure, the database was backed up, but not the logs).

If you don't want to use WMI, SqlServerCentral has some great articles for SQL 2000 and 2005. Give them time and they will have 2008 as well. If you want to to check a backup, try this.

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link

<< Home