您的位置:首页 > 其它

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

2009-12-31 00:00 295 查看
自己写的一个小脚本,该脚本可以查询一个月一来表空间的变化情况,注意,该脚本只能在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条件。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: