While multiple methods are available to create a Pluggable Database (PDB), the recommended approach is to use the Database Configuration Assistant (DBCA) utility. This explanation assumes that the PDBs have already been created.
While performing this integration, we used Windows Server. The SQL commands use Windows-style paths; change the path according to the appropriate operating system. For the purpose of this guide, we are using the PDB "utimacopdb.”
-
Edit the tnsnames.ora file to add a new service for the PDB. By default, the tnsnames.ora file in the location set by the TNS_ADMIN environment variable. Ensure you have correctly set the TNS_ADMIN environment variable to point to the correct tnsnames.ora file.
UTIMACOPDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = utimacopdb.localdomain)
)
)
-
Restart the Listener Service.
#lsnrctl stop
#lsnrctl start
#lsnrctl status
-
Log in to the database instance as a user granted the SYSDBA administrative privilege.
SQL> connect system/<password>
-
Set the WALLET_ROOT parameter.
SQL> alter system set wallet_root='<path to the oracle wallet directory>' scope=spfile;
-
Shut down and start up the database.
SQL> shutdown immediate;
SQL> startup;
-
Set the TDE_CONFIGURATION parameter.
SQL> alter system set TDE_CONFIGURATION="KEYSTORE_CONFIGURATION=HSM" SCOPE=both ;
-
Open the hardware keystore in the CDB$ROOT container.
SQL> ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY <hsm_password>;
-
Set the master encryption key in the CDB$ROOT container on the HSM. If the master encryption key has already been generated on the HSM, skip this step.
SQL> ADMINISTER KEY MANAGEMENT SET KEY FORCE KEYSTORE IDENTIFIED BY <hsm_password>;
-
Connect as sysdba.
SQL> connect / as sysdba
-
Open the PDB in read-write mode.
SQL> alter pluggable database <PDB_NAME> open read write;
-
Set the container to the PDB.
SQL> alter session set container = <pdb_name>;
-
Grant the following privileges to the PDB Admin.
SQL> grant administer key management to <pdb_admin>;
SQL> grant create session to <pdb_admin>;
SQL> grant connect to <pdb_admin>;
SQL> grant dba to <pdb_admin>;
SQL> grant create any table to <pdb_admin>;
SQL> grant unlimited tablespace to <pdb_admin>;
SQL> alter user <pdb_admin> profile default;
SQL> commit;
-
Connect to the PDB using the PDB username.
SQL> Connect <pdb_admin>/<system_password>@<Pluggable Database Name>
-
Run the ADMINISTER KEY MANAGEMENT SQL statement to open the PDB database.
SQL> administer key management set keystore open identified by "<hsm_password>";
-
Create the PDB Master Key on the HSM.
SQL> administer key management set key identified by "<hsm_password>";