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 rule: Audits specific operations without specifying specific objects. It can be applied to specific users or all users.
- Object audit rule: Audits specific operations that are performed on specific objects. It can be applied to specific users or all users.
Execute the AUDIT and NOAUDIT statements to set audit rules, which are also a type of schema object.
For more information about audit rules, see AUDIT.
Here is an example. To audit user1's INSERT, UPDATE, and DELETE operations on table tbl1, execute the following statement:
obclient> AUDIT INSERT,UPDATE,DELETE ON user1.tbl1;
View audit rules
After setting audit rules, you can view them by using a series of Oracle-compatible dictionary views.
| Dictionary view | Description |
|---|---|
| ALL_DEF_AUDIT_OPTS | Records the default audit rules for new objects. The valid values of each column are:
|
| DBA_STMT_AUDIT_OPTS | Records detailed configurations for statement audit. |
| DBA_OBJ_AUDIT_OPTS | Records detailed configurations for object audit. |
Here is an example. To view the audit rules in the ALL_DEF_AUDIT_OPTS view, execute the following statement:
obclient> SELECT * FROM SYS.ALL_DEF_AUDIT_OPTS;
References
For more information about audit operations, see the following topics: