1. 首页
  2. IT资讯

OWI的等待事件的简单收集

— 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/,如需转载,请注明出处,否则将追究法律责任。

主题测试文章,只做测试使用。发布者:深沉的少年,转转请注明出处:http://www.cxybcw.com/182916.html

联系我们

13687733322

在线咨询:点击这里给我发消息

邮件:1877088071@qq.com

工作时间:周一至周五,9:30-18:30,节假日休息

QR code