Oracle Wait Interface (OWI)
Oracle wait interface is a group of views that you can use to monitor waiting events and sessions waiting them.
1- first thing is thinking system wide.
-- System wide event waits
select * from v$system_event order by total_waits desc;
select * from v$event_name;
2- and then session wide
-- Session wide events
-- you can see the SID and easily join with v$session
select * from v$session_event order by total_waits desc;
3- time to examine session waits currently
-- session wide waits
-- you can obtain P1, P2 and P3 parameter meanings in v$event_name
select * from v$session_wait order by seconds_in_wait desc;
N1- P1, P2 and P3 columns are important in some types of waits. For example:
If (event_name IN
(‘db file sequential read’ , ‘db file scattered read’))
P1 means file#
P2 means block#
P3 means blocks
-- lets find sessions waiting the files
t1.sid = t2.sid and
t1.p1 = t3.file# and
t1.event in ('db file sequential read','db file scattered read');
N2- There are two columns indicationg the waited time. “wait_time” and “second_in_wait”. You can consider these values by reading “state” column.
If (“state” = WAITING) then
Else If (“state” = WAITED_KNOWN_TIME) then
Else If (“state” = WAITED_UNKNOWN_TIME) then
Alter system set timed_statistics=TRUE -- J
4- you can also examine system wide and session wide statistics
-- system statistics
select * from v$sysstat;
-- session statistics
-- you cannot find statistics name in v$sesstat
-- so we have to join with v$statname
t1.statistic# = t2.statistic# and
t1.sid = t3.sid and
t3.username is not null;
select * from v$statname;
List of views
System wide wait events.
Values are total waits until system startup.
Wait values are reset every system restart.
Properties of wait events.
Session wide wait events.
Has almost same properties with v$system_event.
There is one mor column for SID.
Session wide waits, this view gives you the currents waits by user and resets every session kills itself.
some of the important wait events (non idle wait events)
buffer busy waits
db file scattered read
db file sequential read
free buffer waits
log file parallel write
log file sync
These kind of events points:
Inefficient system architecture.
Inproper instance confugiration.
Some of the idle events (can be ignored most of the times)
Rdbms ipc message
Not an indiaction of performance problem.
Some of the important statistics
bytes received via SQL*Net from client
bytes sent via SQL*Net to client
consistent gets --consistent gets+db block gets = logical IO