Purpose
You can use this statement to create a tablespace, which can be encrypted.
Syntax
CREATE TABLESPACE tablespace_name [ENCRYPTION USING 'AES-256|AES-128|AES-192|SM4-CBC']
Parameters
| Parameter | Description |
|---|---|
| tablespace_name | The name of the tablespace to be created. |
| ENCRYPTION USING | The keyword used for encryption. |
| AES-256|AES-128|AES-192|SM4-CBC | The encryption algorithm. |
Examples
Create a tablespace.
obclient> CREATE TABLESPACE tblspace1; Query OK, 0 rows affectedCreate a tablespace and encrypt it.
/*Create a Keystore and open it.*/ ALTER SYSTEM SET TDE_METHOD = 'INTERNAL'; ADMINISTER KEY MANAGEMENT CREATE KEYSTORE my_keystore IDENTIFIED BY abcCBAK123; /*Create the master encryption key.*/ ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY abcCBAK123; ADMINISTER KEY MANAGEMENT SET KEY IDENTIFIED BY abcCBAK123; obclient>CREATE TABLESPACE tblspace1 ENCRYPTION USING 'SM4-CBC'; Query OK, 0 rows affected