Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

 Oracle wait event scripts

Oracle Database Tips by Donald BurlesonMarch 23, 2015

Question:  I need some Oracle wait event scripts that go against the v$ and AWR tables.

Answer:  There are many wait event scripts, and I recommend the Oracle Script download for complete wait event monitoring scripts.  There are three sources that are used for wait event tracking:

Oracle v$ wait event scripts:

select
   wait_class,
   sum(time_waited),
   sum(time_waited)/sum(total_waits)
sum_Waits
from
   v$system_wait_class
  
see code depot for full script
Group by
   wait_class
order by
   3 desc;
 
 
WAIT_CLASS      SUM(time_waited)  SUM_WAITS
--------------- ---------------- ----------
Idle                  9899040431 151.750403
Application              3147344 77.2183812
Concurrency               491226 26.0846432
Other                     431875 6.65036957
Administrative               718 5.52307692
Configuration              23691 1.85114862
Commit                     89282 .302570846
User I/O                 2826520 .289489185
System I/O                646700   .1372763
Network                   415446 .007569151

Historical single block read wait time script

 

awr_wait_events.sql
 
select
   sn.end_interval_time,
   trunc((e.time_waited_micro-b.time_waited_micro)/
   (1000*(e.total_waits-b.total_waits)))
   "ave read milliseconds",
(e.total_waits-b.total_waits) "number of reads",
   b.event_name
from
   see code depot for full script
   dba_hist_system_event b,
   dba_hist_system_event e,
   dba_hist_snapshot     sn
where
   b.event_name='db file sequential read'
and
   e.event_name=b.event_name
and
   e.snap_id=b.snap_id+1
and
   e.instance_number=1
and
   b.instance_number=e.instance_number
and
   e.snap_id=sn.snap_id
and
   e.instance_number=sn.instance_number
order by
   e.snap_id;

 
 

display average wait microseconds script


 
col c1 heading "end Interval|time"
col c2 heading "number of|waits"
col c3 heading "average|microseconds"
 
select
   sn.end_interval_time                       c1,
   (e.total_waits-b.total_waits)              c2,
   (e.time_waited_micro-b.time_waited_micro)/
      (e.total_waits-b.total_waits)           c3 
   b.event_name "wait name"
from
  see code depot for full script
   dba_hist_system_event b,
   dba_hist_system_event e,
   dba_hist_snapshot     sn
where
   b.event_name='&WAITNAME'
and
   e.event_name=b.event_name
and
   e.snap_id=b.snap_id+1
and
   e.instance_number=1
and
   b.instance_number=e.instance_number
and
   e.snap_id=sn.snap_id
and
   e.instance_number=sn.instance_number
and
   (e.total_waits-b.total_waits) > 50000
order by
   e.snap_id;

 
In this wait event script, you will be prompted for one of these wait events:
 
WAITNAME values

class slave wait                    
control file parallel write       
control file sequential read  
db file parallel write              
db file scattered read           
db file sequential read         
direct path read temp           
direct path write temp          
latch free                              
latch: redo allocation            
log buffer space                   
log file parallel write             
log file switch completion     
log file sync                          
process startup                    
Queue Monitor Task Wait
 
     

   
Oracle Training from Don Burleson 

The best on site "Oracle training classes" are just a phone call away! You can get personalized Oracle training by Donald Burleson, right at your shop!

Oracle training
 
 


 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster