set lines 1000 pages 9999
column sid format 9999
column serial for 999999
column status format a15
column username format a20
column sql_text format a80
col program for a33
col SQL_EXEC_START for a20
SELECT * FROM
(SELECT status,inst_id,sid,SESSION_SERIAL# as Serial,username,sql_id,SQL_PLAN_HASH_VALUE,program,
TO_CHAR(sql_exec_start,'dd-mon-yyyy hh24:mi:ss') AS sql_exec_start,
ROUND(elapsed_time/1000000) AS "Elapsed (s)",
ROUND(cpu_time /1000000) AS "CPU (s)",
substr(sql_text,1,30) sql_text
FROM gv$sql_monitor where module not like '%emagent%'
-- and sid=&sid
ORDER BY sql_exec_start desc
);