标签:io for on div log ad ef 时间 as
CREATE OR REPLACE TRIGGER XTGL_LOGON_TRIGGER
AFTER logon ON DATABASE
BEGIN
INSERT INTO XTGL_LOGON(SESSIONID,IPADDRESS,MACHINENAME,PROGRAMNAME,LOGONDATE,LOGONID)
VALUES(sys_context(‘userenv‘,‘SESSIONID‘),ora_client_ip_address,sys_context(‘userenv‘,‘TERMINAL‘),
‘客户端‘,SYSDATE,sys_context(‘userenv‘,‘SESSIONID‘));
END;
oracle用触发器来记录用户登录信息(能记录在线时间和离线时间和在线时长) 两个用户登录
CREATE OR REPLACE TRIGGER XTGL_LOGOFF_TRIGGER
BEFORE logoff ON DATABASE
BEGIN
INSERT INTO XTGL_LOGON(SESSIONID,IPADDRESS,MACHINENAME,PROGRAMNAME,LOGONDATE,LOGONID)
VALUES(sys_context(‘userenv‘,‘SESSIONID‘),ora_client_ip_address,sys_context(‘userenv‘,‘TERMINAL‘),
‘离线‘,SYSDATE,sys_context(‘userenv‘,‘SESSIONID‘));
END;
这个离线触发器,把上线和离线都记录下来,你想统计什么就统计什么呗
标签:io for on div log ad ef 时间 as
原文地址:http://www.cnblogs.com/tianshuilv/p/4117999.html