您的位置:首页 > 数据库 > Oracle

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

2012-12-15 19:49 771 查看
每日用户登录次数的统计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;
OutputLOGIN_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;
OutputTO_CHAR(SYSDATE,'YYYYMMDDHH24:
--------------------------------------------------------------------------------
20150409 15:08:22- usercount - 610 -SessionCount: 2089
V$SESSION和GV$SESSION的区别:https://community.oracle.com/thread/1066147
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: