Measuring Informix Disk Usage, extents and dbspaces
Posted in 2000
Topics: High Availability & Replication, Storage & Space Management, SQL Development & Query Writing, Connectivity: ODBC / JDBC / .NET
Hi all....
We're running Informix Dynamic Server 9.20uc2, with custom datablades and
the ESRI SDE datablade.
We have a database/instance that is expected to grow to nearly 800GB within
2 years, today it has about 20GB of data, although more than 300GB of disk
has been allocated by way of extent sizes for tables etc. The instance has
over 150 DBspaces and the database has some 2000 or more tables and indexes
(taking into account the user database, sysmaster, sysutils, sde).
I need an effective tool for measuring disk usage and growth. Onstat -d is
not good enough as it will report that 300GB of disk has been allocated and
50GB of that is free or unallocated space, it has no way of telling me that
although this much disk has been allocated only 20GB of it is in use. Using
oncheck is not an option, there is no easily automated way to go through the
output and pickup the right information. However it is a clue because it
does tell you the number of datapages allocated and used by table.
Utilising this information, I developed the following SQL and have run it
out of EXCEL via ODBC. This is great and I've been able to almost model what
I need. It can tell me that for a given table the next extent allocation is
unable to fit into a dbspace (WARNING) that only 1% of the allocated extent
space is in use or that 90% is in use. If this information is then able to
be combined with "history" you would be able to predict table growth, when
to add additional disk chunks etc. or how has my database grown over the
last 6 months, where have I added space, where might I need to add space?
The Spreadsheet is a good tool, however it only as at a point in time.
[SQL START]
select current as DATE_TIME,
dbinfo( "DBSPACE" , pe_partnum ) as dbspace,
dbsname as database,
stn.tabname as tabname,
stn.partnum as tblpartnum,
count(*) as num_extents,
sum( pe_size ) * 2048 / 1000000 as size_mb,
p.rowsize,
p.nextns,
p.fextsiz,
p.nextsiz,
p.nptotal,
p.npused,
p.npdata,
p.nrows
from sysmaster:systabnames stn, sysmaster:sysptnext sptn,sysmaster:sysptnhdr p
where stn.partnum = p.partnum and
stn.partnum = sptn.pe_partnum
group by 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15;
[SQL END]
I might be forced to build an MS ACCESS database or Informix database to
store all this information. The SQL could run daily or weekly and charts
could eaily be produced that would provide the right level of detail for
both the Database Administrator and the Client Exec who says "prove to me
you need to buy more disk".
So the question is, do I have to build a tool, or does one exist that I can
purchase?
- David