oracle数据库备份加密,通过加密,可以保护备份文件,防止备份泄漏资料。
oracle备份加密主要是指rman的加密,exp/expdp加密是没有的。
rman加密主要有以下几种方式:
1.口令模式加密
rman> set encryption on identified by password only;
rman> backup as compressed backupset database format 'd:\oracle\backup\full_%d_%t_%t_%s' tag='fullbak';
此时恢复数据库会报错,需要制定恢复密码才可以继续进行。
rman> set decryption identified by password;
2.透明数据加密模式:
透明数据库加密模式需要使用wallet,
wallet配置:
1.更新 sqlnet.ora 文件以包含一个 encrypted_wallet_location 条目。
打开$oracle_home/network/admin目录下的sqlnet.ora添加以下条目:
encryption_wallet_location=(source=(method=file)(method_data=(directory=d:\oracle\product\10.2.0\db_1\admin)))
指定万能加密密钥创建的目录。
2.创建万能加密密钥
sqlplus /nolog
connect / as sysdba
alter system set key identified by welcome1;
关闭数据库后需要重新打开密钥
alter database set wallet open identified by welcome1
wallet创建好之后,rman备份可以用wallet选项来备份。
rman> configure encryption for database on;
rman> set encryption on;
rman> backup as compressed backupset database format 'd:\oracle\backup\full_%d_%t_%t_%s' tag='fullbak';
恢复时如果wallet关闭则恢复会报错,需要先打开wallet;
3混合模式:
混合模式是同时启用wallet和口令密码:在本机模式下,恢复使用wallet;在异地恢复时,则需要提供口令恢复
混合模式密码设置:
rman> set encryption on indentified by password;
,
