-----查看用户表所占用表空间 select OWNER, t.segment_name, t.segment_type, sum(t.bytes / 1024 / 1024) mmm from dba_segments t where /*t.owner = '你要查询的用户' */ /*and */t.segment_type='TABLE' group by OWNER, t.segment_name, t.segment_type order by mmm desc; -- 查看归档表空间使用情况 select trunc(first_time),count(*),round(sum(blocks*block_size)/1024/1024/1024,2) BLOCK5 from v$archived_log a where a.DEST_ID=1 group by trunc(first_time);
--查看还原空间使用情况(归档空间不足时查看) select t.object_name,bytes / 1024 / 1024/1024 as SIZE_M,t.original_name,t.operation,t.createtime,t.droptime from dba_recyclebin t join dba_segments t1 on t.object_name=t1.segment_name where t.owner='QR_USER' order by bytes desc; ; -- 查看表空间使用情况 select a.tablespace_name, a.bytes / 1024 / 1024 "Sum MB", (a.bytes - b.bytes) / 1024 / 1024 "used MB", b.bytes / 1024 / 1024 "free MB", round(((a.bytes - b.bytes) / a.bytes) * 100, 2) "percent_used" from (select tablespace_name, sum(bytes) bytes from dba_data_files group by tablespace_name) a, (select tablespace_name, sum(bytes) bytes, max(bytes) largest from dba_free_space group by tablespace_name) b where a.tablespace_name = b.tablespace_name order by ((a.bytes - b.bytes) / a.bytes) desc; -- 查看segment空间使用情况 SELECT segment_name, tablespace_name, r.status, (initial_extent / 1024) initialextent, (next_extent / 1024) nextextent, max_extents, v.curext curextent FROM dba_rollback_segs r, v$rollstat v WHERE r.segment_id = v.usn(+) ORDER BY segment_name;
标签:1024,name,dba,sql,bytes,tablespace,归档,oracle,segment From: https://www.cnblogs.com/qsds/p/17028253.html