Re: Calculate database space
Posted in 1999
Topics: Storage & Space Management, Data Types & Schema Design, Jobs, Consulting & Announcements
> Assuming you wish to calc size of existing dbs, try this. Result is in > pages. > "select sum(size) from sysextents where dbsname = "database name" > Gary, this script gives you size of ALL extents,no matter are they empty or not. To calculate the size of the database you need sum of the index extents plus number_of_rows*row_size for each table. Remember, that when you calculate the rows with VARCHAR columns, you know only the max_row_size. So, you can calculate database size only with some precision. -- With best regards, Yuri Dovgart, SAP R/3, Informix consultant, "Telecominvest" company. E-mail y_dovgart@tci.ukrtel.net Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.
Using 7.x?
If so , then try this:
database sysmaster;select sum(nptotal), sum(npused)
from sysptnhdr h, sysptprof p
where h.partnum = p.partnum
and dbsname = "inv_acct"
This SQL gives the total number of pages allocated and the total number
of pages actually used.
John Carlson
Informix DBA
WHSmith USA
Yuri Dovgart wrote:
>
> > Assuming you wish to calc size of existing dbs, try this. Result is in
> > pages.
> > "select sum(size) from sysextents where dbsname = "database name"
> >
>
> Gary, this script gives you size of ALL extents,no matter are they
> empty or not. To calculate the size of the database you need sum of the
> index extents plus number_of_rows*row_size for each table. Remember,
> that when you calculate the rows with VARCHAR columns, you know only
> the max_row_size. So, you can calculate database size only with some
> precision.
>
> --
> With best regards, Yuri Dovgart,
> SAP R/3, Informix consultant,
> "Telecominvest" company.
> E-mail y_dovgart@tci.ukrtel.net
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.