口令加密需要在创建和还原加密备份时提供口令。还原用口令加密的备份需要创建该备份时使用的同一口令。口令加密。对于在远程位置还原的备份非常有用,但必须在传输过程中保证备份的安全。口令加密不能永久性配置。如果要完全使用口令加密,则不需要配置Oracle Wallet
- 关闭钱包
点击(此处)折叠或打开
- SQL> alter system set encryption wallet close identified by oracle;
System altered.
关闭RMAN加密
点击(此处)折叠或打开
- RMAN> configure encryption for database clear;
-
- using target database control file instead of recovery catalog
- old RMAN configuration parameters:
- CONFIGURE ENCRYPTION FOR DATABASE ON;
- RMAN configuration parameters are successfully reset to default value
点击(此处)折叠或打开
- RMAN> set encryption on identified by oracle only;
-
- executing command: SET encryption
-
- RMAN> backup tablespace users;
-
- Starting backup at 09-APR-17
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: SID=38 device type=DISK
- channel ORA_DISK_1: starting full datafile backup set
- channel ORA_DISK_1: specifying datafile(s) in backup set
- input datafile file number=00004 name=/u01/app/oracle/oradata/PROD1/users01.dbf
- channel ORA_DISK_1: starting piece 1 at 09-APR-17
- channel ORA_DISK_1: finished piece 1 at 09-APR-17
- piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/04s19cbc_1_1 tag=TAG20170409T193716 comment=NONE
- channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
- Finished backup at 09-APR-17
关闭数据库 启动到mount状态
点击(此处)折叠或打开
- RMAN> shutdown immediate
-
- database closed
- database dismounted
- Oracle instance shut down
-
- RMAN> startup mount;
-
- connected to target database (not started)
- Oracle instance started
- database mounted
-
- Total System Global Area 830930944 bytes
-
- Fixed Size 2257800 bytes
- Variable Size 536874104 bytes
- Database Buffers 289406976 bytes
- Redo Buffers 2392064 bytes
点击(此处)折叠或打开
- RMAN> restore tablespace users;
-
- Starting restore at 09-APR-17
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: SID=18 device type=DISK
-
- 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
- RMAN-00571: ===========================================================
- RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
- RMAN-00571: ===========================================================
- RMAN-03002: failure of restore command at 04/09/2017 19:38:02
- ORA-19870: error while restoring backup piece /u01/app/oracle/product/11.2.0/dbhome_1/dbs/04s19cbc_1_1
- ORA-19913: unable to decrypt backup
- ORA-28365: wallet is not open
- 虽然报错指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
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/