密码加密 实验


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

  • 关闭钱包

    点击(此处)折叠或打开

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

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  但其实是我们指定了密码口令
指定密码还原表空间

点击(此处)折叠或打开

RMAN> set decryption identified by oracle;

executing command: SET decryption

RMAN> restore tablespace users;

Starting restore at 09-APR-17
using channel ORA_DISK_1

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

点击(此处)折叠或打开

RMAN> recover tablespace users;

Starting recover at 09-APR-17
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 09-APR-17

RMAN> alter database open;

database opened

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

转载于:http://blog.itpub.net/31405405/viewspace-2136876/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值