Tag Archives: Check tablespace is encryted

Steps to configure Wallet in Oracle

Setup wallet in Oracle database

Following are the steps to configured the wallet in Oracle Database:

1. Make entry into the sqlnet.ora file

ENCRYPTION_WALLET_LOCATION=
(SOURCE=(METHOD=FILE)(METHOD_DATA=
(DIRECTORY=E:\oracle\Encrypt_Wallet)))

2. Run the following command it will automatically create wallet

-- 10g version
sqlplus / as sysdba
ALTER SYSTEM SET ENCRYPTION KEY AUTHENTICATED BY "Password";

-- 11g version
sqlplus / as sysdba
ALTER SYSTEM SET ENCRYPTION KEY IDENTIFIED BY "password";

3. Login with sqlplus Check any wallet is configured and status is open/closed:

select * from v$ENCRYPTION_WALLET;

4. Close the system wallet

ALTER SYSTEM SET ENCRYPTION WALLET CLOSE;

--ORA-28390: auto login wallet not open but encryption wallet may be open
alter system set encryption wallet close identified by "password"

5. Open the system wallet

ALTER SYSTEM SET ENCRYPTION WALLET OPEN IDENTIFIED BY "password";

6. Enable encryption for table columns and tablespace during creation.
Note: You cannot encrypt the existing tablespace. Need to move table from existing tablespace to encrypted tablespace.

--Encrypt the column
ALTER TABLE employee MODIFY (salary ENCRYPT);

--Decyprt the column
ALTER TABLE employee MODIFY (salary DECRYPT);

--tablespace encryption at creation time.
create tablespace userts datafile 'C:\oradata\usersts01.dbf'
size 1M autoextend on next 1M encryption using 'AES128' default storage (encrypt);

7. Check the tables present with encrypted columns:

SET LINESIZE 100
COLUMN owner FORMAT A15
COLUMN tble_name FORMAT A15
COLUMN column_name FORMAT A15
SELECT * FROM dba_encrypted_columns;

8. You can also create tablespace for encryption but you need to create it new and move the object to it.

SELECT tablespace_name, encrypted FROM dba_tablespaces;