Purpose
This function is used to trigger the archiving of the current audit log file that is being written and generate a new encryption key, provided that audit log encryption is enabled. Subsequent archived files will be encrypted using the new key. This function is typically used for key rotation or in conjunction with changes to security policies.
Applicability
This content is applicable only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support audit features.
Syntax
AUDIT_LOG_ENCRYPTION_PASSWORD_SET();
Privilege requirements
You must have the SUPER privilege to use this function.
Considerations
Parameters
This function has no parameters.
Limitations
The same limitations apply as with other audit functions (expressions): they must be directly and uniquely specified as an output column in a SELECT statement and cannot appear in subqueries. For more information, see Limitations and considerations.
Return value
The expression has no input parameters and returns a string.
- If the operation is successful, the expression returns
OK. - If the operation fails, the
SELECTstatement may still execute successfully, and the expression's output will be an error message.
Examples
Rotate the key and archive the current audit log.
SELECT AUDIT_LOG_ENCRYPTION_PASSWORD_SET();
The return result is as follows:
+-----------------------------------------+
| AUDIT_LOG_ENCRYPTION_PASSWORD_SET() |
+-----------------------------------------+
| OK |
+-----------------------------------------+
1 row in set
