how to figure out the size in MB for an informix database

This is the info i have so far. please if you are dead positive can u let me know if i my math/process is correct.

Chunks
address  chk/dbs offset   size     free     bpages   flags pathname
5003e1f8 1   1   0        250000   177177            PO-   /database/link_cw_p01_rootdbs
5003e494 2   2   256      250000   241891            PO-   /database/link_cw_p01_dbs1
5003e570 3   3   256      250000   159038            PO-   /database/link_cw_p01_dbs2
5003e64c 4   4   256      250000   49869             PO-   /database/link_cw_p01_ithdbs
 4 active, 2047 maximum

hostname: onstat -b

Informix Dynamic Server Version 7.30.UC5   -- On-Line -- Up 17 days 21:01:13 -- 429568 Kbytes

Buffers
address  userthread flgs pagenum  memaddr  nslots pgflgs xflgs owner    waitlist
 92 modified, 0 resident, 90000 total, 131072 hash buckets, 4096 buffer size

actual_size=((size-free)*4096)/1024

link_cw_p01_rootdbs=292mb
link_cw_p01_dbs1=325
link_cw_p01_ithdbs=801
link_cw_p01_cw_dbs2=364

Optimus,

I am not sure myself but I would not bet on 4096 as 'block size' for the chunks. Are you not using LVM where you could e.g. use lvdisplay (HP-UX) to determine the size of a logical volume? From there you could possibly make a link to the chunk sizes etc.

i beleave i understand yourstatement. I already have the size of the Logical Volume. I am trying to find out the actual size of the db space used. that way i can reduce the lv size acordingly.

the 4096 from what i was told is the size of each page in bytes. the colume for size and free are in pages. this is where i was getting my math from to figure out how big the actual dbspace is.

Hi Optimus,

I think, that it is not good idea to find solution in UNIX side, you can find SQL script for this:

database sysmaster;
select sum(nptotal) npt, sum(npused) npu
,dbsname dbn
from sysptnhdr h, sysptprof p
where h.partnum = p.partnum
-- and dbsname = "ert_refv211c"
and dbsname not like "sys%"
and dbsname not like "tmp%"
group by dbsname
into temp x;
select
npt,npu,dbn[1,9],
round (npt2/1024,2) mb_total,
round (npu
2/1024,2) mb_used
from x;
select round(sum(npt)*2/1024,2) mbt, round(sum(npu)*2/1024) mb_u from x;
drop table x;

Sincerely,
nailk

Optimus,

Your method is mostly correct, but I am not sure about your math!

acutal_size = free * 4096 = bytes

/ 1024 = Kbytes
/ 1024 = Mbytes
/ 1024 = GBytes.

Thats makes the total size of a chunk at 0.9gb

Free:

692mb
944mb
621mb
194mb

Do these numbers seem familiar? Plug them into a spread sheet for more accurate results.

Plus, be very careful when changing the disk allocations of logical volumes underneath Informix' nose. If you screw up, Informix won't like it and a level 0 archive/restore might not cut it either. Do a dbexport to disk or tape. It may take a while, and the restoration, with dbimport, may be a bit trickier with large tables. The benefit would be that the format (dbschema + unload files) is simple and does not rely on the underlying instance configuration on being exactly the same.

MBB.

thank you all for your suggestions. i am reading up on informix databases befor i actually do anything. In the end i might not have to reorginize anything.