After you enable security audit, it is necessary to set specific audit rules to audit user operations.
Limitations
Currently, only the Oracle mode of OceanBase Database supports the security audit feature.
Set audit rules
Log on to an Oracle tenant as the ORAAUDITOR user and set the following types of audit rules:
- Statement audit: Audits specific operations without specifying specific objects. It can be applied to specific users or all users.
- Object audit: Audits specific operations that are performed on specific objects. It can be applied to specific users or all users.
An audit rule is also a schema object. You can execute the AUDIT and NOAUDIT statements to set audit rules.
For more information about the audit rules, see AUDIT.
For example, audit the INSERT, UPDATE, and DELETE operations on table tbl1 of user1.
obclient> AUDIT INSERT,UPDATE,DELETE ON user1.tbl1;
View audit rules
After you set the audit rules, you can view them by using a series of data dictionary views that are compatible with Oracle.
| Dictionary view | Description |
|---|---|
| ALL_DEF_AUDIT_OPTS | Records default audit rules of new objects. Valid values of each column are as follows:
|
| DBA_STMT_AUDIT_OPTS | The DBA_STMT_AUDIT_OPTS view displays audit configuration details at the statement level. |
| DBA_OBJ_AUDIT_OPTS | Records detailed auditing configuration at the object level. |
Execute the following statement to view the audit rules in the ALL_DEF_AUDIT_OPTS view:
obclient> SELECT * FROM SYS.ALL_DEF_AUDIT_OPTS;
References
For more information about audit operations, see the following topics: