ITPub博客

首页 > 数据库 > Oracle > 密码加密 实验

密码加密 实验

原创 Oracle 作者:刘锡亚 时间:2017-04-09 19:45:56 0 删除 编辑

口令加密需要在创建和还原加密备份时提供口令。还原用口令加密的备份需要创建该备份时使用的同一口令。口令加密。对于在远程位置还原的备份非常有用,但必须在传输过程中保证备份的安全。口令加密不能永久性配置。如果要完全使用口令加密,则不需要配置Oracle Wallet

  • 关闭钱包

    点击(此处)折叠或打开

    1. SQL> alter system set encryption wallet close identified by oracle;

    2. System altered.

  • 关闭RMAN加密

    点击(此处)折叠或打开

    1. RMAN> configure encryption for database clear;

    2. using target database control file instead of recovery catalog
    3. old RMAN configuration parameters:
    4. CONFIGURE ENCRYPTION FOR DATABASE ON;
    5. RMAN configuration parameters are successfully reset to default value
  • RMAN命令行设置密码并备份user表空间

    点击(此处)折叠或打开

    1. RMAN> set encryption on identified by oracle only;

    2. executing command: SET encryption

    3. RMAN> backup tablespace users;

    4. Starting backup at 09-APR-17
    5. allocated channel: ORA_DISK_1
    6. channel ORA_DISK_1: SID=38 device type=DISK
    7. channel ORA_DISK_1: starting full datafile backup set
    8. channel ORA_DISK_1: specifying datafile(s) in backup set
    9. input datafile file number=00004 name=/u01/app/oracle/oradata/PROD1/users01.dbf
    10. channel ORA_DISK_1: starting piece 1 at 09-APR-17
    11. channel ORA_DISK_1: finished piece 1 at 09-APR-17
    12. piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/04s19cbc_1_1 tag=TAG20170409T193716 comment=NONE
    13. channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
    14. Finished backup at 09-APR-17

  • 关闭数据库 启动到mount状态

    点击(此处)折叠或打开

    1. RMAN> shutdown immediate

    2. database closed
    3. database dismounted
    4. Oracle instance shut down

    5. RMAN> startup mount;

    6. connected to target database (not started)
    7. Oracle instance started
    8. database mounted

    9. Total System Global Area 830930944 bytes

    10. Fixed Size 2257800 bytes
    11. Variable Size 536874104 bytes
    12. Database Buffers 289406976 bytes
    13. Redo Buffers 2392064 bytes
  • 恢复user表空间 报错

    点击(此处)折叠或打开

    1. RMAN> restore tablespace users;

    2. Starting restore at 09-APR-17
    3. allocated channel: ORA_DISK_1
    4. channel ORA_DISK_1: SID=18 device type=DISK

    5. channel ORA_DISK_1: starting datafile backup set restore
    6. channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    7. channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/PROD1/users01.dbf
    8. channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/11.2.0/dbhome_1/dbs/04s19cbc_1_1
    9. RMAN-00571: ===========================================================
    10. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    11. RMAN-00571: ===========================================================
    12. RMAN-03002: failure of restore command at 04/09/2017 19:38:02
    13. ORA-19870: error while restoring backup piece /u01/app/oracle/product/11.2.0/dbhome_1/dbs/04s19cbc_1_1
    14. ORA-19913: unable to decrypt backup
    15. ORA-28365: wallet is not open
    16. 虽然报错指wallet 没有open  但其实是我们指定了密码口令
  • 指定密码还原表空间

    点击(此处)折叠或打开

    1. RMAN> set decryption identified by oracle;

    2. executing command: SET decryption

    3. RMAN> restore tablespace users;

    4. Starting restore at 09-APR-17
    5. using channel ORA_DISK_1

    6. channel ORA_DISK_1: starting datafile backup set restore
    7. channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    8. channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/PROD1/users01.dbf
    9. channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/11.2.0/dbhome_1/dbs/04s19cbc_1_1
    10. channel ORA_DISK_1: piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/04s19cbc_1_1 tag=TAG20170409T193716
    11. channel ORA_DISK_1: restored backup piece 1
    12. channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
    13. Finished restore at 09-APR-17


    点击(此处)折叠或打开

    1. RMAN> recover tablespace users;

    2. Starting recover at 09-APR-17
    3. using channel ORA_DISK_1

    4. starting media recovery
    5. media recovery complete, elapsed time: 00:00:00

    6. Finished recover at 09-APR-17

    7. RMAN> alter database open;

    8. database opened

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31405405/viewspace-2136876/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 透明加密 实验
请登录后发表评论 登录
全部评论

注册时间:2016-10-25

  • 博文量
    13
  • 访问量
    18653