This tutorial describes how you can use Transparent Database Encryption to encrypt data stored on disk using Enterprise Manager Database Control in Oracle Database 11g.
30 minutes
This tutorial covers the following topics:
Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: This action loads all screenshots simultaneously, so response time may be slow depending on your Internet connection.)
Note: Alternatively, you can place the cursor over each individual icon in the following steps to load and view only the screenshot associated with that step.
Transparent data encryption enables you to encrypt individual table columns or an entire tablespace. When a user inserts data into an encrypted column, transparent data encryption automatically encrypts the data. When users select the column, the data is automatically decrypted. After the selection, the data is reencrypted.
Transparent data encryption helps protect data stored on media in the event that the storage media or data file gets stolen, because it stores the encryption keys in a security module (that is, a wallet) external to the database. Protecting data from this type of theft is required for most compliance regulations. The benefit to using transparent data encryption is that it requires little coding and is quick and easy to implement.
In Oracle Database 11g, you can use Enterprise Manager to manage transparent data encryption.
Before starting this tutorial, you should:
1. |
Install Oracle Database 11g |
In this section, you update your sqlnet.ora, create an encrypted wallet (ewallet.p12), open the wallet, and create the master key for TDE. You will also verify that TDE is enabled and the wallet is open in Enterprise Manager Database Control. Perform the following steps:
In this tutorial, you encrypt a column in the OE.CUSTOMERS table. Perform the following steps:
1. | Under Related Links, click Tables.
|
|
2. |
Enter OE in the Schema field and click Go.
|
|
3. | Select the radio button in front of CUSTOMERS and click Edit.
|
|
4. |
You can specify a different encryption algorithm and the key seed to be used for all encrypted columns in this table. Click Encryption Options.
|
|
5. |
Review the options and click Continue.
|
|
6. | Select the checkbox in the Encryption column for CREDIT_LIMIT and click Apply.
|
|
7. | A job was submitted to encrypt the column. Click the link to the job.
|
|
8. | The job succeeded. Click the Database breadcrumb.
|
In this section, you create a tablespace that is encrypted. Perform the following steps:
1. | From the Server tab in Enterprise Manager Database Control, under Storage, select Tablespaces.
|
|
2. | Click Create.
|
|
3. |
Enter OBE for the name of the tablespace and click Add under Datafiles.
|
|
4. | Enter OBE for the File Name and click Continue.
|
|
5. | Tablespace encryption protects all the objects in a tablespace by storing data in encrypted format on disk. An Oracle wallet must exist and needs to be in open state. Click Encryption Options.
|
|
6. | Review the options and click Continue.
|
|
7. | Select the Encryption checkbox and click OK.
|
|
8. | Your tablespace was created successfully. Select the OBE link from the list of Tablespaces.
|
|
9. | Notice that the Encryption option is set to Yes. Click the Database breadcrumb.
|
In this section, you create a table in the encrypted tablespace, create an index on one of the columns in the table and then access the data in that column to see what execution plan is used. Perform the following steps:
1. | Open SQLDeveloper. in Linux, open a terminal window and execute the following commands: cd $ORACLE_HOME/sqldeveloper/sqldeveloper/bin ./sqldeveloper If you receive a message asking you if you want to migrate your previous connections, click No.
|
|
2. | Create a Connection. Right-click Connections and select New Connection.
|
|
3. | Enter OE for the Connection Name, Username and Password. Enter orcl for the SID and click Test.
|
|
4. | Your test was successful. Click Connect.
|
|
5. | You first want to create a copy of the CUSTOMERS table. From the SQL Worksheet, enter the following command and click Execute. CREATE TABLE customers_obe AS SELECT * FROM customers
|
|
6. | Now you can move the table into the OBE tablespace (that is encrypted). Expand Tables and right-click CUSTOMERS_OBE and select Storage then Move Tablespace.
|
|
7. | Select the OBE tablespace from the list and click Apply.
|
|
8. | The table was moved to the OBE tablespace successfully. Click OK.
|
|
9. | Now you can create an index on the DATE_OF_BIRTH column. Enter the following command in the SQL Worksheet area and click Execute. CREATE INDEX customers_obe_idx ON customers_obe(date_of_birth)
|
|
10. | You can now select some data from the DATE_OF_BIRTH column. Enter the following command in the SQL Worksheet area and click Execute. SELECT cust_last_name, date_of_birth FROM customers_obe WHERE date_of_birth > '04-FEB-59' AND date_of_birth < '06-FEB-59'
The data is selected. So what explain plan did it use. Click the Explain Plan icon.
|
|
11. | Notice that it used the index and did an index(range scan) to retrieve the data rather than a full table scan.
|
The database master key can be regenerated if it has been compromised. Perform the following steps:
1. | From the Server tab in Enterprise Manager Database Control, under Security, select Transparent Data Encryption. .
|
|
2. | Click the + in front of Advanced Options.
|
|
3. | Under Regenerate Master Database Key, click Regenerate. Enter welcome1 for the Encryption Wallet Password and click OK.
|
|
4. | Your Master Database Key was regenerated.
|
You can disable Transparent Data Encryption by closing the wallet. Perform the following steps:
1. |
Click the Close Wallet checkbox and click OK.
|
|
2. |
The wallet was closed. To verify that Transparent Data Encryption is disabled, you will select data from the encrypted column you created earlier. Click the Database breadcrumb.
|
|
3. |
Scroll to the bottom of the page, under Related Links, click SQL Worksheet.
|
|
4. | Enter the following command in the SQL Command area and click Execute.
|
|
5. | Since the column is encrypted, the wallet needs to be open for the data to be queried. Leave this window open and switch back to Enterprise Manager.
|
To reopen the wallet, perform the following steps:
1. | From the Server tab in Enterprise Manager Database Control, under Security, select Transparent Data Encryption. .
|
|
2. | Under Enable Transparent Data Encryption, enter your password in the Encryption Wallet Password field and click OK.
|
|
3. | You wallet is now open.
|
|
4. | Switch back to SQL Worksheet and reexecute the query. Notice this time, the column data appears.
|
In this tutorial, you learned how to:
Prepare the database for encryption | ||
Encrypt a column in an existing table | ||
Create an encrypted tablespace | ||
Regenerate the database master key | ||
Close and reopen the wallet |