在Informix中与sysmaster用户连接时,是否存在查询以获取表列表及其对应的最大大小和特定数据库的大小?
当我连接到对应的数据库时,我只能得到给定表的大小,但事实并非如此。当我仅与sysmaster用户连接时,我希望能够获得表的最大大小和大小。是否还有另一个管理员用户/数据库可以从Informix中的所有数据库访问所有表信息?
答案 0 :(得分:1)
尝试一下:
select tn.partnum, tn.dbsname, tn.owner, tn.tabname
, pt.lockid, pt.flags, pt.flags2
, pt.rowsize, pt.ncols, pt.pagesize
, dbinfo('utc_to_datetime',pt.created) as created
, pt.nrows, pt.nptotal, pt.npused, pt.npdata
, pt.nrows * pt.rowsize as tamanho_bytes
, (pt.nptotal * pt.pagesize) /1024 as total_kb
, (pt.npused * pt.pagesize) /1024 as used_kb
, (pt.npdata * pt.pagesize) /1024 as data_kb
, ((pt.nptotal - pt.npused) * pt.pagesize) /1024 as free_kb
, pt.nextns as extents
, pt.ninserts
, pt.nupdates
, pt.ndeletes
, coalesce(pt.serialv,pt.cur_serial8,pt.cur_bigserial)::bigint serial
, pta_oldvers
, pta_newvers
from sysmaster:sysptnhdr pt
left join sysmaster:systabnames tn on tn.partnum = pt.partnum
TBLspaces也被列出,碎片表被分开显示,您可以在其中按lockid列(〜partnum)进行分组。