1.创建目录

[oracle@db1~]$ ~ $mkdir -p /u01/app/oracle/admin/orcl/wallet

2.修改sqlnet.ora

[oracle@db1~]$ ~ $cd /u01/app/oracle/product/11.1.0/db_1/network/admin/

[oracle@db1~]$admin $ls
afiedt.buf    samples     sqlnet.ora      tnsnames.ora
listener.ora  shrept.lst  sqlnet.ora.bk2

[oracle@db1~]vim sqlnet.ora

ENCRYPTION_WALLET_LOCATION=
        (SOURCE=
                (METHOD = FILE)
                (METHOD_DATA =
                        (DIRECTORY = /u01/app/oracle/admin/orcl/wallet)))

3.创建一个加密key

SQL>alter system set encryption key identified by "welcome";

System altered.

 

4.创建一个加密表空间

SQL>CREATE TABLESPACE encts
  2  DATAFILE '$ORACLE_HOME/dbs/encts.dat' SIZE 10M
  3  ENCRYPTION
  4  DEFAULT STORAGE (ENCRYPT);

Tablespace created.

5.查看是否创建成功

SQL>select TABLESPACE_NAME,ENCRYPTED from dba_tablespaces 
  2  where tablespace_name='ENCTS'

 TABLESPACE_NAME                                                 ENC

-----------------------------------                      -------

ENCTS                                                                       YES

 

6.删除加密表空间

SQL>drop tablespace encts including contents and datafiles;

Tablespace dropped.