Hi,
I have written a query to find Total, Used and Free Space in all chunks.
All the columns in query are fetched from syschunks and sysdbspaces tables from sysmaster database.
I know onstat -d will show Total and Free Space Details.
But I would like to see Total, Used and Free Space in KB, MB and GB format.
That is why I have written my own query using SMI tables.
Default Page Size in Linux is - 2k
Default Page Size in Windows is - 4k
In Windows default installation we will get 8k page size dbspace automatically for datadbs and tmpdbspace.
Example:
Dbspaces
address number flags fchunk nchunks pgsize flags owner name
0000000080E0A9A0 7 0x20001 7 1 8192 N BA informix data8dbs1
0000000080E0ABF0 8 0x20001 8 1 8192 N BA informix data8dbs2
00000000825A5030 9 0x20001 9 1 8192 N BA informix data8dbs3
00000000825A5280 10 0x2001 10 2 8192 N TBA informix tmpdbspace
I am facing some difference in value between onstat -d, oncheck -ce and syschunks table values
for 8k page size dbspaces and chunks.
- onstat -d and oncheck -ce command shows same value.
- But in syschunks table it is showing double of that value.
- Please find the details below and kindly let me know why this difference is there.
Results From onstat -d Command:
Dbspaces
address number flags fchunk nchunks pgsize flags owner name
0000000080E0A9A0 7 0x20001 7 1 8192 N BA informix data8dbs1
0000000080E0ABF0 8 0x20001 8 1 8192 N BA informix data8dbs2
00000000825A5030 9 0x20001 9 1 8192 N BA informix data8dbs3
Chunks
address chunk/dbs offset size free bpages flags pathname
00000000825AB030 7 7 0 8192 8139 PO-BED D:\Informix\storage\ol_informix1210_1_data8dbs1_p_1
00000000825AC030 8 8 0 8192 8139 PO-BED D:\Informix\storage\ol_informix1210_1_data8dbs2_p_1
00000000825AD030 9 9 0 8192 8139 PO-BED D:\Informix\storage\ol_informix1210_1_data8dbs3_p_1
Results From oncheck -ce Command:
Validating extents for Space 'data8dbs1' ...
Chunk Pathname Pagesize(k) Size(p) Used(p) Free(p)
7 D:\Informix\storage\ol_informix1210_1_data8dbs1_p_1 8 8192 53 8139
Validating extents for Space 'data8dbs2' ...
Chunk Pathname Pagesize(k) Size(p) Used(p) Free(p)
8 D:\Informix\storage\ol_informix1210_1_data8dbs2_p_1 8 8192 53 8139
Validating extents for Space 'data8dbs3' ...
Chunk Pathname Pagesize(k) Size(p) Used(p) Free(p)
9 D:\Informix\storage\ol_informix1210_1_data8dbs3_p_1 8 8192 53 8139
Results From syschunks Table:
chknum 7
dbsnum 7
nxchknum 0
pagesize 8192
chksize 16384
offset 0
nfree 16278
mdsize -1
udsize -1
udfree -1
is_offline 0
is_recovering 0
is_blobchunk 0
is_sbchunk 0
is_inconsistent 0
is_extendable 1
flags 139332
fname D:\Informix\storage\ol_informix1210_1_data8dbs1_p_1
mfname
moffset
mis_offline 0
mis_recovering 0
mflags
-------------------------------------------------------------------------
chknum 8
dbsnum 8
nxchknum 0
pagesize 8192
chksize 16384
offset 0
nfree 16278
mdsize -1
udsize -1
udfree -1
is_offline 0
is_recovering 0
is_blobchunk 0
is_sbchunk 0
is_inconsistent 0
is_extendable 1
flags 139332
fname D:\Informix\storage\ol_informix1210_1_data8dbs2_p_1
mfname
moffset
mis_offline 0
mis_recovering 0
mflags
--------------------------------------------------------------------------------
chknum 9
dbsnum 9
nxchknum 0
pagesize 8192
chksize 16384
offset 0
nfree 16278
mdsize -1
udsize -1
udfree -1
is_offline 0
is_recovering 0
is_blobchunk 0
is_sbchunk 0
is_inconsistent 0
is_extendable 1
flags 139332
fname D:\Informix\storage\ol_informix1210_1_data8dbs3_p_1
mfname
moffset
mis_offline 0
mis_recovering 0
mflags
------------------------------
SHANGEETHA T
------------------------------
#Informix