All Products
Search
Document Center

PolarDB:Set up transparent data encryption

Last Updated:Mar 30, 2026

Transparent Data Encryption (TDE) encrypts data files as they are written to disk and decrypts them when loaded into memory. Enabling TDE requires no application code changes and does not increase data file size. Encryption keys are generated and managed by Key Management Service (KMS). PolarDB-X does not provide its own keys or certificates.

Prerequisites

Before you begin, ensure that you have:

  • KMS activated (if KMS is not activated, you can activate it during TDE setup)

Choose a key type

Key type Description Use when
Use Automatically Generated Key Alibaba Cloud generates and manages the key You want a simple setup with no key management overhead
Use Existing Custom Key You supply your own key materials via KMS You need to control the key lifecycle for compliance or audit requirements

Enable TDE

  1. Log on to the PolarDB for Xscale console.

  2. In the top navigation bar, select the region where your instance is deployed.

  3. On the Instance List page, click the PolarDB-X 2.0 tab.

  4. Click the ID of the instance.

  5. In the left-side navigation pane, choose Configuration Management > Security Management.

  6. On the TDE tab, turn on the switch next to TDE status.

  7. In the Configure TDE dialog box, select a key type and click OK:

    • Use Automatically Generated Key — Alibaba Cloud generates the key automatically.

    • Use Existing Custom Key — Select an existing key from KMS.

    Note If you do not have a custom key, click Create now to go to the KMS console and import key materials. For more information, see Manage CMKs.
TDE configuration dialog

Encrypt a table

To encrypt an existing table, run:

ALTER TABLE <tablename> ENCRYPTION='Y';

To create a new table with encryption enabled, run:

CREATE TABLE <tablename> <col definition> ENCRYPTION='Y';

Decrypt a table

To remove TDE encryption from a table, run:

ALTER TABLE <tablename> ENCRYPTION='N';