自己写的一个小脚本,该脚本可以查询一个月一来表空间的变化情况,注意,该脚本只能在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;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31448824/viewspace-2136606/
,如需转载,请注明出处,否则将追究法律责任。