ITPub博客

首页 > Linux操作系统 > Linux操作系统 > OWI的等待事件的简单收集

OWI的等待事件的简单收集

原创 Linux操作系统 作者:lfree 时间:2006-03-06 00:00:00 0 删除 编辑
-- Assumption is that you have TOOLS tablespace in your database.
-- Create Begin and End tables to store V$SYSTEM_EVENT contents for
-- time T1 and T2 to compute delta.
-- ===================================--
You only need to create these tables once.
-- ===================================
create table begin_system_event tablespace tools
as select * from v$system_event where 1=2;

create table end_system_event tablespace tools
as select * from v$system_event where 1=2;

-- Take a snapshot of V$SYSTEM_EVENT information at time T1
truncate table begin_system_event;
insert into begin_system_event select * from v$system_event;
-- Wait n seconds or n minutes, and then take another snapshot-- of V$SYSTEM_EVENT at time T2
truncate table end_system_event;
insert into end_system_event select * from v$system_event;

-- Report the ‘delta’ numbers for wait events between times T2 and T1
SELECT t1.event, (t2.total_waits - nvl(t1.total_waits, 0)) "Delta_Waits", (
t2.total_timeouts -
nvl(t1.total_timeouts, 0)
) "Delta_Timeouts", (t2.time_waited - nvl(t1.time_waited, 0)) "Delta_Time_Waited"
FROM begin_system_event t1, end_system_event t2where t2.event = t1.event(+)
order by (t2.time

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-82820/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    2485
  • 访问量
    6290115