Oracle EBS用户登录情况统计脚本

来源:互联网 发布:网络被运营商劫持了 编辑:程序博客网 时间:2024/04/29 12:50


每日用户登录次数的统计
select to_char(START_TIME,'DD-MON-YYYY') Login_Time, count(*) cnt
from apps.fnd_logins where START_TIME > (select to_date('01-APR-2015 00:00:00','DD-MON-YYYY HH24:MI:SS') from dual)
and login_type is not null
and end_time is null
group by to_char(START_TIME,'DD-MON-YYYY')
order by Login_Time DESC;

Output
LOGIN_TIME               CNT
----------------- ----------
09-APR-2015             1124
08-APR-2015             1873
07-APR-2015             1887
06-APR-2015               41
05-APR-2015               46
04-APR-2015               42
03-APR-2015             1679
02-APR-2015             2449
01-APR-2015             3902
9 rows selected

当前在线的用户数和Session数
select to_char(sysdate, 'YYYYMMDD HH24:MI:SS') || '-' || ' UserCount - ' ||
       count(distinct client_identifier) || ' -SessionCount: ' || count(*)
  from v$session;

select to_char(sysdate, 'YYYYMMDD HH24:MI:SS') || '-' || ' UserCount - ' ||
       count(distinct client_identifier) || ' -SessionCount: ' || count(*)
  from gv$session;

Output
TO_CHAR(SYSDATE,'YYYYMMDDHH24:
--------------------------------------------------------------------------------
20150409 15:08:22- usercount - 610 -SessionCount: 2089

V$SESSION和GV$SESSION的区别:https://community.oracle.com/thread/1066147




原创粉丝点击