Configure Transparent Database Encryption (TDE) in a Pluggable Database (PDB)
Transparent Data Encryption (TDE) is a powerful Oracle feature that helps protect sensitive data at rest by encrypting the physical files of the database. This post walks through the steps to configure TDE within a Pluggable Database (PDB), create encrypted tablespaces, and verify encryption.
Prerequisites
-
Oracle 19c or later with Multitenant architecture (CDB/PDB)
-
Wallet/Keystore must be properly configured at the CDB level
-
Sufficient file system access for wallet and datafiles
Step-by-Step Guide
🔹 1. Switch to the Target PDB
🔹 2. Open the Keystore in the PDB & Create Master Encryption Key
The
WITH BACKUPclause creates a backup of the master key for recovery scenarios.
🔹 3. Verify Wallet Status
Run this query to confirm that the wallet is open and operational for the PDB:
Look for:
-
STATUS = OPEN -
KEYSTORE_MODE = SINGLEorUNITED
🔹 4. Create Encrypted Tablespace
Here, we create a new encrypted tablespace userstab_enc using AES256 encryption.
🔹 5. Install HR Schema into the Encrypted Tablespace (Optional)
You can modify the script to assign objects to the encrypted tablespace.
🔹 6. Test Encryption Using strings Command
Flush the buffer cache to ensure data is written to disk:
Now use the Linux strings utility to check if data is stored encrypted:
7. Create Another Encrypted Tablespace
🔹 8. List Databases via DBCLI (for DB Systems in OCI or Exadata)
🔹 9. Update the TDE Master Key Using DBCLI
If managing Oracle Database Appliance (ODA) or OCI DBCS, you can update the key via:
-
-i: Database ID -
-n: PDB Name -
-p: Keystore password
Conclusion
By following these steps, you've:
-
Opened and configured the wallet in your PDB
-
Created and backed up the master key
-
Created encrypted tablespaces using AES256
-
Verified encryption through OS-level checks
TDE ensures that your sensitive application data remains secure even if physical files are stolen or compromised.
No comments:
Post a Comment