Note
- For V4.3.x, this parameter is available starting with V4.3.3.
- For V4.2.x, this parameter is available starting with V4.2.4.
Description
audit_log_prune_seconds specifies the maximum retention period of audit logs.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support audit logs.
Privilege requirements
Query the parameter
The
systenant and all user tenants can query the parameter by using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify the parameter
The
systenant and user tenants can use theALTER SYSTEM SETstatement to modify the parameter.
Attributes
| Attribute | Description |
|---|---|
| Type | Int |
| Default value | 0, which indicates that audit logs are not retained. The unit is seconds. You do not need to specify the unit when you configure this parameter. |
| 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
When a new log file is generated during log archiving, the system checks whether to prune the logs. 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;