Re: How to retrieve DBSPACE where a database is stored?
Posted in 2003
Brice Avila wrote:
> Would "oncheck -pe" help you with this? You can parse the output and
> see how much space your database or table is using. Hope this
> information helps.
>
> Brice Avila
> Minneapolis, Minnesota
>
> Rupan3rd <rupan.nospam.3rd@hotmail.com> wrote in
> message news:<3EED8501.801@hotmail.com>...
>> Hi there!
>>
>> How can I query SYSMASTER (or SYSUTILS?) database in
>> order to retrieve
>> the information about what DBSPACE is containing my application's
>> database? And also, what CHUNKS do compose a DBSPACE and how much
>> are they filled of data?
>>
>> My aim is to make a script to control space available in the dbspace
> etc..
To see how much is free in the dbspace try this query:
select name dbspace,sum(chksize) size_in_pages,
round(((sum(chksize-nfree)/sum(chksize))*100),2) percent_used from
sysmaster:'informix'.sysdbspaces t1, sysmaster:'informix'.syschunks
t2 where t1.dbsnum = t2.dbsnum group by 1 having
round(((sum(chksize-nfree)/sum(chksize))*100),2)>=0;
To see how much chunk is having free space try this query:
select t2.fname device , t2.nfree free_pages ,
round((t2.nfree/t2.chksize)*100,2) free_percentage , t1.name dbspace
from sysmaster:'informix'.sysdbspaces t1,
sysmaster:'informix'.syschunks t2
where t1.dbsnum =t2.dbsnum and round((t2.nfree/t2.chksize)*100,2)
>=0 order by free_percentage desc
--Ganesan subramanian
--
Direct access to this group with http://web2news.com
http://web2news.com/?comp.databases.informix
To contact in private, remove nno3sppa+8mm