WalzoneInterview Prep
📞 Interviewing soon? Practice with a realistic AI mock phone interview — it calls you, then scores you. First 15 min FREE →

Oracle Database · Expert · question 66 of 100

How do you implement Transparent Data Encryption (TDE) in Oracle databases to protect sensitive data at rest?

📕 Buy this interview preparation book: 100 Oracle Database questions & answers — PDF + EPUB for $5

Transparent Data Encryption (TDE) is a mechanism of encrypting sensitive data stored in database columns, tablespace and backups, where the encryption and decryption of the data is performed transparently, without the user or application being aware of it. The encryption keys are stored in an external wallet, which is encrypted using a master key that is stored outside the database. In this way, TDE provides an additional layer of security to protect sensitive data at rest, in cases where the database or backups are stolen or lost.

To implement TDE in an Oracle database, follow the steps below:

1. Enable the TDE feature in the database by setting the initialization parameter "encryption_enabled" to true. This parameter can be set in the "init.ora" file or using the ALTER SYSTEM command.

Example:

ALTER SYSTEM SET encryption_enabled = true;

2. Create an Oracle Wallet, which will contain the encryption key used to encrypt and decrypt the data. The wallet must be created outside the database, and its location and password must be specified in the "sqlnet.ora" configuration file.

Example:

Create Wallet:

$ORACLE_HOME/bin/mkstore -wrl /u01/app/oracle/wallet -create

Open Wallet:

$ORACLE_HOME/bin/mkstore -wrl /u01/app/oracle/wallet -createCredential oracle database

3. Generate a master key, which will be used to encrypt the encryption key stored in the Oracle Wallet. The master key must be created with a strong password and stored outside the database, to maintain the security of the encryption keys.

Example:

ALTER SYSTEM SET wallet_key_algorithm = 'AES256' scope=spfile;

SHUTDOWN IMMEDIATE;
STARTUP;
CREATE SYSTEM DECRYPT IDENTIFIED BY "password";
ALTER SYSTEM SET ENCRYPTION WALLET OPEN IDENTIFIED BY "password";
ALTER SYSTEM SET ENCRYPTION KEY IDENTIFIED BY "password";

4. Encrypt the existing sensitive data using the Oracle Data Pump Utility or the DBMS_CRYPTO package. The columns, tablespaces or backups to be encrypted must be specified as part of the command.

Example:

-- Encrypt a tablespace
ALTER TABLESPACE users ENCRYPT;

-- Encrypt a column in a table
ALTER TABLE employees MODIFY (salary ENCRYPT);

-- Encrypt a backup
RMAN> CONFIGURE ENCRYPTION FOR DATABASE ON;
RMAN> BACKUP DATABASE PLUS ARCHIVELOG;

5. Test the encryption by querying the encrypted data and verifying that it is not readable in plaintext.

Example:

SELECT salary FROM employees;

6. Backup and recover the encrypted data and verify that the data remains encrypted after recovery. The wallet must be backed up separately to ensure the ability to restore or recover the data as needed.

Example:

-- Backup the wallet
$ORACLE_HOME/bin/orapki wallet export -wallet /u01/app/oracle/wallet -output /u01/app/oracle/backup/wallet -pwd "password"

-- Backup the database
RMAN> BACKUP DATABASE PLUS ARCHIVELOG;

-- Recover the database
RMAN> RESTORE DATABASE PLUS ARCHIVELOG;
RMAN> RECOVER DATABASE PLUS ARCHIVELOG;
Reading is step one. Saying it out loud is the interview. Our AI interviewer calls your phone and runs a realistic Oracle Database interview — then scores it.
📞 Practice Oracle Database — free 15 min
📕 Buy this interview preparation book: 100 Oracle Database questions & answers — PDF + EPUB for $5

All 100 Oracle Database questions · All topics