查询一个月一来表空间的变化情况

自己写的一个小脚本,该脚本可以查询一个月一来表空间的变化情况,注意,该脚本只能在10g以及以上版本中运行,因为

9i没有dba_hist_tbspc_usage这个视图

select a.name,b.* from v$tablespace a,
(select tablespace_id,trunc(to_date(rtime,'mm/dd/yyyy hh24:mi:ss'))datetime,max(tablespace_usedsize*8/1024) used_size from
dba_hist_tbspc_space_usage where trunc(to_date(rtime,'mm/dd/yyyy hh24:mi:ss'))>trunc(sysdate-30)  group by tablespace_id,
trunc(to_date(rtime,'mm/dd/yyyy hh24:mi:ss')) order by tablespace_id,trunc(to_date(rtime,'mm/dd/yyyy hh24:mi:ss')))b
where a.ts#=b.tablespace_id;

 

如果想查询特定时刻表空间的变化情况,请自己更改trunc函数条件以及where条件。

posted on 2009-12-31 00:00  如果蜗牛有爱情  阅读(113)  评论(0编辑  收藏  举报

导航