728x90
Question
Reporting the total amount of disk space used for each database in an instance - How to find?
Answer
The query in the CODE section is used to allow the database administrator to use system catalog tables to find how much space is being used by each database in an instance.
The results are interpreted as follows:
- dbspace
- name of the dbspace
- name of the database
- total pages used for a database
- total pages used for both data and indexes
- total pages used for data
- total pages used for indexes
CODE
- DATABASE sysmaster;
SELECT s.name dbspace,
- n.dbsname database,
SUM(ti_nptotal) total,
SUM(ti_npused) used,
SUM(ti_npdata) data,
SUM(ti_npused) - SUM(ti_npdata) idx
WHERE i.ti_partnum = n.partnum
AND partdbsnum(i.ti_partnum)=s.dbsnum
GROUP BY 1,2
ORDER BY 1,2
SAMPLE OUTPUT
dbspace rootdbs930uc1
database central
total 680
used 449
data 263
idx 186
dbspace rootdbs930uc1
database client
total 664
used 447
data 262
idx 185
NOTE : The output values are in pages.
728x90
'Informix > informix reference' 카테고리의 다른 글
Collect database server's basic information (0) | 2011.11.20 |
---|---|
How to find out the temporary tables that are currently created (0) | 2011.11.20 |
Using the Informix System Catalogs (0) | 2011.11.20 |
Script to check permission and ownerships of Informix product. (0) | 2011.11.15 |
テーブルの現在および追加可能なエクステント数の取得について (0) | 2011.11.12 |