以下是一些可能有用的查询:
SELECT TRUNC(partnum/16777216) dbspace,
COUNT(*) tables, SUM(nrows) tot_rows,
SUM(nrows*rowsize) bytes
FROM systables
WHERE tabtype = 'T'
GROUP BY 1
ORDER BY 1;
如果将 "dbspaces" 表添加到数据库中,并使用从 tbstat -D 输出中获取的 dbspace 名称加载它,就像我所做的那样,则可以使用:
SELECT dbs_name[1,12] dbspace,
COUNT(*) tables, SUM(nrows) tot_rows,
SUM(nrows*rowsize) bytes
FROM systables, dbspaces
WHERE tabtype = 'T'
AND dbs_no = trunc(partnum/16777216)
GROUP BY 1
ORDER BY 1;
示例输出:
dbspace tables tot_rows bytes
mcs_aaaaa 28 51 3715
mcs_catalog 22 2695 114810
mcs_eeeee 25 224 45446
mcs_fffff 32 1412 201445
mcs_mmmmm 35 165 262599
mcs_wwwww 28 449 79385
("bytes" is data bytes, and does not include indexes and other overhead.)
我通过以下方式将mcs系统目录文件与数据表分开:在mcs_catalog中创建数据库mcs;
我通过以下方式在其他五个数据库空间中创建了数据表:
create table whatever ( ... ) in mcs_xxxxx;
除了获取dbspace号码的技巧,这都是非常简单的东西。但是,我希望我的帖子可以节省一些时间。




