Security Guide > Security Guide > Using Data at Rest Encryption > Unlocking an Encrypted Database
Was this helpful?
Unlocking an Encrypted Database
There are two ways to unlock an encrypted database.
To directly unlock the encrypted database follow these steps:
a. Connect to the database:
sql mydb -no_x100
Note:  When connecting to a locked encrypted database to enable the passphrase, you must connect with the option -no_x100.
b. Use your passphrase to unlock the database.
Note:  If the passphrase contains blanks, it must be enclosed in single quotes:
ENABLE PASSPHRASE 'my passphrase';
To unlock the encrypted database using iidbdb follow these steps:
a. Connect to database iidbdb:
sql iidbdb
b. Use your passphrase and the ON DATABASE option:
ENABLE PASSPHRASE 'my passphrase' ON DATABASE mydb;
Database encryption is transparent to the application
The following example creates a table in an encrypted database, inserts rows in a table, and then selects them:
CREATE TABLE socsec1
(fname CHAR(10),
lname CHAR(20),
socsec CHAR(11)
INSERT INTO socsec1 VALUES ('John', 'Smith', '012-33-4567');
INSERT INTO socsec1 VALUES ('Lois', 'Lane', '010-40-1234');
INSERT INTO socsec1 VALUES ('Charlie', 'Brown', '012-44-9876');
 
SELECT * FROM socsec1;
The following results are returned:
+----------+--------------------+-----------+
|fname     |lname               |socsec     |
+----------+--------------------+-----------+
|John      |Smith               |012-33-4567|
|Lois      |Lane                |010-40-1234|
|Charlie   |Brown               |012-44-9876|
+----------+--------------------+-----------+
(3 rows)
As shown by the plain text values in all columns, the encryption is transparent to the application (in this case, the SQL terminal monitor).
Last modified date: 12/19/2024