日期:2014-05-17 浏览次数:21178 次
C:\Users\lenovo>sqlplus test/test
SQL*Plus: Release 10.2.0.3.0 - Production on 星期四 11月 24 22:41:21 2011
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
[TEST@orcl] SQL>create table LOGON_TABLE(
2 USERENV varchar2(100),
3 SESSION_USER varchar2(100)
4 );
表已创建。
[TEST@orcl] SQL>
CREATE TRIGGER TRI_LOGON
AFTER LOGON ON DATABASE
BEGIN
INSERT INTO LOGON_TABLE
VALUES
(SYS_CONTEXT('USERENV', 'SESSION_USER'),--当前会话用户
SYS_CONTEXT('USERENV', ‘IP_ADDRESS’));--ip地址
END;