SQL查询数据库所有表的数据量及占用空间大小
程序员文章站
2024-03-21 14:23:22
...
/*查询数据库所有表的数据量及占用空间大小*/
SELECT t.table_name AS "数据库表名"
,t.num_rows AS "行数"
,round((nvl(t.num_rows,0) * nvl(t.avg_row_len,0)) / 1024 / 1024,2) || ' M' AS "占用空间"
,to_char(SYSDATE, 'yyyy-mm-dd hh24:mi:ss') AS "创建时间"
FROM user_tables t
WHERE 1 = 1
AND nvl(t.num_rows, 0) <> 0
ORDER BY (nvl(t.num_rows,0) * nvl(t.avg_row_len,0)) DESC;
上一篇: windows 更改cmd 编码
下一篇: CentOS7安装telnet服务