如何查看达梦数据库各个表的大小
1、创建一个表来存各表的大小
create table table_count (owner varchar(100),table_name varchar(100),used_space_MB varchar(100));
2、执行语句块,查出各表的大小,存进table_count这个表里。
declare
begin
for rec in
(
select owner, table_name from all_tables order by 1, 2
)
loop
insert into table_count
select
rec.owner ,
rec.table_name,
table_used_pages(rec.owner, rec.table_name)*(page()/1024)/1024
from
dual;
end loop;
end;
3、查询表table_count的信息,根据需求排序,就能看到各表的大小
select * from table_count order by used_space_mb desc;