查询一个月一来表空间的变化情况
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条件。
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条件。
相关文章推荐
- 查询一个月一来表空间的变化情况
- 一个查询数据库中所有表的空间占用情况的存储过程
- oracle表空间使用情况查询sql以及图形化修改表空间
- 在Oracle中查询表的大小、表的占用情况和表空间的大小
- 【转】Oracle 查询表空间使用情况
- Oracle 查询表空间使用情况(转)
- MS SQL Server 2000中查询数据库每个表占用磁盘空间情况
- 查询Oracle数据库中各对象占用空间情况
- Oracle 查询表空间使用情况SQL
- 查看一段周期内每天表空间使用情况,运用场景评估一个月需要增加多大的表空间
- Oracle查询永久表空间使用情况
- Oracle中查询表的大小、表的占用情况和表空间的大小
- ORACLE数据库存储空间使用情况查询
- Oracle查询表空间使用情况
- oracle 查询表的大小,表空间的使用情况,默认表空间
- 在Oracle中查询表的大小、表的占用情况和表空间的大小
- 查询Oracle数据库中各对象占用空间情况
- oracle查询表空间的空间占用情况
- Oracle查询表空间使用情况
- oracle增加表空间的四种方法,查询表空间使用情况