Note
This parameter was introduced in OceanBase Database V4.2.4.
Description
audit_log_prune_seconds specifies the maximum retention period of 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 | Integer |
| Default value | 0, which indicates that audit logs are not to be retained. You do not need to specify the unit. By default, the value is measured in seconds. |
| Value range | [0, +∞) |
| 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
Each time a new archive log file is generated, the system checks whether logs need to be cleared. This parameter and the audit_log_max_size parameter can take effect at the same time.
Examples
Set the maximum retention period of audit logs to 2 hours.
obclient> ALTER SYSTEM SET audit_log_prune_seconds=7200;