OCP043第十五讲 Database Security(四)

2014-11-24 11:32:20 · 作者: · 浏览: 2
s
6. Starting "HR"."SYS_EXPORT_TABLE_01": hr/******** directory=dir01 dumpfile=2.dmp tables=t04315_c
7. Estimate in progress using BLOCKS method...
8. Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
9. Total estimation using BLOCKS method: 64 KB
10. Processing object type TABLE_EXPORT/TABLE/TABLE
11. . . exported "HR"."T04315_C" 5.218 KB 1 rows
12. ORA-39173: Encrypted data has been stored unencrypted in dump file set.
13. Master table "HR"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
14. ******************************************************************************
15. Dump file set for HR.SYS_EXPORT_TABLE_01 is:
16. /home/oracle/dir01/2.dmp
17. Job "HR"."SYS_EXPORT_TABLE_01" completed with 1 error(s) at 09:19:40
\\\



2.外部表加密,只能针对datapump外部表进行加密
1. SQL> create table t04315_ext (a,b encrypt identified by oracle123)
2. 2 organization external
3. 3 (type oracle_datapump
4. 4 default directory dir01
5. 5 location ('3.dmp'))
6. 6 reject limit unlimited
7. 7* as select * from t04315_c;
8. Table created
三:加密rman备份数据
rman备份的加密分三类:透明模式(钱夹)加密,密码模式加密,双重模式加密;oracle会自动归档主密钥和密码的变更,rman备份加密必须要把compatible参数设置到10.2.0以上
1.透明模式,适用于本地的oracle备份和恢复操作,需要有主密钥,rman备份加密的算法主要有3种
1. SQL> select ALGORITHM_ID,ALGORITHM_NAME from V$RMAN_ENCRYPTION_ALGORITHMS;
2. ALGORITHM_ID ALGORITHM_
3. ------------ ----------
4. 1 AES128
5. 2 AES192
6. 3 AES256
7.
8. RMAN> CONFIGURE ENCRYPTION FOR DATABASE ON;
9. new RMAN configuration parameters:
10. CONFIGURE ENCRYPTION FOR DATABASE ON;
11. new RMAN configuration parameters are successfully stored
12.
13. RMAN> CONFIGURE ENCRYPTION ALGORITHM 'AES256';
14. new RMAN configuration parameters:
15. CONFIGURE ENCRYPTION ALGORITHM 'AES256';
16. new RMAN configuration parameters are successfully stored
17.
18. RMAN> list backupset;
19. RMAN> backup tablespace users;
20.
21. SQL> conn /as sysdba
22. Connected.
23. SQL> alter tablespace users offline immediate;
24. Tablespace altered.
25.
26. SQL> alter tablespace users online;
27. alter tablespace users online
28. *
29. ERROR at line 1:
30. ORA-01113: file 4 needs media recovery
31. ORA-01110: data file 4: '/u01/app/oradata/ora10g/users01.dbf'
32.
33. SQL> alter system set encryption wallet close;
34. System altered.
35.
36. RMAN> restore tablespace users;
37. RMAN-00571: ===========================================================
38. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
39. RMAN-00571: ===========================================================
40. RMAN-03002: failure of restore command at 08/12/2011 10:12:11
41. ORA-19870: error reading backup piece /u01/app/flash_recovery_area/ORA10G/backupset/xxxxx
42. ORA-19913: unable to decrypt backup
43. ORA-28365: wallet is not open
44.
45. SQL> alter system set encryption wallet open identified by "oracle456";
46. System altered
47.
48. RMAN> restore tablespace users;
49. RMAN> recover tablespace users;
50. RMAN> sql "alter tablespace users online";
51. sql statement: alter tablespace users online
2.密码模式加密,适用于加密rman备份的异机恢复
1. RMAN> set encryption on identified by a123456 only;
2. executing command: SET encryption
3. using target database control file instead of recovery cata