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

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

2022-06-13   來源: 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-2022 電腦知識網 Computer Knowledge   All rights reserved.