Copyright © 2005 - 2019 Yohz Software, a division of Yohz Ventures Sdn Bhd. ALL RIGHTS RESERVED.
All trademarks or registered trademarks are property of their respective owners
SQL Size script:
raise alert if path has < 250 MB free space
Details:
Use this script when you want to ensure that none of the paths on your instance have less than 250 megabytes of free
space.
Sample alert:
Code:
procedure Main;
var
APath: TPath; // store a path reference
FreeSpace: Integer; // store the free space value
f: Integer; // loop variable
begin
for f := 0 to Instance.PathCount - 1 do
begin
APath := Instance.Path(f); // get a reference to each path in the loop
FreeSpace := APath.FreeSpace; // get the available space for the path
if FreeSpace < (250 * MB) then // check if free space is < 250 MB
begin
RaiseAlert('The path (' + APath.Name + ') has less than 250 MB of free space
(' + FormatBytes(FreeSpace) + ')', Instance);
end;
end;
end;
Walk-through:
In the main code block, loop through each path on the current instance.
for f := 0 to Instance.PathCount - 1 do
begin
...
end;
We get a reference to each path.
APath := Instance.Path(f);
We get the free space for the current path.
FreeSpace := APath.FreeSpace; // get the available space for the path
Check if the free space is less than 250 MB.
if FreeSpace < (250 * MB) then // check if free space is < 250 MB
begin
...
end;
If it is, raise an alert, and also show the available free space for that path.
RaiseAlert('The path (' + APath.Name + ') has less than 250 MB of free space (' +
FormatBytes(FreeSpace) + ')', Instance);
•
analyse database growth easily using charts and graphs
•
raise alerts when database growth exceed expectations
•
identify the largest and fastest growing data files quickly
•
have growth reports sent to you daily via email
•
supports SQL Server 2005 and newer versions
Analyse SQL Server database
and table growth using
SQL Size