Encrypting Tablespace

When an entire tablespace is encrypted, all the data that is stored in this tablespace will be encrypted, so any table created in this tablespace will be encrypted as well.

Here is an example, where the first such tablespace is created, then a table is created and a row is inserted.

›_ Console

SQL> CREATE TABLESPACE securespace 

  DATAFILE '/u01/app/oracle/product/12.1.0.2/db_1/secure01.dbf' 

  SIZE 150M 

  ENCRYPTION 

  DEFAULT STORAGE(ENCRYPT); Tablespace created. 

SQL> alter session set "_ORACLE_SCRIPT"=true; 

SQL> CREATE USER user1 IDENTIFIED BY Pwd01 DEFAULT TABLESPACE notsecurespace;  

SQL> GRANT DBA To user1; 

SQL> CONNECT user1/Pwd01 

SQL> CREATE TABLE cust_payment_info  

  (first_name VARCHAR2(11),    last_name VARCHAR2(10),    order_number NUMBER(5),    credit_card_number VARCHAR2(16) ENCRYPT NO SALT,   active_card VARCHAR2(3)); 


  1. Insert one row:

›_ Console

SQL> INSERT INTO cust_payment_info 

  (first_name, last_name, order_number, credit_card_number, active_card) 

  VALUES ('John', 'White', 22, '2643282394', 'ACT'); 

2. Get the data from the table:

›_ Console

SELECT * FROM cust_payment_info;