Oracle query execution time

后端 未结 4 594
暖寄归人
暖寄归人 2021-01-03 18:31

I would like to get the query execution time in Oracle. I don\'t want the time Oracle needs to print the results - just the execution time.

In MySQL it is easy to ge

4条回答
  •  猫巷女王i
    2021-01-03 19:01

    select LAST_LOAD_TIME, ELAPSED_TIME, MODULE, SQL_TEXT elapsed from v$sql
      order by LAST_LOAD_TIME desc
    

    More complicated example (don't forget to delete or to substitute PATTERN):

    select * from (
      select LAST_LOAD_TIME, to_char(ELAPSED_TIME/1000, '999,999,999.000') || ' ms' as TIME,
             MODULE, SQL_TEXT from SYS."V_\$SQL"
        where SQL_TEXT like '%PATTERN%'
        order by LAST_LOAD_TIME desc
      ) where ROWNUM <= 5;
    

提交回复
热议问题