熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

顯示表空間的使用情況的SQL語句

2013-11-13 16:19:09  來源: Oracle 

  col tsname format a justify c heading Tablespace
  col nfrags format justify c heading Free|Frags
  col mxfrag format justify c heading Largest|Frag (KB)
  col totsiz format justify c heading Total|(KB)
  col avasiz format justify c heading Available|(KB)
  col pctusd format justify c heading Pct|Used
  select
  totaltablespace_name tsname
  count(freebytes) nfrags
  nvl(max(freebytes)/) mxfrag
  totalbytes/ totsiz
  nvl(sum(freebytes)/) avasiz
  (nvl(sum(freebytes))/totalbytes)* pctusd
  from
  dba_data_files total
  dba_free_space free
  where
  totaltablespace_name = freetablespace_name(+)
  group by
  totaltablespace_name
  totalbytes;
From:http://tw.wingwit.com/Article/program/Oracle/201311/18135.html
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.