COL inst_id           FOR 99

COL sql_id            FOR a13

COL child_number      FOR 999

COL plan_hash_value   FOR 9999999999

COL last_active_time  FOR a20

COL elapsed_s         FOR 999,999,999.99

COL cpu_s             FOR 999,999,999.99

COL io_s              FOR 999,999,999.99

COL execs             FOR 999,999

COL buffer_gets       FOR 999,999,999

COL disk_reads        FOR 999,999,999

COL rows_proc         FOR 999,999,999


SELECT inst_id,

       sql_id,

       child_number,

       plan_hash_value,

       TO_CHAR(last_active_time,'YYYY-MM-DD HH24:MI:SS') last_active_time,

       executions                  execs,

       ROUND(elapsed_time/1e6,2)   elapsed_s,

       ROUND(cpu_time/1e6,2)       cpu_s,

       ROUND(user_io_wait_time/1e6,2) io_s,

       buffer_gets,

       disk_reads,

       rows_processed              rows_proc

FROM   gv$sql

WHERE  sql_id='&sql_id'

ORDER  BY last_active_time DESC;

Popular posts from this blog