常用sql语句-查看整体运行时间最长的sql

查看整体运行时间最长的sql

SELECT a.INST_ID,a.SQL_ID,
a.CPU_TIME, --CPU时间 百万分之一(微秒)        
      a.OPTIMIZER_MODE,--优化方式        
      a.EXECUTIONS,--执行次数        
      a.DISK_READS,--读盘次数        
      a.SHARABLE_MEM,--占用shared pool的内存多少        
      a.BUFFER_GETS,--读取缓冲区的次数        
      a.COMMAND_TYPE,--命令类型(3:select,2:insert;6:update;7delete; 47l/sql程序单元)        
      a.SQL_TEXT,--Sql语句        
      a.SHARABLE_MEM,        
      a.PERSISTENT_MEM,        
      a.RUNTIME_MEM,        
      a.PARSE_CALLS,        
      a.DISK_READS,        
      a.DIRECT_WRITES,        
      a.CONCURRENCY_WAIT_TIME,        
      a.USER_IO_WAIT_TIME   
from gV$SQLAREA a  
order by a.CPU_TIME desc;

Related Posts