Note
This parameter was introduced in OceanBase Database V4.2.4.
Description
audit_log_strategy specifies the strategy for writing audit logs.
Applicability
This parameter is applicable to only OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support the audit feature.
Limitations
Query the parameter
In the
systenant or a user tenant, you can execute theSHOW PARAMETERSstatement to query the parameter or query theGV$OB_PARAMETERSview for the parameter.Modify the parameter
You can use the
ALTER SYSTEM SETstatement to modify the parameter in thesystenant or a user tenant.
Attributes
| Attribute | Description |
|---|---|
| Type | String |
| Default value | ASYNCHRONOUS |
| Value range | ASYNCHRONOUS: specifies to asynchronously write logs. The write operation will wait when the buffer is full.PERFORMANCE: specifies to asynchronously write logs. Data will be discarded when the buffer is full.SYNCHRONOUS: specifies to synchronously write logs. |
| Modifiable | Yes. You can use the ALTER SYSTEM SET statement to modify the parameter. |
| Effective upon OBServer node restart | No. The setting takes effect immediately. |
Considerations
You can use the audit_log_strategy parameter to specify different log write strategies to achieve a balance between performance and log integrity. When you specify to asynchronously write logs, you can use the audit_log_buffer_size parameter to specify the buffer size.
Examples
Specify to asynchronously write logs for audit. In this strategy, the write operation will wait when the buffer is full.
obclient> ALTER SYSTEM SET audit_log_strategy='ASYNCHRONOUS';