How to fix ORA-28362: Master key not found tips

 There are a lot of blogs and posts about this error on the Internet. But what we are gonna discuss in this post is the issue where the probability of occurrence is once in a million.

We started getting this error when we tried to access the encrypted tables. So the first thing we checked is the status of the oracle wallet using the below query.

set lines 100
col WRL_TYPE for a10
col WRL_PARAMETER for a40
col STATUS for a20
select * from v$encryption_wallet;
We could see that the wallet is open.

WRL_TYPE WRL_PARAMETER STATUS
---------- ---------------------------------------- --------
file /oracledba/arena/db/11.2.0.4/admin/DEV/wallet OPEN
We tried to close and open the wallet but still faced an issue. After spending some time we found that the PROD wallet was recreated recently before the clone. Since it was recreated with the same password it didn't throw any error while doing the clone and copying the wallet file from PROD to DEV was missed.
 The below command was used to reset the wallet password in PROD.
 alter system set encryption key authenticated by "oracledbaarena"; 
We have copied the wallet file from PROD to DEV. 
oracle:DEV:/oracledba/arena/db/11.2.0.4/admin/DEV/wallet> ls -lrth
total 8.0K
-rw-------. 1 oracle dba 1.3K Apr 17  2017 ewallet.p12_old
-rw-------  1 oracle dba 1.8K Jun 28 14:05 ewallet.p12
Then closed and reopened the wallet using the below commands which fixed the issue.
SQL> select * from v$encryption_wallet;

WRL_TYPE WRL_PARAMETER STATUS
---------- ---------------------------------------- --------
file /oracledba/arena/db/11.2.0.4/admin/DEV/wallet OPEN
SQL>ALTER SYSTEM SET ENCRYPTION WALLET CLOSE identified by "oracledbaarena";

System altered.

SQL> select * from v$encryption_wallet;
WRL_TYPE WRL_PARAMETER STATUS
---------- ---------------------------------------- --------
file /oracledba/arena/db/11.2.0.4/admin/DEV/wallet CLOSED

SQL>ALTER SYSTEM SET ENCRYPTION WALLET OPEN identified by "oracledbaarena";
System altered. SQL> select * from v$encryption_wallet; WRL_TYPE WRL_PARAMETER STATUS ---------- ---------------------------------------- -------- file /oracledba/arena/db/11.2.0.4/admin/DEV/wallet OPEN
After performing the above steps we could select encrypted tables without any issues.

Comments