How I fixed ORA-19914: unable to encrypt backup on Oracle Database Cloud Service Instance

I am working with the Application administrator to migrate and update the Customer-to-Meter Application to Oracle Cloud. The Application is getting deployed into Oracle Weblogic on OCI and Database into Oracle Database Cloud Service.

The Application Administrator requested to take a preventive backup before he/she can start with the next step of data upgrade. When I initiated the manual backup from the console, the backup failed with the below error:

Error: DCS-10429:Request failed with RMAN Errors:RMAN-03002: failure of backup command at 09/15/2023 15:54:29 Error Stack :[RMAN-03009: failure of backup command on ORA_SBT_TAPE_2 channel at 09/15/2023 13:58:22, ORA-19914: unable to encrypt backup, ORA-28365 Cause: Request has failed with RMAN errors during the operation(s). Action: Refer to RMAN logs for more information. Work Request ID: d3f2fdff-16c8-474c-9bfa-27fc15360a2c

The error message states that there is an issue with the encryption of the backup. I checked the rman log (Location: /opt/oracle/dcs/log/<hostname>/rman/bkup/<ORACLE_UNIQUE_NAME>/).

The rman log file lists below error:

channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 02:02:05
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 09/15/2023 15:54:29

RMAN-03009: failure of backup command on ORA_SBT_TAPE_2 channel at 09/15/2023 13:58:23
ORA-19914: unable to encrypt backup
ORA-28365: wallet is not open
RMAN-03009: failure of backup command on ORA_SBT_TAPE_2 channel at 09/15/2023 13:58:22
ORA-19914: unable to encrypt backup
ORA-28365: wallet is not open

There seems to be some issue with the TDE wallet, which is used by RMAN to encrypt the backup before it is stored in the Object Storage.

Upon checking the V$ENCRPTION_WALLET dynamic view, I found that Wallet is opened with PASSWORD, but not auto_login. This is also explained in the Oracle Support Note: 2333646.1.

I followed the steps below to fix the problem:

  1. Get the TDE Wallet Location by running the command (select * from v$encryption_wallet).
  2. Navigate into TDE Wallet Location and take a backup of cwallet.sso file.
  3. Log-in to the database as sysdba, and run the command (administer key management create AUTO_LOGIN keystore from keystore ” identified by “<wallet password>”;)
  4. Restart the Database

Once, I restarted the database the V$ENCRPTION_WALLET dynamic view showed that AUTO_LOGIN was in place of PASSWORD.

Why do I face this problem? The reason is that after RMAN restore, I have to encrypt the restored datafiles. The TDE wallet was opened and closed multiple times. The last open state of the wallet remained as Password and hence RMAN was not able to do AUTO LOGIN and failed while trying to encrypt the backup pieces.

Let me know what you did to fix the issue in the comments.