System events and wait times

OCPdba.Net

  • Use the script below to get current system events and their wait times
  • --
    -- Author:	Ahbaid Gaffoor
    -- Date:	Tuesday 25th February 2003
    -- File:	waits.sql
    --
    -- Purpose:	Display system event wait times
    --
    -- License:	You may reuse this software at will provided you quote and retain this header
    --
    -- Disclaimer:  No warranty is provided with this software, no liability or guarantees
    --              are given in any form
    --
    -- 
    -- 	Some Important events:
    --	=================
    --	async disk IO
    --	control file parallel write
    --	control file sequential read
    --	db file parallel write
    --	db file scattered read
    --	db file sequential read
    --	direct path read
    --	direct path write
    --	log file parallel write
    --	log file sync
    --
    
    
    set lines 100
    set pages 100
    clear breaks
    clear columns
    
    column c1 heading 'Event'             	format A30 wrap
    column c2 heading 'Total Waits'         format 999,999,999
    column c3 heading 'Wait Time(s)'        format 999,999
    column c4 heading 'Timeouts'        	format 999,999,999
    column c5 heading 'Avg. Wait (s)' 	format 99.999
    
    select 	event c1,
       	total_waits c2,
       	time_waited/100 c3,
       	total_timeouts c4,
       	average_wait/100 c5
    from v$system_event
    where event not in ( 
        'dispatcher timer',
        'lock element cleanup', 
        'Null event', 
        'parallel query dequeue wait',
        'parallel query idle wait - Slaves',
        'pipe get',
        'PL/SQL lock timer',
        'pmon timer', 
        'rdbms ipc message', 
        'slave wait',
        'smon timer', 
        'SQL*Net break/reset to client',
        'SQL*Net message from client', 
        'SQL*Net message to client',
        'SQL*Net more data to client',
        'virtual circuit status',
        'WMON goes to sleep'
       ) 
    and event not like 'DFS%' 
    and event not like '%done%'
    and event not like '%Idle%'
    and event not like 'KXFX%'
    order by c2 desc ;
    

  • Here is a sample run
  • TESTDB: SYSTEM> @waits
    
    Event                           Total Waits Wait Time(s)     Timeouts Avg. Wait (s)
    ------------------------------ ------------ ------------ ------------ -------------
    control file parallel write          29,950          293            0          .010
    control file sequential read         19,657            0            0          .000
    log file parallel write              13,241            0       13,241          .000
    db file parallel write                4,236            0        2,115          .000
    wakeup time manager                   2,897       86,604        2,897        29.890
    db file sequential read               1,329            4            0          .000
    LGWR wait for redo copy                 634            0            0          .000
    db file scattered read                   98            1            0          .010
    direct path read                         92            0            0          .000
    direct path write                        40            0            0          .000
    rdbms ipc reply                          29            0            0          .020
    db file single write                     20            0            0          .010
    buffer busy waits                        15            0            0          .000
    process startup                          12            0            0          .020
    log file sequential read                 12            0            0          .000
    log file sync                            11            0            0          .010
    log file single write                     7            0            0          .010
    async disk IO                             3            0            0          .000
    library cache load lock                   3            0            0          .000
    recovery read                             2            0            0          .000
    instance state change                     2            0            0          .000
    latch free                                1            0            1          .020
    SQL*Net more data from client             1            0            0          .000
    refresh controlfile command               1            0            0          .030
    control file heartbeat                    1            4            1         3.990
    checkpoint completed                      1            0            0          .240
    reliable message                          1            0            0          .000
    
    27 rows selected.
    
    TESTDB: SYSTEM> 
    

    OCPdba.Net