-
Log in to the database as a user granted the SYSDBA administrative privilege.
SQL
SQL> connect / as sysdba
-
Set the WALLET_ROOT parameter.
SQL
SQL> alter system set wallet_root='<path to the oracle wallet directory>' scope=spfile
-
Shut down and start up database.
SQL
SQL> shutdown immediate;
SQL> startup;
-
Set the TDE_CONFIGURATION parameter.
SQL
SQL> alter system set TDE_CONFIGURATION="KEYSTORE_CONFIGURATION=HSM|FILE" SCOPE=both ;
-
Connect to the database as a system user.
SQL
SQL> connect system/<password>
-
Now, migrate the wallet to the HSM using the command below.
SQL
SQL> ADMINISTER KEY MANAGEMENT SET ENCRYPTION KEY IDENTIFIED BY <hsm_password> MIGRATE USING <software_keystore_password> WITH BACKUP USING 'backupdb';
-
Now, verify that the wallet has been moved to the HSM wallet using the command below.
SQL
select * from v$encryption_wallet;
-
The Transparent Data Encryption decrypts the encrypted column automatically and returns the data in clear format.
SQL
SQL> select salary from SCIENTISTS;
SQL> select salary from EMP;
-
Verify that the column is encrypted in your DB.
SQL
SQL> select * from DBA_ENCRYPTED_COLUMNS;
-
View the information of the keystore.
SQL
SQL> select * from V$ENCRYPTION_WALLET;
-
Change the password of the software keystore to be the same as the HSM password.
SQL
SQL> ADMINISTER KEY MANAGEMENT ALTER KEYSTORE PASSWORD IDENTIFIED BY <software_keystore_password> SET <hsm_password> WITH BACKUP USING 'backupdb';
-
Close the keystore.
SQL
SQL> ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY <software_keystore_password>;
-
Open the keystore.
SQL
SQL> ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY <software_keystore_password>;
-
View the information of the keystore.
SQL
SQL> select * from V$ENCRYPTION_WALLET;