7 Managing the Keystore and the Master Encryption Key
You can modify settings for the keystore and TDE master encryption key, and store Oracle Database and store Oracle GoldenGate secrets in a keystore.
- Managing the Keystore
You can perform maintenance activities on keystores such as changing passwords, and backing up, merging, and moving keystores. - Managing the TDE Master Encryption Key
You can manage the TDE master encryption key in several ways. - Transparent Data Encryption Data Dynamic and Data Dictionary Views
You can query a set of dynamic and data dictionary views to find more information about Transparent Data Encryption (TDE) data.
Parent topic: Using Transparent Data Encryption
Managing the Keystore
You can perform maintenance activities on keystores such as changing passwords, and backing up, merging, and moving keystores.
- Performing Operations That Require a Keystore Password
ManyADMINISTER KEY MANAGEMENT
operations require access to a keystore password, for both software and external keystores. - Configuring Auto-Login Hardware Security Modules
A hardware security module can be configured to use the auto-login capability. - Configuring an External Store for a Keystore Password
An external store for a keystore password stores the keystore password in a centrally accessed and managed location. - Backing Up Password-Protected Software Keystores
When you back up a password-protected software keystore, you can create a backup identifier string to describe the backup type. - How the V$ENCRYPTION_WALLET View Interprets Backup Operations
TheBACKUP
column of theV$ENCRYPTION_WALLET
view indicates a how a copy of the keystore was created. - Backups of the External Keystore
You cannot use Oracle Database to back up external keystores. - Merging Software Keystores
You can merge software keystores in a variety of ways. - Moving a Software Keystore to a New Location
You move a software keystore to a new location after you have updated theWALLET_ROOT
parameter. - Moving a Software Keystore Out of Automatic Storage Management
You can use theADMINISTER KEY MANAGEMENT
statement to move a software keystore out Automatic Storage Management. - Migrating Between a Software Password Keystore and an External Keystore
You can migrate between password-protected software keystores and external keystores. - Migration of Keystores to and from Oracle Key Vault
You can use Oracle Key Vault to migrate both software and external keystores to and from Oracle Key Vault. - Configuring Keystores for Automatic Storage Management
You can store a software keystore on an Automatic Storage Management (ASM) disk group. - Managing Updates to the PKCS#11 Library
Periodically, you may need to update the endpoint shared PKCS#11 library. - Backup and Recovery of Encrypted Data
For software keystores, you cannot access encrypted data without the TDE master encryption key. - Dangers of Deleting Keystores
Oracle strongly recommends that you do not delete keystores. - Features That Are Affected by Deleted Keystores
Some features can be adversely affected if a keystore is deleted and a TDE master encryption key residing in that keystore is later needed.
Parent topic: Managing the Keystore and the Master Encryption Key
Performing Operations That Require a Keystore Password
Many ADMINISTER KEY MANAGEMENT
operations require access to a keystore password, for both software and external keystores.
In some cases, a software keystore depends on an auto-login keystore before the operation can succeed. Auto-login keystores open automatically when they are configured and a key is requested. They are generally used for operations where the keystore could be closed but a database operation needs a key (for example, after the database is restarted). Because the auto-login keystore opens automatically, it can be retrieved to perform a database operation without manual intervention. However, some keystore operations that require the keystore password cannot be performed when the auto-login keystore is open. The auto-login keystore must be closed and the password-protected keystore must be opened for the keystore operations that require a password.
In a multitenant environment, the re-opening of keystores affects other PDBs. For example, an auto-login keystore in the root must be accessible by the PDBs in the CDB for this root.
You can temporarily open the keystore by including the FORCE KEYSTORE
clause in the ADMINISTER KEY MANAGEMENT
statement when you perform the following operations: rotating a keystore password; creating, using, rekeying, tagging, importing, exporting, migrating, or reverse migrating encryption keys; opening or backing up keystores; adding, updating, or deleting secret keystores. In a multitenant environment, if no keystore is open in the root, then FORCE KEYSTORE
opens the password-protected keystore in the root.
Parent topic: Managing the Keystore
Configuring Auto-Login Hardware Security Modules
A hardware security module can be configured to use the auto-login capability.
- About Configuring Auto-Login Hardware Security Modules
An auto-login hardware security module stores the hardware security module credentials in an auto-login keystore. - Configuring an Auto-Login Hardware Security Module
To configure the auto-login HSM, you must use theADMINISTER KEY MANAGEMENT
statement to add or update a client secret that is to be used to authenticate to the HSM.
Parent topic: Managing the Keystore
About Configuring Auto-Login Hardware Security Modules
An auto-login hardware security module stores the hardware security module credentials in an auto-login keystore.
This configuration reduces the security of the system as a whole. However, this configuration does support unmanned or automated operations and is useful in deployments where automatic re-login to the hardware security module is necessary.
Be aware that executing the query SELECT * FROM V$ENCRYPTION_WALLET
will automatically open an auto-login hardware security module. For example, suppose you have an auto-login hardware security module configured. If you close the keystore and query the V$ENCRYPTION_WALLET
view, then the output will indicate that a keystore is open. This is because V$ENCRYPTION_WALLET
opened up the auto-login external keystore and then displayed the status of the auto-login keystore.
To enable the auto-login capability for an external keystore, you must store the external keystore's credentials in an auto-login wallet.
When you use the ADMINISTER KEY MANAGEMENT
statement, there are conceptually two sets of commands that act on client secrets:
ADMINISTER KEY MANAGEMENT
commands that act on the wallet that is currently in use (in other words, a wallet that contains an active TDE master encryption key).ADMINISTER KEY MANAGEMENT
commands that act on a wallet that is not currently being used to hold the active TDE master encryption key. Oracle recommends that you use this approach when you configure an auto-login external keystore.
Parent topic: Configuring Auto-Login Hardware Security Modules
Configuring an Auto-Login Hardware Security Module
To configure the auto-login HSM, you must use the ADMINISTER KEY MANAGEMENT
statement to add or update a client secret that is to be used to authenticate to the HSM.
V$ENCRYPTION_WALLET
dynamic view for this wallet, the STATUS
column shows OPEN_NO_MASTER_KEY
rather than OPEN
, because the wallet only contains the client secret.
-
Reconfigure the
WALLET_ROOT
parameter in theinit.ora
file to include the keystore location of the software keystore, if it is not already present.The software keystore location may already be present if you had previously migrated to using the HSM.
For example:
WALLET_ROOT=/etc/ORACLE/WALLETS/orcl
-
Add or update the secret in the software keystore.
The secret is the hardware security module password and the client is the
HSM_PASSWORD
.HSM_PASSWORD
is an Oracle-defined client name that is used to represent the HSM password as a secret in the software keystore.For example:
ADMINISTER KEY MANAGEMENT ADD SECRET 'user_name:password' FOR CLIENT 'HSM_PASSWORD' TO LOCAL AUTO_LOGIN KEYSTORE software_keystore_location WITH BACKUP;
In this example:
software_keystore_location
is the location of the software keystore within theWALLET_ROOT
location that you just defined in Step 1.For the CDB root and for any PDB that is configured in united mode, the value to use for the
software_keystore_location
location isWALLET_ROOT/tde
.For any PDB that is configured in isolated mode, the value to use for the
software_keystore_location
location isWALLET_ROOT/pdb_guid/tde
. When you are in the PDB, execute the following query to find this GUID:SELECT GUID FROM V$PDBS;
LOCAL
creates a local auto-login wallet file,cwallet.sso
, to hold the credentials for the HSM. This wallet is tied to the host on which it was created.For an Oracle Real Application Clusters environment, omit the
LOCAL
keyword, because each Oracle RAC node has a different host name, yet they all use the same HSM. If you configure a local auto-login wallet for the Oracle RAC instance, then only the first Oracle RAC node, where thecwallet.sso
file was created, would be able to access the HSM credentials. If you try to open the keystore from another node instead of from that first node, there would be a problem auto-openingcwallet.sso
, and so it would result in a failure to auto-open the auto-login HSM. This restriction applies if you are using a shared location to hold thecwallet.sso
file for the Oracle RAC cluster, because usingLOCAL
only works if you have a separatecwallet.sso
file (containing the same credentials) on each node of the Oracle RAC environment.
At this stage, the next time a TDE operation executes, the hardware security module auto-login keystore opens automatically. An example of a TDE operation is to query the V$ENCRYPTION_WALLET
view, for example:
SELECT * FROM V$ENCRYPTION_WALLET;
Parent topic: Configuring Auto-Login Hardware Security Modules
Configuring an External Store for a Keystore Password
An external store for a keystore password stores the keystore password in a centrally accessed and managed location.
- About Configuring an External Store for a Keystore Password
- Configuring the Keystore Password External Store by Setting WALLET_ROOT
The preferred approach to configuring the external store for the keystore password is the set theWALLET_ROOT
parameter. - Configuring the Keystore Password External Store by Editing sqlnet.ora
As an alternative to setting theWALLET_ROOT
parameter, you can edit thesqlnet.ora
file to configure the external password store for the keystore password. - When to Use the EXTERNAL STORE Clause After Configuration
After you configure the external store for a keystore password, you can use theEXTERNAL_STORE
clause in theADMINISTER KEY MANAGEMENT
statement.
Parent topic: Managing the Keystore
About Configuring an External Store for a Keystore Password
An external store for a keystore password allows you to easily remove that keystore password from the ADMINISTER KEY MANAGEMENT
command line, implementing separation of duties between database administrators and key administrators. It is also useful for situations in which you use automated tools to perform Transparent Data Encryption operations that require a password, when the scripts that run the automated tools include hard-coded password. To avoid hard-coding the password in a script, you can store this password in an external store on the database server. In a multitenant environment, different PDBs can make use of the external store.
Related Topics
Parent topic: Configuring an External Store for a Keystore Password
Configuring the Keystore Password External Store by Setting WALLET_ROOT
The preferred approach to configuring the external store for the keystore password is the set the WALLET_ROOT
parameter.
Related Topics
Parent topic: Configuring an External Store for a Keystore Password
Configuring the Keystore Password External Store by Editing sqlnet.ora
As an alternative to setting the WALLET_ROOT
parameter, you can edit the sqlnet.ora
file to configure the external password store for the keystore password.
Related Topics
Parent topic: Configuring an External Store for a Keystore Password
When to Use the EXTERNAL STORE Clause After Configuration
After you configure the external store for a keystore password, you can use the EXTERNAL_STORE
clause in the ADMINISTER KEY MANAGEMENT
statement.
You must use the EXTERNAL STORE
clause in the ADMINISTER KEY MANAGEMENT
statement for the following operations: opening, closing, backing up the keystore; adding, updating, or deleting a secret keystore; creating, using, rekeying, tagging, importing, exporting encryption keys.
For example:
ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY EXTERNAL STORE;
You can change or delete external keystore passwords by using the ADMINISTER KEY MANAGEMENT UPDATE CLIENT SECRET
statement or the ADMINISTER KEY MANAGEMENT DELETE CLIENT SECRET
statement.
Parent topic: Configuring an External Store for a Keystore Password
Backing Up Password-Protected Software Keystores
When you back up a password-protected software keystore, you can create a backup identifier string to describe the backup type.
- About Backing Up Password-Protected Software Keystores
You must back up password-protected software keystores, as per the security policy and requirements of your site. - Creating a Backup Identifier String for the Backup Keystore
The backup file name of a software password keystore is derived from the name of the password-protected software keystore. - Backing Up a Password-Protected Software Keystore
TheBACKUP KEYSTORE
clause of theADMINISTER KEY MANAGEMENT
statement backs up a password-protected software keystore.
Parent topic: Managing the Keystore
About Backing Up Password-Protected Software Keystores
You must back up password-protected software keystores, as per the security policy and requirements of your site.
A backup of the keystore contains all of the keys contained in the original keystore. Oracle Database prefixes the backup keystore with the creation time stamp (UTC). If you provide an identifier string, then this string is inserted between the time stamp and keystore name.
After you complete the backup operation, the keys in the original keystore are marked as "backed up". You can check the status of keys querying the V$ENCRYPTION_WALLET
data dictionary view.
You cannot back up auto-login or local auto-login software keystores. No new keys can be added to them directly through the ADMINISTER KEY MANAGEMENT
statement operations. The information in these keystores is only read and hence there is no need for a backup.
You must include the WITH BACKUP
clause in any ADMINISTER KEY MANAGEMENT
statement that changes the wallet (for example, changing the wallet password, or setting the master encryption key).
Parent topic: Backing Up Password-Protected Software Keystores
Creating a Backup Identifier String for the Backup Keystore
The backup file name of a software password keystore is derived from the name of the password-protected software keystore.
Parent topic: Backing Up Password-Protected Software Keystores
Backing Up a Password-Protected Software Keystore
The BACKUP KEYSTORE
clause of the ADMINISTER KEY MANAGEMENT
statement backs up a password-protected software keystore.
Parent topic: Backing Up Password-Protected Software Keystores
How the V$ENCRYPTION_WALLET View Interprets Backup Operations
The BACKUP
column of the V$ENCRYPTION_WALLET
view indicates a how a copy of the keystore was created.
The column indicates if a copy of the keystore had been created with the WITH BACKUP
clause of the ADMINISTER KEY MANAGEMENT
statement or the ADMINISTER KEY MANAGEMENT BACKUP KEYSTORE
statement.
When you modify a key or a secret, the modifications that you make do not exist in the previously backed-up copy, because you make a copy and then modify the key itself. Because there is no copy of the modification in the previous keystores, the BACKUP
column is set to NO
, even if the BACKUP
had been set to YES
previously. Hence, if the BACKUP
column is YES
, then after you perform an operation that requires a backup, such as adding a custom attribute tag, the BACKUP
column value changes to NO
.
Parent topic: Managing the Keystore
Backups of the External Keystore
You cannot use Oracle Database to back up external keystores.
See your HSM vendor instructions for information about backing up keys for external keystores.
Parent topic: Managing the Keystore
Merging Software Keystores
You can merge software keystores in a variety of ways.
- About Merging Software Keystores
You can merge any combination of software keystores, but the merged keystore must be password-protected. It can have a password that is different from the constituent keystores. - Merging One Software Keystore into an Existing Software Keystore
You can use theADMINISTER KEY MANAGEMENT
statement with theMERGE KEYSTORE
clause to merge one software keystore into another existing software keystore. - Merging Two Software Keystores into a Third New Keystore
You can merge two software keystores into a third new keystore, so that the two existing keystores are not changed. - Merging an Auto-Login Software Keystore into an Existing Password-Protected Software Keystore
You can merge an auto-login software keystore into an existing password-protected software keystore. - Reversing a Software Keystore Merge Operation
You cannot directly reverse a keystore merge operation.
Parent topic: Managing the Keystore
About Merging Software Keystores
You can merge any combination of software keystores, but the merged keystore must be password-protected. It can have a password that is different from the constituent keystores.
To use the merged keystore, you must explicitly open the merged keystore after you create it, even if one of the constituent keystores was already open before the merge.
Whether a common key from two source keystores is added or overwritten to a merged keystore depends on how you write the ADMINISTER KEY MANAGEMENT
merge statement. For example, if you merge Keystore 1 and Keystore 2 to create Keystore 3, then the key in Keystore 1 is added to Keystore 3. If you merge Keystore 1 into Keystore 2, then the common key in Keystore 2 is not overwritten.
The ADMINISTER KEY MANAGEMENT
merge statement has no bearing on the configured keystore that is in use. However, the merged keystore can be used as the new configured database keystore if you want. Remember that you must reopen the keystore if you are using the newly created keystore as the keystore for the database at the location configured by the WALLET_ROOT
parameter.
Parent topic: Merging Software Keystores
Merging One Software Keystore into an Existing Software Keystore
You can use the ADMINISTER KEY MANAGEMENT
statement with the MERGE KEYSTORE
clause to merge one software keystore into another existing software keystore.
Parent topic: Merging Software Keystores
Merging Two Software Keystores into a Third New Keystore
You can merge two software keystores into a third new keystore, so that the two existing keystores are not changed.
Parent topic: Merging Software Keystores
Merging an Auto-Login Software Keystore into an Existing Password-Protected Software Keystore
You can merge an auto-login software keystore into an existing password-protected software keystore.
Parent topic: Merging Software Keystores
Reversing a Software Keystore Merge Operation
You cannot directly reverse a keystore merge operation.
WITH BACKUP
clause in the ADMINISTER KEY MANAGEMENT
statement to create a backup of this existing keystore. Later on, if you decide that you must reverse the merge, you can replace the merged software keystore with the one that you backed up. In other words, suppose you want merge Keystore A into Keystore B. By using the WITH BACKUP
clause, you create a backup for Keystore B before the merge operation begins. (The original Keystore A is still intact.) To reverse the merge operation, revert to the backup that you made of Keystore B.
- Use the
ADMINISTER KEY MANAGEMENT MERGE KEYSTORE
SQL statement to perform merge operations.- For example, to perform a merge operation into an existing keystore:
ADMINISTER KEY MANAGEMENT MERGE KEYSTORE '/etc/ORACLE/KEYSTORE/DB1' INTO EXISTING KEYSTORE '/etc/ORACLE/KEYSTORE/DB2' IDENTIFIED BY password WITH BACKUP USING "merge1";
Replace the new keystore with the backup keystore, which in this case would be named
ewallet_
time-stamp
_merge1.p12
. - To merge an auto-login keystore into a password-based keystore, use the
ADMINISTER KEY MANAGEMENT MERGE KEYSTORE
SQL statement.
- For example, to perform a merge operation into an existing keystore:
Parent topic: Merging Software Keystores
Moving a Software Keystore to a New Location
You move a software keystore to a new location after you have updated the WALLET_ROOT
parameter.
If you are using Oracle Key Vault, then you can configure a TDE direct connection where Key Vault directly manages the master encryption keys. In this case, you will never need to manually move the keystore to a new location.
-
Connect to the united mode CDB root or isolated mode PDB as a user who has been granted the
ADMINISTER KEY MANAGEMENT
orSYSKM
privilege.For example:
CONNECT c##sec_admin AS SYSKM (or CONNECT sec_admin@pdb_name AS SYSKM) Enter password: password
-
Back up the software keystore.
For example:
ADMINISTER KEY MANAGEMENT BACKUP KEYSTORE USING 'hr.emp_keystore' FORCE KEYSTORE IDENTIFIED BY software_keystore_password TO '/etc/ORACLE/KEYSTORE/DB1/';
-
Close the software keystore.
Examples of ways that you can close the keystore are as follows.
For an auto-login software keystore:
ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE;
For a password-protected software keystore:
ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY software_keystore_password;
For a keystore for which the password is stored externally:
ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY EXTERNAL STORE;
-
Exit the database session.
For example, if you are logged in to SQL*Plus:
EXIT
-
In the
init.ora
file for the database instance, update theWALLET_ROOT
parameter to point to the new location where you want to move the keystore. -
Use the operating system move command (such as
mv
) to move the keystore with all of its keys to the new directory location.
Related Topics
Parent topic: Managing the Keystore
Moving a Software Keystore Out of Automatic Storage Management
You can use the ADMINISTER KEY MANAGEMENT
statement to move a software keystore out Automatic Storage Management.
Parent topic: Managing the Keystore
Migrating Between a Software Password Keystore and an External Keystore
You can migrate between password-protected software keystores and external keystores.
- Migrating from a Password-Protected Software Keystore to an External Keystore
You can migrate from a password-protected software keystore to an external keystore. - Migrating from an External Keystore to a Password-Based Software Keystore
You can migrate an external keystore to a software keystore. - Keystore Order After a Migration
After you perform a migration, keystores can be either primary or secondary in their order.
Parent topic: Managing the Keystore
Migrating from a Password-Protected Software Keystore to an External Keystore
You can migrate from a password-protected software keystore to an external keystore.
- Step 1: Convert the Software Keystore to Open with the External Keystore
Some Oracle tools require access to the old software keystore to encrypt or decrypt data that was exported or backed up using the software keystore. - Step 2: Configure the External Keystore Type
You can use theALTER SYSTEM
statement to configure the external keystore type. - Step 3: Perform the External Keystore Migration
You can use theADMINISTER KEY MANAGEMENT
SQL statement to perform an external keystore migration.
Step 1: Convert the Software Keystore to Open with the External Keystore
Some Oracle tools require access to the old software keystore to encrypt or decrypt data that was exported or backed up using the software keystore.
- Use the
ADMINISTER KEY MANAGEMENT
SQL statement to convert a software keystore to open with an external keystore.- To set the software keystore password as that of the external keystore, use the following syntax:
ADMINISTER KEY MANAGEMENT ALTER KEYSTORE PASSWORD FORCE KEYSTORE IDENTIFIED BY software_keystore_password SET "external_keystore_credentials" WITH BACKUP [USING 'backup_identifier'];
In this specification:
-
software_keystore_password
is the same password that you used when creating the software keystore. -
external_keystore_credentials
is the new software keystore password which is the same as the password of the external keystore. -
WITH BACKUP
creates a backup of the software keystore. Optionally, you can use theUSING
clause to add a brief description of the backup. Enclose this description in single quotation marks (' '
). This identifier is appended to the named keystore file (for example,ewallet_
time-stamp
_emp_key_backup
.p12
, withemp_key_backup
being the backup identifier). Follow the file naming conventions that your operating system uses.
-
- To create an auto-login keystore for a software keystore, use the following syntax:
ADMINISTER KEY MANAGEMENT CREATE [LOCAL] AUTO_LOGIN KEYSTORE FROM KEYSTORE 'keystore_location' IDENTIFIED BY software_keystore_password;
In this specification:
-
LOCAL
enables you to create a local auto-login software keystore. Otherwise, omit this clause if you want the keystore to be accessible by other computers. -
keystore_location
is the path to the keystore directory location of the keystore that is configured in thesqlnet.ora
file. -
software_keystore_password
is the existing password of the configured software keystore.
-
- To set the software keystore password as that of the external keystore, use the following syntax:
Step 2: Configure the External Keystore Type
You can use the ALTER SYSTEM
statement to configure the external keystore type.
Step 3: Perform the External Keystore Migration
You can use the ADMINISTER KEY MANAGEMENT
SQL statement to perform an external keystore migration.
MIGRATE USING
keystore_password
clause in the ADMINISTER KEY MANAGEMENT SET KEY
SQL statement to decrypt the existing TDE table keys and tablespace encryption keys with the TDE master encryption key in the software keystore and then reencrypt them with the newly created TDE master encryption key in the external keystore. After you complete the migration, you do not need to restart the database, nor do you need to manually re-open the external keystore. The migration process automatically reloads the keystore keys in memory.
Migrating from an External Keystore to a Password-Based Software Keystore
You can migrate an external keystore to a software keystore.
- About Migrating Back from an External Keystore
To switch from using an external keystore solution to a software keystore, you can use reverse migration of the keystore. - Step 1: Configure the External Keystore Type
You can use theALTER SYSTEM
statement to configure the external keystore type. - Step 2: Configure the Keystore for the Reverse Migration
TheADMINISTER KEY MANAGEMENT
statement with theSET ENCRYPTION KEY
andREVERSE MIGRATE
clauses can be used to reverse the migration of a keystore. - Step 3: Configure the External Keystore to Open with the Software Keystore
After you complete the migration, the migration process automatically reloads the keystore keys in memory.
About Migrating Back from an External Keystore
To switch from using an external keystore solution to a software keystore, you can use reverse migration of the keystore.
After you complete the switch, keep the hardware security module, in case earlier backup files rely on the TDE master encryption keys in the hardware security module.
If you had originally migrated from the software keystore to the hardware security module and reconfigured the software keystore, then you already have an existing keystore with the same password as the HSM password. Reverse migration configures this keystore to act as the new software keystore with a new password. If your existing keystore is an auto-login software keystore and you have the password-based software keystore for this auto-login keystore, then use the password-based keystore. If the password-based keystore is not available, then merge the auto-login keystore into a newly created empty password-based keystore, and use the newly created password-based keystore.
If you do not have an existing keystore, then you must specify a keystore location using the WALLET_ROOT
parameter in the init.ora
file. When you perform the reverse migration, migrate to the previous keystore so that you do not lose the keys.
Step 1: Configure the External Keystore Type
You can use the ALTER SYSTEM
statement to configure the external keystore type.
Step 2: Configure the Keystore for the Reverse Migration
The ADMINISTER KEY MANAGEMENT
statement with the SET ENCRYPTION KEY
and REVERSE MIGRATE
clauses can be used to reverse the migration of a keystore.
Step 3: Configure the External Keystore to Open with the Software Keystore
After you complete the migration, the migration process automatically reloads the keystore keys in memory.
You do not need to restart the database, nor do you need to manually re-open the software keystore.
The external keystore may still be required after reverse migration because the old keys are likely to have been used for encrypted backups or by tools such as Oracle Data Pump and Oracle Recovery Manager. You should cache the external keystore credentials in the keystore so that the HSM can be opened with the software keystore.
Keystore Order After a Migration
After you perform a migration, keystores can be either primary or secondary in their order.
The WALLET_ORDER
column of the V$ENCRYPTION_WALLET
dynamic view describes whether a keystore is primary (that is, it holds the current TDE master encryption key) or if it is secondary (it holds the previous TDE master encryption key). The WRL_TYPE
column describes the type of locator for the keystore (for example, FILE
for the sqlnet.ora
file). The WALLET_ORDER
column shows SINGLE
if two keystores are not configured together and no migration was ever performed previously.
Table 7-1 describes how the keystore order works after you perform a migration.
Table 7-1 Keystore Order After a Migration
Type of Migration Done | WRL_TYPE | WALLET_ORDER | Description |
---|---|---|---|
Migration of software keystore to external keystore |
|
|
Both the external and software keystore are configured. The TDE master encryption key can be either in the HSM or the software keystore. The TDE master encryption key is first searched in the HSM. If the TDE master encryption key is not in the primary keystore (HSM), then it will be searched for in the software keystore. All of the new TDE master encryption keys will be created in the primary keystore (in this case, the HSM). |
Reverse migration of external keystore to software keystore |
|
|
Both the external and software keystore are configured. The TDE master encryption key can be either in the external keystore or the software keystore. The TDE master encryption key is first searched for in the software keystore. If the TDE master encryption key is not present in the primary (that is, software) keystore, then it will be searched for in the HSM's external keystore. All of the new TDE master encryption keys will be created in the primary keystore (in this case, the software keystore). |
Migration of Keystores to and from Oracle Key Vault
You can use Oracle Key Vault to migrate both software and external keystores to and from Oracle Key Vault.
This enables you to manage the keystores centrally, and then share the keystores as necessary with other TDE-enabled databases in your enterprise.
Oracle Key Vault enables you to upload a keystore to a container called a virtual wallet, and then create a new virtual wallet from the contents of previously uploaded Oracle keystores. For example, suppose you previously uploaded a keystore that contains 5 keys. You can create a new virtual wallet that consists of only 3 of these keys. You then can download this keystore to another TDE-enabled database. This process does not modify the original keystore.
In addition to Oracle keystores, Oracle Key Vault enables you to securely share other security objects, such as credential files and Java keystores, across the enterprise. It prevents the loss of keys and keystores due to forgotten passwords or accidentally deleted keystores. You can use Oracle Key Vault with products other than TDE: Oracle Real Application Security, Oracle Active Data Guard, and Oracle GoldenGate. Oracle Key Vault facilitates the movement of encrypted data using Oracle Data Pump and Oracle Transportable Tablespaces.
Related Topics
Parent topic: Managing the Keystore
Configuring Keystores for Automatic Storage Management
You can store a software keystore on an Automatic Storage Management (ASM) disk group.
- About Configuring Keystores for Automatic Storage Management
You can configure a keystore for Automatic Storage Management (ASM) for a standalone database or a multitenant environment. TheWALLET_ROOT
location can be compliant or non-compliant with Oracle Managed File (OMF) systems. - Configuring a Keystore to Point to an ASM Location
You can setWALLET_ROOT
to point to an ASM directory within which the TDE keystore of the CDB root (which all united mode PDBs share) and the TDE keystores of all isolated mode PDBs are located. - Configuring a Keystore to Point to an ASM Location When the WALLET_ROOT Location Does Not Follow OMF Guidelines
If the chosenWALLET_ROOT
location does not comply with the Oracle Managed File (OMF) guidelines, then the Oracle database cannot perform automation of the directory creation.
Parent topic: Managing the Keystore
About Configuring Keystores for Automatic Storage Management
You can configure a keystore for Automatic Storage Management (ASM) for a standalone database or a multitenant environment. The WALLET_ROOT
location can be compliant or non-compliant with Oracle Managed File (OMF) systems.
You should use the WALLET_ROOT
and TDE_CONFIGURATION
initialization parameters to configure the keystore location in an ASM system. The TDE_CONFIGURATION
parameter must be set with the attribute KEYSTORE_CONFIGURATION=FILE
in order for the WALLET_ROOT
parameter to work. Note that starting with Oracle Database release 19c, the ENCRYPTION_WALLET_LOCATION
, set in the sqlnet.ora
file, is deprecated in favor of WALLET_ROOT
and TDE_CONFIGURATION
.
To perform the configuration, you must specify a +
sign, followed by the ASM disk group and path where the keystore will be located. For example:
WALLET_ROOT=+disk_group/path
Note the following:
- When you designate the path for the
WALLET_ROOT
for databases in standalone or multitenant environments, or environments where theWALLET_ROOT
location either complies or does not comply with the Oracle Managed File (OMF) directory naming convention, be aware that this path must follow certain conventions so that the database can automate the creation of the directory components of the TDE keystore locations for you. Otherwise, you must manually create the directories under theWALLET_ROOT
location. - If you must move or merge software keystores between a regular file system and an ASM file system, then you can use the same keystore merge statements that are used to merge software keystores.
- To execute commands to manage keystores in an ASM environment, you can use the
ASMCMD
utility.
Configuring a Keystore to Point to an ASM Location
You can set WALLET_ROOT
to point to an ASM directory within which the TDE keystore of the CDB root (which all united mode PDBs share) and the TDE keystores of all isolated mode PDBs are located.
Parent topic: Configuring Keystores for Automatic Storage Management
Configuring a Keystore to Point to an ASM Location When the WALLET_ROOT Location Does Not Follow OMF Guidelines
If the chosen WALLET_ROOT
location does not comply with the Oracle Managed File (OMF) guidelines, then the Oracle database cannot perform automation of the directory creation.
ALTER DISKGROUP
command to manually create the necessary directories under the WALLET_ROOT
location. You must use the ALTER DISKGROUP
... ADD DIRECTORY
statement to manually create the necessary directories, because no automation of the directory creation is possible when the WALLET_ROOT
parameter is not using an OMF-compliant value.
Parent topic: Configuring Keystores for Automatic Storage Management
Managing Updates to the PKCS#11 Library
Periodically, you may need to update the endpoint shared PKCS#11 library.
- About Managing Updates to the PKCS#11 Library
Oracle Database uses the PKCS#11 endpoint shared library to retrieve the TDE master encryption key from an external key management device such as Oracle Key Vault. - Switching Over to an Updated PKCS#11 Library
When an updated PKCS#11 endpoint shared library is available, you can switch over to the updated library without incurring any database downtime.
Parent topic: Managing the Keystore
About Managing Updates to the PKCS#11 Library
Oracle Database uses the PKCS#11 endpoint shared library to retrieve the TDE master encryption key from an external key management device such as Oracle Key Vault.
To switch an Oracle database over to an updated PKCS#11 shared library, you must execute the following statement:
ADMINISTER KEY MANAGEMENT SWITCHOVER TO LIBRARY 'updated_fully_qualified_file_name_of_library' FOR ALL CONTAINERS;
Note the following:
-
The path of the updated fully qualified file name must begin with
/opt/oracle/extapi/64/pkcs11/
. The path provided in the fully qualified file name will be validated to ensure that each directory is owned byroot
and is not writable bygroup
orother
(the permissions of each directory should look likedrwxr-xr-x root root
), and that none of the components of the path are symbolic links. If you receive anORA-02097: parameter cannot be modified because specified value is invalid
orORA-46702: failed to switch over the PKCS#11 library
error, then check the trace file for details regarding the path validation failure. -
Execute this command from the root container database (
CDB$ROOT
). The PKCS#11 library is switched for the root container database and all PDBs that currently use the PKCS#11 library. -
Be aware that after you switch over to an updated PKCS#11 library, there may be a temporary decrease in TDE performance while the internal state of the PKCS#11 library is re-established, due to the internal state being lost during the library switchover.
Parent topic: Managing Updates to the PKCS#11 Library
Switching Over to an Updated PKCS#11 Library
When an updated PKCS#11 endpoint shared library is available, you can switch over to the updated library without incurring any database downtime.
Parent topic: Managing Updates to the PKCS#11 Library
Backup and Recovery of Encrypted Data
For software keystores, you cannot access encrypted data without the TDE master encryption key.
Because the TDE master encryption key is stored in the keystore, you should periodically back up the software keystore in a secure location. You must back up a copy of the keystore whenever you set a new TDE master encryption key or perform any operation that writes to the keystore.
Do not back up the software keystore in the same location as the encrypted data. Back up the software keystore separately. This is especially true when you use the auto-login keystore, which does not require a password to open. In case the backup tape is lost, a malicious user should not be able to get both the encrypted data and the keystore.
Oracle Recovery Manager (Oracle RMAN) does not back up the software keystore as part of the database backup. When using a media manager such as Oracle Secure Backup with Oracle RMAN, Oracle Secure Backup automatically excludes auto-open keystores (the cwallet.sso
files). However, it does not automatically exclude encryption keystores (the ewallet.p12
files). It is a good practice to add the following exclude
data set statement to your Oracle Secure Backup configuration:
exclude name *.p12
This setting instructs Oracle Secure Backup to exclude the encryption keystore from the backup set.
If you lose the software keystore that stores the TDE master encryption key, then you can restore access to encrypted data by copying the backed-up version of the keystore to the appropriate location. If you archived the restored keystore after the last time that you reset the TDE master encryption key, then you do not need to take any additional action.
If the restored software keystore does not contain the most recent TDE master encryption key, then you can recover old data up to the point when the TDE master encryption key was reset by rolling back the state of the database to that point in time. All of the modifications to encrypted columns after the TDE master encryption key was reset are lost.
Related Topics
Parent topic: Managing the Keystore
Dangers of Deleting Keystores
Oracle strongly recommends that you do not delete keystores.
If a keystore becomes overly full, any TDE master encryption key other than the currently-active TDE master encryption key can be moved to a new keystore to reduce the overall size of the keystore, but it is important to keep a backup of this new keystore because even though the keys have been moved out of the currently-active keystore, they may still be needed by other Oracle features, such as Oracle Recovery Manager backup operations. (See Related Topics at the end of this topic for a listing of features that are affected by deleted keystores.)
Deleting a keystore that still contains keys is particularly dangerous if you have configured Transparent Data Encryption and the keystore is in use. You can find if a keystore is in use by querying the STATUS
column of the V$ENCRYPTION_WALLET
view after you open the keystore. How you should proceed depends on whether you are using united mode or isolated mode.
- In isolated mode, if the
STATUS
column of theV$ENCRYPTION_WALLET
isOPEN_NO_MASTER_KEY
, then it is safe to archive and later delete the this keystore, because there are no keys in it. - In united mode, you must execute the query of
V$ENCRYPTION_WALLET
from theCDB$ROOT
, not the PDB. If you execute the query in a PDB that does not yet have a key set, then theSTATUS
isOPEN_NO_MASTER_KEY
. However, this can be misleading, because a key could have been set in theCDB$ROOT
. After you execute the query in the root and if theSTATUS
isOPEN_NO_MASTER_KEY
, then you can safely archive and later delete the keystore.
The reason that you should be cautious when moving keys out of the currently-active TDE keystore is that this keystore may contain keys that are still needed by the database (even though the TDE master encryption key has been rekeyed). Deleting the keystore deletes these keys, and could result in the loss of encrypted data. Even if you decrypted all of the data in your database, you still should not delete the keystore, because doing so could still hamper the normal functioning of the Oracle database. This is because a TDE master encryption key in the keystore can also be required for other Oracle Database features. (See Related Topics at the end of this topic for a listing of features that are affected by deleted keystores.)
Even after you performed TDE keystore migration (which rekeys in such a way that the location of your currently-active TDE master encryption key changes place between your software keystore and your external keystore), you still should not delete your original keystore. The keys in the original keystore may be needed at a later time (for example, when you must recover an offline encrypted tablespace). Even if all online tablespaces are not encrypted, the key may still be in use.
The exception is in the case of software auto-login (or local auto-login) keystores. If you do not want to use this type of keystore, then ideally you should move it to a secure directory. Only delete an auto-login keystore if you are sure that it was created from a specific password-based keystore because an auto-login keystore is always based on an ordinary software keystore. The keystore should be available and known.
If you must delete a keystore, then do so with great caution. You must first move the keys within the keystore to a new keystore by using the ADMINISTER KEY MANAGEMENT MOVE KEYS TO NEW KEYSTORE
statement.
Features That Are Affected by Deleted Keystores
Some features can be adversely affected if a keystore is deleted and a TDE master encryption key residing in that keystore is later needed.
Before you delete a keystore, consider the impact that the deletion will have in the event that you need the any TDE master encryption key in the TDE keystore at a later time. The following features and activities are affected:
- Offlined tablespace operations
- Oracle Secure Backup operations
- Media recovery and block media recovery operations
- Point-in-time recovery operations
- Physical and logical Oracle Data Guard standby operations
- Golden Gate operations
- Oracle Streams operations
- Oracle Recovery Manager operations, including restoring Oracle Recovery Manager backups
- Applying archived redo logs to a database during database crash recovery operations
- Database online block recovery. (Online block recovery implies that the database is still open. Deleting a wallet in an open database with encrypted tablespaces will cause additional problems other than those associated with online block recovery.) These problems can include the following:
- Encrypted online data in encrypted tablespaces would no longer be decrypted. Encrypted metadata in the
SYSTEM
,UNDO
, andTEMP
tablespaces would no longer be decrypted. You will no longer have control over what metadata is encrypted or where that metadata can reside. - Buffered data or metadata needs to be encrypted before it can be written back to the disk, but if the wallet is deleted, then the buffered data or metadata would no longer be encrypted. This could cause redo generation to fail, and the DBWR background process would not be able to write the data, which would possibly lead to a database instance hang or crash.
- After a database instance crash, the database instance recovery and database crash recovery would fail, leading to the database not being able to be restarted.
- Encrypted online data in encrypted tablespaces would no longer be decrypted. Encrypted metadata in the
Related Topics
Parent topic: Managing the Keystore
Managing the TDE Master Encryption Key
You can manage the TDE master encryption key in several ways.
- TDE Master Encryption Key Attribute Management
TDE master encryption key attributes store information about the TDE master encryption key. - Creating Custom TDE Master Encryption Key Attributes for Reports
Custom TDE master encryption key attributes enable you to defined attributes that are specific to your needs. - Setting or Rekeying the TDE Master Encryption Key in the Keystore
You can set or rekey the TDE master encryption key for both software keystores and external keystores. - Exporting and Importing the TDE Master Encryption Key
You can export and import the TDE master encryption key in different ways. - Management of TDE Master Encryption Keys Using Oracle Key Vault
You can use Oracle Key Vault to manage and share TDE master encryption keys across an enterprise.
Parent topic: Managing the Keystore and the Master Encryption Key
TDE Master Encryption Key Attribute Management
TDE master encryption key attributes store information about the TDE master encryption key.
- TDE Master Encryption Key Attributes
TDE master encryption key attributes include detailed information about the TDE master encryption key. - Finding the TDE Master Encryption Key That Is in Use
A TDE master encryption key that is in use is the encryption key that was activated most recently for the database.
Parent topic: Managing the TDE Master Encryption Key
TDE Master Encryption Key Attributes
TDE master encryption key attributes include detailed information about the TDE master encryption key.
The information contains the following types:
-
Key time stamp information: Internal security policies and compliance policies usually determine the key rekeying frequency. You should expire keys when they reach the end of their lifetimes and then generate new keys. Time stamp attributes such as key creation time and activation time help you to determine the key age accurately, and automate key generation.
The
V$ENCRYPTION_KEYS
view includes columns such asCREATION_TIME
andACTIVATION_TIME.
See Oracle Database Reference for a complete description of theV$ENCRYPTION_KEYS
view. -
Key owner information: Key owner attributes help you to determine the user who created or activated the key. These attributes can be important for security, auditing, and tracking purposes. Key owner attributes also include key use information, such as whether the key is used for standalone TDE operations or used in a multitenant environment.
The
V$ENCRYPTION_KEYS
view includes columns such asCREATOR, CREATOR_ID, USER, USER_ID,
andKEY_USE.
-
Key source information: Keys often must be moved between databases for operations such as import-export operations and Data Guard-related operations. Key source attributes enable you to track the origin of each key. You can track whether a key was created locally or imported, and the database name and instance number of the database that created the key. In a multitenant environment, you can track the PDB where the key was created.
The
V$ENCRYPTION_KEYS
view includes columns such asCREATOR_DBNAME, CREATOR_DBID, CREATOR_INSTANCE_NAME, CREATOR_INSTANCE_NUMBER, CREATOR_PDBNAME,
and so on. -
Key usage information: Key usage information determines the database or PDB where the key is being used. It also helps determine whether a key is in active use or not.
The
V$ENCRYPTION_KEYS
view includes columns such asACTIVATING_DBNAME, ACTIVATING_DBID, ACTIVATING_INSTANCE_NAME, ACTIVATING_PDBNAME,
and so on. -
User-defined information and other information: When creating a key, you can tag it with information using the
TAG
option. Each key contains important information such as whether or not it has been backed up.The
V$ENCRYPTION_KEYS
view includes columns such asKEY_ID, TAG,
and other miscellaneous columns, for exampleBACKED_UP
.
Note:
TDE Master Key Attributes and Tag are only supported with a hardware security module that has PKCS#11 data object support.Parent topic: TDE Master Encryption Key Attribute Management
Finding the TDE Master Encryption Key That Is in Use
A TDE master encryption key that is in use is the encryption key that was activated most recently for the database.
Parent topic: TDE Master Encryption Key Attribute Management
Creating Custom TDE Master Encryption Key Attributes for Reports
Custom TDE master encryption key attributes enable you to defined attributes that are specific to your needs.
- About Creating Custom Attribute Tags
Attribute tags enable you to monitor specific activities users perform, such as accessing a particular terminal ID. - Creating a Custom Attribute Tag
To create a custom attribute tag, you must use theSET TAG
clause of theADMINISTER KEY MANAGEMENT
statement.
Parent topic: Managing the TDE Master Encryption Key
About Creating Custom Attribute Tags
Attribute tags enable you to monitor specific activities users perform, such as accessing a particular terminal ID.
By default, Oracle Database defines a set of attributes that describe various characteristics of the TDE master encryption keys that you create, such as the creation time, database in which the TDE master encryption key is used, and so on. These attributes are captured by the V$ENCRYPTION_KEY
dynamic view.
You can create custom attributes that can be captured by the TAG
column of the V$ENCRYPTION_KEYS
dynamic view. This enables you to define behaviors that you may want to monitor, such as users who perform activities on encryption keys. The tag can encompass multiple attributes, such as session IDs from a specific terminal.
After you create the tag for a TDE master encryption key, its name should appear in the TAG
column of the V$ENCRYPTION_KEYS
view for that TDE master encryption key. If you create a tag for the secret, then the tag appears in the SECRET_TAG
column of the V$CLIENT_SECRETS
view. If you create a secret with a tag, then the tag appears in the SECRET_TAG
column of the V$CLIENT_SECRETS
view.
Setting or Rekeying the TDE Master Encryption Key in the Keystore
You can set or rekey the TDE master encryption key for both software keystores and external keystores.
- About Setting or Rekeying the TDE Master Encryption Key in the Keystore
You can set or rekey the TDE master encryption key for both software password-based and external keystores. - Creating, Tagging, and Backing Up a TDE Master Encryption Key
TheADMINISTER KEY MANAGEMENT
statement enables you to create, tag, and back up a TDE master encryption key. - About Rekeying the TDE Master Encryption Key
Oracle Database uses a unified TDE Master Encryption Key for both TDE column encryption and TDE tablespace encryption. - Rekeying the TDE Master Encryption Key
You can use theADMINISTER KEY MANAGEMENT
statement to rekey a TDE master encryption key. - Changing the TDE Master Encryption Key for a Tablespace
You can use theENCRYPT
andREKEY
clauses of theALTER TABLESPACE
statement to encrypt a tablespace.
Parent topic: Managing the TDE Master Encryption Key
About Setting or Rekeying the TDE Master Encryption Key in the Keystore
You can set or rekey the TDE master encryption key for both software password-based and external keystores.
The TDE master encryption key is stored in an external security module (keystore), and it is used to protect the TDW table keys and tablespace encryption keys. By default, the TDE master encryption key is a system-generated random value created by Transparent Data Encryption (TDE).
Use the ADMINISTER KEY MANAGEMENT
statement to set or reset (REKEY
) the TDE master encryption key. When the master encryption key is set, then TDE is considered enabled and cannot be disabled.
Before you can encrypt or decrypt database columns or tablespaces, you must generate a TDE master encryption key. Oracle Database uses the same TDE master encryption key for both TDE column encryption and TDE tablespace encryption. The instructions for setting a software or hardware TDE master encryption key explain how to generate a tDE master encryption key.
Creating, Tagging, and Backing Up a TDE Master Encryption Key
The ADMINISTER KEY MANAGEMENT
statement enables you to create, tag, and back up a TDE master encryption key.
About Rekeying the TDE Master Encryption Key
Oracle Database uses a unified TDE Master Encryption Key for both TDE column encryption and TDE tablespace encryption.
When you rekey the TDE master encryption key for TDE column encryption, the TDE Master Encryption Key for TDE tablespace encryption also is rekeyed. Rekey the TDE Master Encryption Key only if it was compromised or as per the security policies of the organization. This process deactivates the previous TDE master encryption key.
For better security and to meet compliance regulations, periodically rekey the TDE master encryption key. This process deactivates the previous TDE master encryption key, creates a new TDE master encryption key, and then activates it. You can check the keys that were created recently by querying the CREATION_TIME
column in the V$ENCRYPTION_KEYS
view. To find the keys that were activated recently, query the ACTIVATION_TIME
column in the V$ENCRYPTION_KEYS
view.
You cannot change the TDE master encryption key or rekey a TDE master encryption key for an auto-login keystore. Because auto-login keystores do not have a password, an administrator or a privileged user can change the keys without the knowledge of the security officer. However, if both the auto-login and the password-based keystores are present in the configured location (as set in the sqlnet.ora
file), then when you rekey the TDE master encryption key, a TDE master encryption key is added to both the auto-login and password-based keystores. If the auto-login keystore is in use in a location that is different from that of the password-based keystore, then you must re-create the auto-login keystore.
Do not perform a rekey operation of the master key concurrently with an online tablespace rekey operation. You can find if an online tablespace is in the process of being TDE Master Encryption Keyed by issuing the following query:
SELECT TS#,ENCRYPTIONALG,STATUS FROM V$ENCRYPTED_TABLESPACES;
A status of REKEYING
means that the corresponding tablespace is still being rekeyed.
Note:
You cannot add new information to auto-login keystores separately.
Rekeying the TDE Master Encryption Key
You can use the ADMINISTER KEY MANAGEMENT
statement to rekey a TDE master encryption key.
Exporting and Importing the TDE Master Encryption Key
You can export and import the TDE master encryption key in different ways.
- About Exporting and Importing the TDE Master Encryption Key
Oracle Database features such as transportable tablespaces and Oracle Data Pump move data that is possibly encrypted between databases. - About Exporting TDE Master Encryption Keys
You can useADMINISTER KEY MANAGEMENT EXPORT
to export TDE master encryption keys from a keystore, and then import them into another keystore. - Exporting a TDE Master Encryption Key
TheADMINISTER KEY MANAGEMENT
statement with theEXPORT [ENCRYPTION] KEYS WITH SECRET
clause exports a TDE master encryption key. - Example: Exporting a TDE Master Encryption Key by Using a Subquery
TheADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS
statement can export a TDE master encryption key by using a subquery. - Example: Exporting a List of TDE Master Encryption Key Identifiers to a File
TheADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS WITH SECRET
statement can export a list of TDE master encryption key identifiers to a file. - Example: Exporting All TDE Master Encryption Keys of the Database
TheADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS
SQL statement can export all TDE master encryption keys of a database. - About Importing TDE Master Encryption Keys
TheADMINISTER KEY MANAGEMENT IMPORT
statement can import exported TDE master encryption keys from a key export file into a target keystore. - Importing a TDE Master Encryption Key
TheADMINISTER KEY MANAGEMENT
statement with theIMPORT [ENCRYPTION] KEYS WITH SECRET
clause can import a TDE master encryption key. - Example: Importing a TDE Master Encryption Key
You can use theADMINISTER KEY MANAGEMENT IMPORT KEYS
SQL statement to import a TDE master encryption key. - How Keystore Merge Differs from TDE Master Encryption Key Export or Import
The keystore merge operation differs from the TDE master encryption key export and import operations.
Parent topic: Managing the TDE Master Encryption Key
About Exporting and Importing the TDE Master Encryption Key
Oracle Database features such as transportable tablespaces and Oracle Data Pump move data that is possibly encrypted between databases.
These are some common scenarios in which you can choose to export and import TDE master encryption keys to move them between source and target keystores. For Data Guard (Logical Standby), you must copy the keystore that is in the primary database to the standby database. Instead of merging the primary database keystore with the standby database, you can export the TDE master encryption key that is in use and then import it to the standby database. Moving transportable tablespaces that are encrypted between databases requires that you export the TDE master encryption key at the source database and then import it into the target database.
Parent topic: Exporting and Importing the TDE Master Encryption Key
About Exporting TDE Master Encryption Keys
You can use ADMINISTER KEY MANAGEMENT EXPORT
to export TDE master encryption keys from a keystore, and then import them into another keystore.
A TDE master encryption key is exported together with its key identifier and key attributes. The exported keys are protected with a password (secret) in the export file.
You can specify the TDE master encryption keys to be exported by using the WITH IDENTIFIER
clause of the ADMINSITER KEY MANAGENT EXPORT
statement. To export the TDE master encryption keys, you can either specify their key identifiers as a comma-separated list, or you can specify a query that enumerates their key identifiers. Be aware that Oracle Database executes the query determining the key identifiers within the current user's rights and not with definer's rights.
If you omit the WITH IDENTIFER
clause, then all of the TDE master encryption keys of the database are exported.
Exporting a TDE Master Encryption Key
The ADMINISTER KEY MANAGEMENT
statement with the EXPORT [ENCRYPTION] KEYS WITH SECRET
clause exports a TDE master encryption key.
Parent topic: Exporting and Importing the TDE Master Encryption Key
Example: Exporting a TDE Master Encryption Key by Using a Subquery
The ADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS
statement can export a TDE master encryption key by using a subquery.
Example 7-2 shows how to export TDE master encryption keys whose identifiers are fetched by a query to a file called export.exp
. The TDE master encryption keys in the file are encrypted using the secret my_secret
. The SELECT
statement finds the identifiers for the TDE master encryption keys to be exported.
Example 7-1 Exporting a List of TDE Master Encryption Key Identifiers to a File
ADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS
WITH SECRET "my_secret"
TO '/TDE/export.exp'
FORCE KEYSTORE
IDENTIFIED BY password
WITH IDENTIFIER IN 'AdoxnJ0uH08cv7xkz83ovwsAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
'AW5z3CoyKE/yv3cNT5CWCXUAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
keystore altered.
Parent topic: Exporting and Importing the TDE Master Encryption Key
Example: Exporting a List of TDE Master Encryption Key Identifiers to a File
The ADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS WITH SECRET
statement can export a list of TDE master encryption key identifiers to a file.
Example 7-1 shows how to export TDE master encryption keys by specifying their identifiers as a list, to a file called export.exp
. TDE master encryption keys in the file are encrypted using the secret my_secret
. The identifiers of the TDE master encryption key to be exported are provided as a comma-separated list.
Example 7-2 Exporting TDE Master Encryption Key Identifiers by Using a Subquery
ADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS
WITH SECRET "my_secret" TO '/etc/TDE/export.exp'
FORCE KEYSTORE
IDENTIFIED BY password
WITH IDENTIFIER IN (SELECT KEY_ID FROM V$ENCRYPTION_KEYS WHERE ROWNUM <3);
keystore altered.
Parent topic: Exporting and Importing the TDE Master Encryption Key
Example: Exporting All TDE Master Encryption Keys of the Database
The ADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS
SQL statement can export all TDE master encryption keys of a database.
Example 7-3 shows how to export all of the TDE master encryption keys of the database to a file called export.exp
. The TDE master encryption keys in the file are encrypted using the secret my_secret
.
Example 7-3 Exporting All of the TDE Master Encryption Keys of the Database
ADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS WITH SECRET "my_secret" TO '/etc/TDE/export.exp' FORCE KEYSTORE IDENTIFIED BY password; keystore altered.
Parent topic: Exporting and Importing the TDE Master Encryption Key
About Importing TDE Master Encryption Keys
The ADMINISTER KEY MANAGEMENT IMPORT
statement can import exported TDE master encryption keys from a key export file into a target keystore.
You cannot re-import TDE master encryption keys that have already been imported.
Importing a TDE Master Encryption Key
The ADMINISTER KEY MANAGEMENT
statement with the IMPORT [ENCRYPTION] KEYS WITH SECRET
clause can import a TDE master encryption key.
Parent topic: Exporting and Importing the TDE Master Encryption Key
Example: Importing a TDE Master Encryption Key
You can use the ADMINISTER KEY MANAGEMENT IMPORT KEYS
SQL statement to import a TDE master encryption key.
Example 7-4 shows how to import the TDE master encryption key identifiers that are stored in the file export.exp
and encrypted with the secret my_secret
.
Example 7-4 Importing TDE Master Encryption Key Identifiers from an Export File
ADMINISTER KEY MANAGEMENT IMPORT KEYS
WITH SECRET "my_secret"
FROM '/etc/TDE/export.exp'
FORCE KEYSTORE
IDENTIFIED BY password WITH BACKUP;
keystore altered.
Parent topic: Exporting and Importing the TDE Master Encryption Key
How Keystore Merge Differs from TDE Master Encryption Key Export or Import
The keystore merge operation differs from the TDE master encryption key export and import operations.
Even though both the ADMINISTER KEY MANAGEMENT MERGE
statement and the ADMINISTER KEY MANAGEMENT EXPORT
and IMPORT
statements eventually move the TDE master encryption keys from one keystore to the next, there are differences in how these two statements function.
-
The
MERGE
statement merges two keystores whereas theEXPORT
andIMPORT
statements export the keys to a file or import the keys from a file. The keystore is different from the export file, and the two cannot be used interchangeably. The export file is not a keystore and cannot be configured to be used with a database as a keystore. Similarly, theIMPORT
statement cannot extract the TDE master encryption keys from the keystore. -
The
MERGE
statement merges all of the TDE master encryption keys of the specified keystores where as theEXPORT
andIMPORT
statements can be selective. -
The
EXPORT
andIMPORT
statements require the user to provide both a location (filepath
) and the file name of the export file, whereas theMERGE
statement only takes in the location of the keystores. -
The file name of the keystores is fixed and is determined by the
MERGE
operation and can be eitherewallet.p12
orcwallet.sso
. The file names for the export files used in theEXPORT
theIMPORT
statements are specified by the user. -
The keystores on Automatic Storage Management (ASM) disk groups or regular file systems can be merged with
MERGE
statements. The export files used in theEXPORT
and theIMPORT
statements can only be a regular operating system file and cannot be located on an ASM disk group. -
The keystores merged using the
MERGE
statement do not need to be configured or in use with the database. TheEXPORT
statement can only export the keys from a keystore that is configured and in use with the database and is also open when the export is done. TheIMPORT
statement can only import the keys into a keystore that is open, configured, and in use with the database. -
The
MERGE
statement never modifies the metadata associated with the TDE master encryption keys. TheEXPORT
andIMPORT
operations can modify the metadata of the TDE master encryption keys when required, such as during a PDB plug operation.
Parent topic: Exporting and Importing the TDE Master Encryption Key
Management of TDE Master Encryption Keys Using Oracle Key Vault
You can use Oracle Key Vault to manage and share TDE master encryption keys across an enterprise.
Oracle Key Vault securely stores the keys in a central repository, along with other security objects such as credential files and Java keystores, and enables you to share these objects with other TDE-enabled databases.
Transparent Data Encryption Data Dynamic and Data Dictionary Views
You can query a set of dynamic and data dictionary views to find more information about Transparent Data Encryption (TDE) data.
Table 7-2 describes these dynamic and data dictionary views.
Table 7-2 Transparent Data Encryption Related Views
View | Description |
---|---|
|
Displays encryption information about encrypted columns in the tables accessible to the current user |
|
Displays encryption information for all of the encrypted columns in the database |
|
Displays encryption information for encrypted table columns in the current user's schema |
|
Describes tablespace usage metrics for all types of tablespaces, including permanent, temporary, and undo tablespaces |
|
Lists the properties of the strings (secrets) that were stored in the keystore for various features (clients). In a multitenant environment, when you query this view in a PDB, then it displays information about keys that were created or activated for the current PDB. If you query this view in the root, then it displays this information about keys for all of the PDBs. |
|
Displays information about the default encryption key that is used for the current database. The default is |
|
Displays information about the tablespaces that are encrypted |
|
When used with keys that have been rekeyed with the In a multitenant environment, when you query this view in a PDB, it displays information about keys that were created or activated for the current PDB. If you query this view in the root, it displays this information about keys for all of the PDBs. |
|
Displays information on the status of the keystore and the keystore location for TDE |
|
Displays metadata information for a PKI certificate, which can be used as a master encryption key for TDE |
Related Topics
Parent topic: Managing the Keystore and the Master Encryption Key