文档介绍:DBA never sleep-DBA,永不眠
Focus on Oracle Database, GodenGate and Unix
[置顶] Oracle 数据库表空间容量调整(表空间缩容脚本)脚本
分类: Automatic Storage Management Oracle DBA Tools & Scripts 2013-05-31 19:18 308人阅读评论(0) 收
藏举报
Oracle 数据库表空间表空间缩容表空间扩容表空间容量调整
--1、获取需要释放空间的表空间信息(包含oracle database自有表空间)
--drop table ;
create table as select
,
"Sum_MB",
(-)/1024/1024 "used_MB",
"free_MB",
round(((-)/)*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 =    
order by ((-)/) desc;
--select * from order by "Sum_MB" desc,"free_MB" desc;
--2、获取需要释放空间的应用表空间数据文件使用情况
--drop table ;
create table as 
select ,
       ,
        / 1024 / 1024 total,
        / 1024 / 1024 free
  from dba_data_files a,
       (select file_id, sum(bytes) sum_free
          from dba_free_space
         group by file_id) b
 where =
   and in (select tablespace_name
                               from system.