休み明け

忙しいですねぇ。

その反面、頼んでいるベンダーさんもだんだん気力が失われてきて、 メールの返事がなくなったり打ち合わせでも無言になってしまったり。

どうしたものか。

Oracle

合間にいろいろ聞かれて答えてみたり。 どこかで検索してきたのをちょっと加工しただけですが…

表領域の使用率を表示

#code(sql){{ col tablespace_name format a20 col used format 99.99999999 select

   tablespace_name,
   (1-sumfree.blocks/sumdat.blocks)*100 as used

from (

   select tablespace_name, sum(blocks) as blocks
   from dba_data_files
   group by tablespace_name

) sumdat join (

   select tablespace_name, sum(blocks) as blocks
   from dba_free_space
   group by tablespace_name

) sumfree using (tablespace_name) order by tablespace_name /

select

   tablespace_name,
   (sumdat.blocks/(sumdat.blocks+sumfree.blocks))*100 as used

from (

   select tablespace_name, sum(bytes_used) as blocks
   from v$temp_space_header
   group by tablespace_name

) sumdat join (

   select tablespace_name, sum(bytes_free) as blocks
   from v$temp_space_header
   group by tablespace_name

) sumfree using (tablespace_name) order by tablespace_name / }}

実行例はこんな感じです。

#pre{{ TABLESPACE_NAME USED


SYSAUX 38.48750000 SYSTEM 35.37343750 UNDOTBS 90.24621212 USERS .06250000

TABLESPACE_NAME USED


TEMP 18.00000000 }}



トップ   差分 履歴 リロード   一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2011-01-29 (土) 15:27:48