Friday, February 16, 2018


Query for active users with v$session


select sesion.sid,
sesion.username,
optimizer_mode,
hash_value,
address,
cpu_time,
elapsed_time,
sql_text
from v$sqlarea sqlarea, v$session sesion
where sesion.sql_hash_value = sqlarea.hash_value
and sesion.sql_address = sqlarea.address
and sesion.username is not null


SQL> select a.sid, a.serial#, b.sql_text 2 from v$session a, v$sqlarea b 3 where a.sql_address=b.address 4 and a.username='APPS';

 SID         SERIAL#                     SQL_TEXT
 ---------- ----------    ---------------------------------------------- 
 122         61521     select count(*) from gen_person where gen_person_id=95000

No comments:

Post a Comment

  RMAN-20207: UNTIL TIME or RECOVERY WINDOW is before RESETLOGS time https://shivanandarao-oracle.com/2012/12/05/rman-20207-until-time-or-re...