Site sponsored by: Idera The gold standard of SQL Server performance monitoring & diagnostics.
SQL Server Performance

  • Home
  • Articles
  • Forums
  • Tips
  • Quiz
  • FAQ's
  • Blogs
  • Software
  • Books
  • About Us
RSS Feeds
Sign in | Join


Article Topics

All Articles
Performance Tuning
Audit
Business Intelligence
Clustering
Reporting Services
Developer
General DBA
ASP.NET / ADO.NET

Write for Us

Share your SQL Server knowledge with others and raise your profile in the community More...
Latest Articles

Recover Data Using Database Snapshots
Analyze and Fix Index Fragmentation in SQL Server 2008
Powerful Geographical Visualisations made easy with SQL 2008 Spatial (Part 2) ...
Backup User Databases Using a Maintenance Plan

More     
 
Latest FAQ's

How to alter a User Defined Data Type?
How to unzip a File in SSIS?
How to view previous query plans?
ALTER TABLE SWITCH statement failed because the object '%.*ls' is not ...

More     
   
Latest Software Reviews

Spotlight on ApexSQL Doc 2008
ApexSQL Enforce
Embarcadero Change Manager
SQL Server DBA Dashboard

More     

articles >> general dba >> Centralized SQL Server 2000 Monitoring

Centralized SQL Server 2000 Monitoring

By : Chris Sheperd
Jan 16, 2007

Page 3 / 5

Central Disk Space Utilization Monitoring

This is a similar system to the one outlined in the part of this article, but for a different purpose. Earlier on in my current job, I’d occasionally be embarrassed by finding out too late in the day that a critical system was running low on drive space. People really lose confidence in you if you aren’t continually on top of your disk space management. It also helps greatly if you can warn people that servers are likely to run out of disk space and take preventative measures in advance of critical problems occurring.

If you are going to make predictions as to when drives will fill up, while also being able to assure yourself and your colleagues that your servers aren’t running out of disk, it can help to implement an automated system to collect drive space utilization information from your servers and locate it in a central place for alert generation and trend analysis.

Now, I expect people will write to me after this article is published and say “you can do this in Perfmon, you can do this using 3rd party software”, etc. Well that may be true. But I don’t like spending money on things I can do myself, and I believe my system has advantages over Perfmon’s logging and alerting mechanisms.

 

Enough of That, How Does It Work?

The system relies on the system extended stored procedure:

xp_fixeddrives

This SP exists in the master database and simply tells you disk free space for each drive in MB. My system runs from a central server. It executes xp_fixeddrives remotely on all the predefined target servers and stores the output in a table. This data can then be queried against a lookup table containing each server’s drive capacities. You need to maintain the capacity information manually, as xp_fixeddrives does not report capacity, just free space. So, for example, if you add disks to an array or change a drive’s capacity in any way, you must remember to manually change the capacity information you store in your lookup table. This is crucial because the key measure used in reporting is % free space, which needs the obviously requires the total capacity of a drive in order to be able to calculate the value.

Once again, I recommend that you locate all your tables and procedures in a central, dba/admin-type database. I use my centraldb database, the same one I used before.

 

The Tables

The master table is "Server" and is defined as:


CREATE TABLE [dbo].[Server] (
[ServerID] [int] IDENTITY (1, 1) NOT NULL ,
[Servername] [sysname] NOT NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Server] WITH NOCHECK ADD
PRIMARY KEY CLUSTERED
(
[ServerID]
) ON [PRIMARY]
GO



This has a one-to-many relationship to the lookup table "ServerDriveCapacity."


CREATE TABLE [dbo].[ServerDriveCapacity] (
[ServerID] [int] NOT NULL ,
[Drive] [char] (1) NOT NULL ,
[Capacity] [int] NOT NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[ServerDriveCapacity] WITH NOCHECK ADD
CONSTRAINT [pk_01] PRIMARY KEY CLUSTERED
(
[ServerID],
[Drive]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[ServerDriveCapacity] ADD
CONSTRAINT [fk_01] FOREIGN KEY
(
[ServerID]
) REFERENCES [dbo].[Server] (
[ServerID]
)
GO



And this table contains the static lookup data of drive letters and their capacities (all units are MB).

The table for holding the drive usage collected from xp_fixeddrives is called
ServerFreeSpaceHistory."


CREATE TABLE [dbo].[ServerFreeSpaceHistory] (
[ServerID] [int] NOT NULL ,
[Drive] [char] (1) NOT NULL ,
[FreeSpace] [int] NOT NULL ,
[CheckDate] [datetime] NOT NULL
) ON [PRIMARY]
GO

CREATE CLUSTERED INDEX [SFSH_01] ON [dbo].[ServerFreeSpaceHistory]([CheckDate]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[ServerFreeSpaceHistory] ADD
CONSTRAINT [DF__Serv__Check__59063A47] DEFAULT (getdate()) FOR [CheckDate]
GO

CREATE NONCLUSTERED INDEX [SFSH_02] ON [dbo].[ServerFreeSpaceHistory]([ServerID], [Drive]) ON [PRIMARY]
GO


<< Prev Page     Next Page>>    








Home | Peformance Articles | Audit Articles | Business Intelligence Articles | Clustering Articles | Developer Articles | Reporting Services Articles | DBA Articles | ASP.NET / ADO.NET Articles | DBA FAQ's | Developer Peformance FAQ's | DBA Peformance FAQ's | Developer FAQ's | Clustering FAQ's | Error Messages | Audit Tool Reviews | Backup Tool Reviews | Coding Tool Reviews | Compare Tool Reviews | Documentation Tool Reviews | Design Tool Reviews | Monitoring Tool Reviews | Log Tool Reviews | Reporting Tool Reviews | Clustering Tool Reviews | Security Tool Reviews | Change Management Tool Reviews | Remote Access Tool Reviews | Book Reviews | Security Tool Reviews | QDPMA Performance Tuning | ADO.NET / ASP.NET | Administration | Analysis/OLAP Services | Application Development | Configuration | Components | ETL | Hardware | High Availability | Hints | Index | Misc | Operating Systems | Performance Tuning | Replication | T-SQL | Views


              © 1999-2008 by T10 Media. All rights reserved