常用监控SQL

1.---监控等待事件

select SESSION_ID,NAME,P1,P2,P3,WAIT_TIME,CURRENT_OBJ#,CURRENT_FILE#,CURRENT_BLOCK#
          from v$active_session_history ash, v$event_name enm
          where ash.event#=enm.event#

2.查看当前运行sql

select a.sample_id,
       a.session_id,
       a.sample_time,
       a.sql_id,
       a.event,
       a.blocking_session,
       b.sql_text
  from v$active_session_history a, v$sqlarea b
 where a.sql_id = b.sql_id

原文地址:https://www.cnblogs.com/zhaoyangjian724/p/3797846.html