
https://support.oracle.com/epmos/faces/DocContentDisplay?_adf.ctrl-state=teik0vr73_955&id=2509211.1
Copyright (c) 2022, Oracle. All rights reserved. Oracle Confidential.
How To Audit Of User Login & Logoff of Database by Unified Auditing (Doc ID 2509211.1)
Modified: Feb 22, 2019 Type: HOWTO
In this Document
Goal
Solution
Supplementary information:
References
APPLIES TO:
Oracle Database - Enterprise Edition - Version 12.1.0.1 and later
Information in this document applies to any platform.
GOAL
How to audit of user login and logoff actions with the Unified Auditing.
SOLUTION
You can use Unified auditing to audit login and logoff actions by "CREATE AUDIT POLICY".
In the following example, the connect/disconnect command is audited for only test01 user.
--Sample User definition:
create user test01 identified by ****;
grant create session to test01;
--Audit setting:
create audit policy connection_policy actions logon,logoff WHEN
'SYS_CONTEXT(''USERENV'',''SESSION_USER'')=''TEST01''' evaluate per session;
audit policy connection_policy;
--Try to logon and logoff:
connect test01
disconnect
--Confirm the audit information:
connect / as sysdba
select to_char(event_timestamp, 'DD/MM/YYYY HH24:MI:SS.FF3'), action_name
from unified_audit_trail where dbusername='TEST01' order by 1;
SQL> --Sample User definition:
SQL> create user test01 identified by ******;
User created.
SQL> grant create session to test01;
Grant succeeded.
SQL>
SQL> --Audit setting:
SQL> create audit policy connection_policy actions logon,logoff WHEN
相关文档
评论