A-A+

scripts:查看指定对象的历史增长情况

2013年01月12日 Tools&Scripts 暂无评论 阅读 1,700 次

查看指定对象的历史增长情况

set linesize 150
column owner format a16
column object_name format a30
column start_day format a11
column block_increase format 9999999999
PROMPT specify owner name as parameter owner_name:
DEFINE ownername = &owner_name
select obj.owner,
obj.object_name,
to_char(sn.BEGIN_INTERVAL_TIME, 'YYYY-MM-DD') start_day,
sum(a.space_used_delta) used_increase,
sum(a.space_allocated_delta ) allocate_increase,
sum(a.db_block_changes_delta) block_increase
from dba_hist_seg_stat a, dba_hist_snapshot sn, dba_objects obj
where sn.snap_id = a.snap_id
and obj.object_id = a.obj#
and obj.owner not in ('SYS', 'SYSTEM')
and end_interval_time >= to_timestamp((to_char(sysdate - 7,'YYYY-MM--DD')), 'YYYY-MM--DD')
and obj.OWNER=UPPER('&ownername')
and obj.OBJECT_NAME = UPPER('&segmentname')
group by obj.owner,
obj.object_name,
to_char(sn.BEGIN_INTERVAL_TIME, 'YYYY-MM-DD')
order by obj.owner, obj.object_name
/

标签:

给我留言

Copyright © YallonKing 保留所有权利.   Theme  Ality

用户登录

分享到: