This topic describes how to use the security audit feature to audit user login operations.
Limitations
Currently, only the Oracle mode of OceanBase Database supports the security audit feature.
Audit the login operations of a specific user
Log in to the database as the ORAAUDITOR user and audit the login operations of user1.
obclient> AUDIT SESSION BY user1;
Audit the login operations of all users
Log in to the database as the ORAAUDITOR user and audit the login operations of all users.
obclient> AUDIT SESSION;
View audit records
View the audit records in the DBA_AUDIT_TRAIL view.
obclient> SELECT USERNAME,USERHOST,TIMESTAMP,SQL_TEXT FROM SYS.DBA_AUDIT_TRAIL;
+----------+----------------+-----------+----------+
| USERNAME | USERHOST | TIMESTAMP | SQL_TEXT |
+----------+----------------+-----------+----------+
| USER1 | 10.10.10.10 | 22-DEC-21 | CONNECT |
+----------+----------------+-----------+----------+
1 row in set
References
For more information about audit operations, see the following topics: