7 marzo 2015

Who users are connected or login to Oracle applications?

It give the number of session users on the system in the past 1 hour:

select "is".user_id, user_name, description, email_address,  to_char(min(first_connect) ,  'DD-MON-YYYY HH24:MI:SS') min_first_connect, to_char(max(last_connect),'DD-MON-YYYY HH24:MI:SS') max_last_connect,count(*) "# sessions"
from apps.icx_sessions "is"
inner join apps.fnd_user fu on fu.user_id = "is".user_id
where  last_connect > sysdate - 1/24 and "is".user_id != '-1'
group by "is".user_id, user_name, description, email_address;

This return the user login into system with at least a session and a process:

select d.user_id, d.user_name, d.description, d.email_address, a.terminal_id, b.machine, to_char(a.start_time,  'DD-MON-YYYY HH24:MI:SS') start_time
from apps.fnd_logins a,
v$session b, v$process c, apps.fnd_user d
where b.paddr = c.addr
and a.pid=c.pid
and a.spid = b.process
and d.user_id = a.user_id
and (d.user_name = 'USER_NAME' OR 1=1);

Enjoy it!

Nessun commento: