Purpose
The ALTER INSTANCE ROTATE INNODB MASTER KEY statement is used to rotate or replace the master encryption key of a primary tenant when transparent data encryption (TDE) is in use. This statement does not accept any parameters; it performs a single function: key rotation.
Executing ALTER INSTANCE ROTATE INNODB MASTER KEY generates a new master key to replace the current one. The new master key is securely stored in a configured keyhouse. Pages (or data) of tablespaces encrypted with the old master key will be gradually re-encrypted to switch to the new master key.
Limitations and considerations
The system tenant is not allowed to use the ALTER INSTANCE ROTATE INNODB MASTER KEY statement to replace or rotate the primary encryption key of a primary tenant.
If you are a regular tenant, you can use the ALTER INSTANCE ROTATE INNODB MASTER KEY statement to replace or rotate the primary encryption key of the primary tenant.
Syntax
ALTER INSTANCE ROTATE INNODB MASTER KEY
Parameters
field |
Description |
|---|---|
| ROTATE | Generate a new key to replace the old one. |
| INNODB MASTER KEY | The primary encryption key used by the InnoDB storage engine, which is used to encrypt tablespaces in the database. |
Examples
/*Set the encryption method to built-in transparent encryption.*/
obclient> ALTER SYSTEM SET tde_method='internal';
/*Displays the configuration of the current encryption method.*/
obclient> SHOW PARAMETERS LIKE 'tde_method';
/*Generate a new primary encryption key.*/
obclient> ALTER INSTANCE ROTATE INNODB MASTER KEY;