Purpose
This statement is used to create a tablespace object, and the tablespace object supports encryption.
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 object to be created. |
| ENCRYPTION USING | The keyword used for encryption. |
| AES-256|AES-128|AES-192|SM4-CBC | The encryption algorithm to be used. |
Examples
Create a tablespace object.
obclient> CREATE TABLESPACE tblspace1; Query OK, 0 rows affectedCreate a tablespace object and enable encryption.
/*Create a keystore object and enable key storage.*/ ALTER SYSTEM SET TDE_METHOD = 'INTERNAL'; ADMINISTER KEY MANAGEMENT CREATE KEYSTORE my_keystore IDENTIFIED BY abcCBAK123; /*Create a 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