Sybase free space reporting script


This script checks the free space in each segment of a Sybase database. The script creates a table called free_space_per_segment in ech monitored database and reports from it. The script can easily be modified to store these data in another table. (This is left as an excersize to the reader :-)


Most of these can be found somewhere at

The setup

Version 1.4, February 11th 1998 is a Perl script that performs a query on the table and plots some graphs. Apart from the filenames, if tried to make it platform independent... A simple lineair extrapolation is done (based on the last two points) to calculate when a dataset will reach the 100%. This will not generate a exact value, but it will give you an idea of how fast your database is growing..
Under normal circumstances, only the variables in the start should have to be edited to get this script working on your site.



$daysNumber of days to report in graph (default = 21)
$warningdaysMaximum number of days that will be warned for
$outputdirThe directory where both the HTML file and the GIF files will be created. Notice that a Windows NT UNC path is in the form \\server\share. Because backslashes are special in Perl you'll have to fill in a value like "\\\\server\\share" (when using double quotes)
$outputrootfileThe name of the HTML file (use index.html when you don't have something better)
$graphsperlineThe number of graphs to put next to each other. Fill in a value that does not make you have to scroll horizontl (2 on my screen)
%serversA hash that contains information about the servers you want to report to. In fact it is a hash of hashes (see the perlol manpage for explanantion). Each hash contains information about one server:



usernameA valid login for this server that is mapped to valid users in each database to monitor. Note: this user must be able to create the table free_space_per_segment in each database
passwordThe password
databasesA anonymous array containing the names of the databases to monitor
If this is not clear: just look at the example values and change them for your site. Take care about the existing punctuation! (values end with a comma) All values are case-sensitive


The usual disclaimers apply: Use at your own risk. I am not responsible for any results you may encounter by using these scripts. The scripts will have to be changed (a little) to work in your environment. The extrapolation and warnings generated are not based on solid statictics or something like that an should be considered as a reminder for the DBA, not something to rely on. These scripts are released as freeware. Learn, use steal in any way you like it. I would appreaciate comments (succes stories or bug reports or fanmail :-).

The output

This is how the output looks... (if you noticed that the SYBASE_PROD resembles the SYBASE_DEV you're right: I loaded a copy of the production environment into the development environment just that afternoon :-)

To do

Some things that I want to improve on these scripts:

go to main homepage of Reinoud
Mail your comments to
Last updated on Feb 17th, 1998