GV$ACTIVE_SESSION_HISTORY SELECT /*+ no_merge ordered use_nl(s,a) */ a.inst_id, s.sample_id, s.sample_time, a.session_id, a.session_serial#, a.user_id, a.sql_id, a.sql_child_number, a.sql_plan_hash_value, a.force_matching_signature, a.sql_opcode, decode(a.plsql_entry_object_id,0,to_number(NULL), a.plsql_entry_object_id), decode(a.plsql_entry_object_id,0,to_number(NULL), a.plsql_entry_subprogram_id), decode(a.plsql_object_id,0,to_number(NULL), a.plsql_object_id), decode(a.plsql_object_id,0,to_number(NULL),a.plsql_subprogram_id), a.service_hash, decode(a.session_type, 1,'FOREGROUND',2,'BACKGROUND', 'UNKNOWN'), decode(a.wait_time, 0, 'WAITING', 'ON CPU'), decode(a.qc_session_id, 0, to_number(NULL), a.qc_session_id), decode(a.qc_session_id, 0, to_number(NULL), a.qc_instance_id), (case when a.blocking_session between 4294967291 and 4294967295 then to_number(NULL) else a.blocking_session end), (case when a.blocking_session = 4294967295 then 'UNKNOWN' when a.blocking_session = 4294967294 then 'GLOBAL' when a.blocking_session = 4294967293 then 'UNKNOWN' when a.blocking_session = 4294967292 then 'NO HOLDER' when a.blocking_session = 4294967291 then 'NOT IN WAIT' else 'VALID' end), (case when a.blocking_session between 4294967291 and 4294967295 then to_number(NULL) else a.blocking_session_serial# end), decode(a.wait_time, 0, a.event, NULL), decode(a.wait_time, 0, a.event_id, NULL), decode(a.wait_time, 0, a.event#, NULL), a.seq# , a.p1text, a.p1, a.p2text, a.p2, a.p3text, a.p3, decode(a.wait_time, 0, a.wait_class, NULL), decode(a.wait_time, 0, a.wait_class_id, NULL), a.wait_time, a.time_waited, a.xid, a.current_obj#, a.current_file#, a.current_block#, a.program, a.module, a.action, a.client_id FROM x$kewash s, x$ash a WHERE s.sample_addr = a.sample_addr and s.sample_id = a.sample_id and s.sample_time = a.sample_time