SELECT SID, EVENT
, P1TEXT||DECODE(P1TEXT, NULL, '', '='||P1 ) P1
, P2TEXT||DECODE(P2TEXT, NULL, '', '='||P2 ) P2
, P3TEXT||DECODE(P3TEXT, NULL, '', '='||P3 ) P3
, LPAD( WAIT_TIME || 's', 7, ' ' ) INW

FROM V$SESSION_WAIT_HISTORY
WHERE EVENT NOT IN -- Eventos considerados idle na versão 8.1.7
  ( 'smon timer', 'pmon timer', 'rdbms ipc message', 'Null event', 'parallel query dequeue',
    'pipe get', 'client message', 'SQL*Net message to client', 'SQL*Net message from client',
    'SQL*Net more data from client', 'SQL*Net more data to client', 'dispatcher timer',
    'virtual circuit status', 'lock manager wait for remote message', 'PX Idle Wait',
    'wakeup time manager' );
        
    
SELECT  SID, EVENT
  , TOTAL_WAITS    QTDE
  , TOTAL_TIMEOUTS QTDE_TIMEOUTS
  , CASE 
      WHEN NULLIF(e.time_waited,0)/100 < 60
        THEN e.time_waited/100 || ' segundos' 
      WHEN NULLIF(e.time_waited,0)/100 < 3600
        THEN round(e.time_waited/100/60,2) || ' minutos'
      WHEN NULLIF(e.time_waited,0)/100 >= 3600
        THEN round(e.time_waited/100/3600,2) || ' horas'
      ELSE
        'n/a'
    END tempo_total
FROM V$SESSION_EVENT e 
WHERE 1 = 1 
ORDER BY time_waited desc;

SELECT sesion.sid,
       sql_text
  FROM v$sqlarea sqlarea, v$session sesion
 WHERE sesion.sql_hash_value = sqlarea.hash_value
   AND sesion.sql_address    = sqlarea.address;   

hostgator