神通数据库查询某个模式下所有表的大小

业务场景:
有一天正常巡检发现数据库数据量在成倍增长。按道理,我的业务量,数据不可能会这么疯狂的增量。所以想看看到底是啥数据占用了这么多空间。检查发现有张表里写了文件导致的。

下面是具体sql。

SELECT TMP.NSPNAME AS "Sechma", TMP.RELNAME, SUM(TMP.SIZE) / 1024 /1024 AS "Size(M)" FROM (SELECT N.NSPNAME, C.RELNAME,c.RELKIND, S.SIZE FROM V_SEGMENT_INFO S, SYS_CLASS C, SYS_NAMESPACE N WHERE S.RELID = C.OID AND C.RELNAMESPACE = N.OID) TMP WHERE (TMP.NSPNAME='SYSDBA') and TMP.RELKIND ='r' GROUP BY TMP.NSPNAME, TMP.RELNAME;

# 搞定,收工!!!

# 打卡,下班!!!

Author

wandan

Posted on

2024-06-26

Updated on

2024-06-26

Licensed under

You need to set install_url to use ShareThis. Please set it in _config.yml.
You forgot to set the business or currency_code for Paypal. Please set it in _config.yml.

Comments

You forgot to set the shortname for Disqus. Please set it in _config.yml.
You need to set client_id and slot_id to show this AD unit. Please set it in _config.yml.