Tablespace Space Script

oracle_ace發表於2008-05-27
The Script. to Query the Status of Tablespace:
--------------------------------------------------------------
select d.tp_name "tbs_name",e.contents "type",e.status "status", e.extent_management "seg_m",
       b.bytes "size(M)",  b.bytes-d.bytes "used(M)", d.bytes "free(M)", round((b.bytes-d.bytes)*100/b.bytes,2) "used_per"
   from (select c.tablespace_name tp_name,round(sum(c.bytes)/1024/1024,2) bytes
         from dba_free_space c
         group by c.tablespace_name) d,
  (select a.tablespace_name tp_name,round(sum(a.bytes)/1024/1024) bytes
 from dba_data_files a
 group by a.tablespace_name) b,
    (select tablespace_name tp_name,contents,status,extent_management
   from dba_tablespaces ) e
   where d.tp_name=b.tp_name and d.tp_name=e.tp_name
order by 1;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12361284/viewspace-312613/,如需轉載,請註明出處,否則將追究法律責任。

相關文章