dbspace space report
Posted in 1995
I was feeling generous after the user conference, so I thought I would throw out a report that I use for dbspace management. If you can make use of it, fine. Note: Notice that my dbspace naming conventions allow me to separate the dbspaces by function. This may or may not apply to you (e.g., all data dbspaces would be in one group, tmp dbspaces in another, and log dbspace in another. -------------------------------------Cut Here---------------------------------------- #H --------------------------------------------------------------------------- #H Motorola CSPD - Business Systems #H (c) Copyright Motorola Inc 1994-1995 #H Phoenix, Arizona #H All Rights Reserved #H --------------------------------------------------------------------------- #H Name: dbs.ace #H #H Type: Informix ACE #H #H Program Reference: DBA #H #H Purpose: Refer to Project Reference for details. #H #H Usage: sacego -s dba #H #H --------------------------------------------------------------------------- #H Prepared by : John M. Shoemaker #H Date : 04 Jun 1994 #H Baseline Date : 04 Jun 1994 #H Revisions: #H Name Date Project Reference #H ------------------------------ ----------- ------------------- #H John M. Shoemaker 10 Mar 1995 513 #H --------------------------------------------------------------------------- #H database sysmaster end define variable tot_space integer variable tot_free integer end output page length 51 end select name, (sum(chksize)*2) chks, (sum(nfree)*2) cfree from sysdbspaces, syschunks where sysdbspaces.dbsnum = syschunks.dbsnum group by name order by name[1,4], name end format page header print "YOUR COMPANY - GROUP NAME" print "DBA Report - Dbspace report" print "Effective Date: ", current print "All values in (k)" print print "DBSPACE NAME", column 20, "RESERVED SPACE", column 35, "USED SPACE", column 50, "FREE SPACE", column 68, "% USED" print "------------------", column 20, "--------------", column 35, "--------------", column 50, "--------------", column 68, "------" page trailer print print "Page: ", pageno using "<<<<", column 57, "DBA Report - Dbspace" on every row print name, column 20, chks using "###,###,##&", column 35, (chks-cfree) using "###,###,##&", column 50, cfree using "###,###,##&", column 68, ((chks-cfree)/chks)*100 using "##&.&", "%" after group of name[1,4] let tot_space = group total of chks let tot_free = group total of cfree print "------------------", column 20, "--------------", column 35, "--------------", column 50, "--------------", column 68, "------" print "Group Totals:", column 20, tot_space using "###,###,##&", column 35, (tot_space-tot_free) using "###,###,##&", column 50, tot_free using "###,###,##&", column 68, ((tot_space-tot_free)/tot_space)*100 using "##&.&", "%" skip 2 lines on last row skip 1 lines let tot_space = total of chks let tot_free = total of cfree print "------------------", column 20, "--------------", column 35, "--------------", column 50, "--------------", column 68, "------" print "Totals:", column 20, tot_space using "###,###,##&", column 35, (tot_space-tot_free) using "###,###,##&", column 50, tot_free using "###,###,##&", column 68, ((tot_space-tot_free)/tot_space)*100 using "##&.&", "%" end -------------------------------------Cut Here---------------------------------------- ------------------------------------------------------------------------------- . . | ... ... | John M. Shoemaker internet: rp2149@forte.sps.mot.com ..... ..... | Senior Software Engineer voice: (602) 244-6074 fax: 5898 .. ... .. | Business Integration Group pager: (602) 219-1679 . . . | Semiconductor Products Sector | 5005 E McDowell Road MD-E108 Motorola-SPS | Phoenix, AZ 85008 ------------------------------------------------------------------------------- EXEC SQL include "disclaimer.h" -------------------------------------------------------------------------------