1、查看表文件大小语句:
查看当前登录用户创建的表大小:
select UT.table_name as "表名称", x.TABLE_SIZE as "表大小M" from user_tab_comments ut,
(select Segment_Name, Sum(bytes) / 1024 / 1024 as "TABLE_SIZE"
From User_Extents Group By Segment_Name) x
where ut.table_type = 'TABLE'and ut.table_name = x.Segment_Name(+) order by x.TABLE_SIZE desc nulls last
查看单个表大小:
SELECT SUM(BYTES)/ 1024 / 1024 as "表大小M" FROM DBA_EXTENTS WHERE SEGMENT_NAME = '大写表名称';
2、查看表的记录数:
查看当前登录用户创建的所有表的行数:
select t.table_name as "表名称",t.num_rows as "总行数" from user_tables t order by t.NUM_ROWS desc nulls last
查看单个表的行数:
select t.table_name as "表名称",t.num_rows as "总行数" from user_tables t where t.TABLE_NAME='大写表名称'