Monday, 25 May 2020

RMAN - ORA-19913: unable to decrypt backup ORA-28365: wallet is not open Restoring from a Password-encrypted Backupset

Restoring from a Password-encrypted Backupset

Scenario : 
We first encrypt rman setting then take backup after that restore backup . It will throw error and decrypt  again restore and recover.

Error:

RMAN-03002: failure of restore command at 05/24/2020 12:55:22
ORA-19870: error while restoring backup piece /u01/app/oracle/fast_recovery_area/PLM/backupset/2020_05_24/o1_mf_nnndf_ENCRYPTION_hdn89nxx_.bkp
ORA-19913: unable to decrypt backup
ORA-28365: wallet is not open

Solution:
  • Connect to the rman utility


oracle@suse1:/u01/app/oracle/product/12.1.0/dbhome_1/dbs> rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Sun May 24 12:53:23 2020

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: PLM (DBID=1811128417)

  • Enable encryption on and set password

RMAN> SET ENCRYPTION ON IDENTIFIED BY Password ONLY; 

  • Backup Tablespace users from rman utility
RMAN> BACKUP TABLESPACE USERS TAG 'ENCRYPTION';

executing command: SET encryption
using target database control file instead of recovery catalog

Starting backup at 24-MAY-20
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=73 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=00006 name=/u01/app/oracle/oradata/plm/users01.dbf
channel ORA_DISK_1: starting piece 1 at 24-MAY-20
channel ORA_DISK_1: finished piece 1 at 24-MAY-20
piece handle=/u01/app/oracle/fast_recovery_area/PLM/backupset/2020_05_24/o1_mf_nnndf_ENCRYPTION_hdn89nxx_.bkp tag=ENCRYPTION comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-MAY-20

RMAN> ALTER SYSTEM SWITCH LOGFILE;

Statement processed
  • Try to restore tablespace while encryption is ON
RMAN>
RESTORE TABLESPACE USERS;
RMAN>

Starting restore at 24-MAY-20
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 00006 to /u01/app/oracle/oradata/plm/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/PLM/backupset/2020_05_24/o1_mf_nnndf_ENCRYPTION_hdn89nxx_.bkp
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 05/24/2020 12:55:22
ORA-19870: error while restoring backup piece /u01/app/oracle/fast_recovery_area/PLM/backupset/2020_05_24/o1_mf_nnndf_ENCRYPTION_hdn89nxx_.bkp
ORA-19913: unable to decrypt backup
ORA-28365: wallet is not open
  • Set decryption on rman setting 
RMAN> SET DECRYPTION IDENTIFIED BY Password;

executing command: SET decryption
  • Tablespace  users offline
RMAN> ALTER TABLESPACE USERS OFFLINE;

Statement processed
  • Restore tablespace users

RMAN> RESTORE TABLESPACE USERS;

Starting restore at 24-MAY-20
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 00006 to /u01/app/oracle/oradata/plm/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/PLM/backupset/2020_05_24/o1_mf_nnndf_ENCRYPTION_hdn89nxx_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/PLM/backupset/2020_05_24/o1_mf_nnndf_ENCRYPTION_hdn89nxx_.bkp tag=ENCRYPTION
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 24-MAY-20
  • Recover tablespace users 
RMAN> RECOVER TABLESPACE USERS;

Starting recover at 24-MAY-20
using channel ORA_DISK_1

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

Finished recover at 24-MAY-20

  • Tablespace online
RMAN> ALTER TABLESPACE USERS ONLINE;

Statement processed

RMAN>


No comments:

Post a Comment