1、修改sqlnet.ora文件,将下列属性加入文件末尾
ENCRYPTION_WALLET_LOCATION=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=/home/oracle/app/oracle/admin/GZADB/GZADB_wallet/)))
最后面的路径为oracle_home下实例的路径GZADB_wallet目录需要自己建
2、创建密钥库
ADMINISTER KEY MANAGEMENT CREATE KEYSTORE '/home/oracle/app/oracle/admin/GZADB/GZADB_wallet' IDENTIFIED BY "123456";
3、打开wallet;注意后面的秘密要跟创建密钥库的秘密一致
alter system set encryption key identified by "123456_Abc";
4、数据库重启后开启自动打开wallet
administer key management create local auto_login keystore from keystore '/home/oracle/app/oracle/admin/GZADB/GZADB_wallet/' identified by "123456";
5、创建表空间
create tablespace tsp_cpsr_yj_province_encrypt encryption using 'AES128' default storage(encrypt)
DATAFILE '/home/oracle/app/oradata/GZADB/tsp_cpsr_yj_province_encrypt.dbf'Size 1024M
AUTOEXTEND ON
NEXT 1024M
MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL;
6、查看表空间是否加密
select tablespace_name, encrypted from dba_tablespaces;
本文结合Oracle11g、12c表空间加密整理,感谢以下大佬: