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

怎麼監控oracle數據庫表和表空間

2022-06-13   來源: Oracle 

  怎麼監控oracle數據庫表和表空間的現狀

  declare

  unf number;

  unfb number;

  fs number;

  fsb number;

  fs number;

  fsb number;

  fs number;

  fsb number;

  fs number;

  fsb number;

  full number;

  fullb number;

  begin

  dbms_spacespace_usage(&

  &

  TABLE

  unf

  unfb

  fs

  fsb

  fs

  fsb

  fs

  fsb

  fs

  fsb

  full

  fullb);

  dbms_outputput_line(unformatted_blocks: || unf);

  dbms_outputput_line(full_blocks(% free): || full);

  dbms_outputput_line(fs_blocks(% free): || fs);

  dbms_outputput_line(fs_blocks(% free): || fs);

  dbms_outputput_line(fs_blocks(% free): || fs);

  dbms_outputput_line(fs_blocks(% free): || fs);

  end;

  /

   表空間的使用歷史記錄(只輸出了每天的第一次統計結果)

  select bname

  artime

  atablespace_usedsize

  atablespace_size

  round( * atablespace_usedsize / atablespace_size) used_percent

  from dba_hist_tbspc_space_usage a

  (select tname

  min(rtime) rtime

  min(tablespace_id) tablespace_id

  from dba_hist_tbspc_space_usage t

  inner join v$tablespace t on ttablespace_id = tTS#

  where tNAME = upper(&)

  group by name substr(rtime)

  ) b

  where atablespace_id = btablespace_id

  and artime = brtime

  order by artime;

   表的剩余空間預測

  select * from table(dbms_spaceOBJECT_GROWTH_TREND(ECC_CC YTKC_ORDERRELEVANCE TABLE)


From:http://tw.wingwit.com/Article/program/Oracle/201311/19053.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.