In 12c, while opening a software keystore and set the software TDE master encryption key, the following errors occur:
SQL> ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY "wallet_password" CONTAINER =all;
ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY "wallet_password" CONTAINER =all
*
ERROR at line 1:
ORA-28354: Encryption wallet, auto login wallet, or HSM is already open
SQL>ADMINISTER KEY MANAGEMENT SET KEY IDENTIFIED BY "wallet_password" WITH BACKUP USING 'first_key_backup' CONTAINER = ALL;
ERROR at line 1:
ORA-28417: password-based keystore is not open
CAUSE
An auto-open wallet is created. It was working fine when the password-based keystore is open.
WORKAROUND
1) Remove the auto-open wallet cwallet.sso
$mv cwallet.sso cwallet.sso.bkp
2) Close the wallet
SQL>administer key management set keystore close;
3) Open the password based wallet
SQL>administer key management set keystore open identified by "wallet_password" ;
4) Retry the original Set Key statement
SQL>ADMINISTER KEY MANAGEMENT SET KEY IDENTIFIED BY "wallet_password" WITH BACKUP USING 'first_key_backup' CONTAINER = ALL;
keystore altered.
5) Finally re-enable auto_login
SQL>administer key management create AUTO_LOGIN keystore from keystore '<wallet directory>' identified by "wallet_password" ;