Skip to content
Home » Oracle Database » How to Resolve ORA-46659: master keys for the given PDB not found

How to Resolve ORA-46659: master keys for the given PDB not found

ORA-46659

Saw ORA-46659 when I tried to clone a PDB with TDE remotely through a database link.

SQL> create pluggable database ERPAPP_CLONE from ERPAPP@erpapp_link storage unlimited tempfile reuse file_name_convert=('ERPAPP','ERPAPP_CLONE') keystore identified by "Welcome1" parallel 16;
create pluggable database ERPAPP_CLONE from ERPAPP@erpapp_link storage unlimited tempfile reuse file_name_convert=('ERPAPP','ERPAPP_CLONE') keystore identified by "Welcome1" parallel 16
*
ERROR at line 1:
ORA-17628: Oracle error 46659 returned by remote Oracle server
ORA-46659: master keys for the given PDB not found

ORA-46659 usually means that the source PDB has no master key been set, we should check all wallet statuses of the source database.

SQL> select inst_id, con_id, wallet_type, status from gv$encryption_wallet order by 1,2;

   INST_ID     CON_ID WALLET_TYPE          STATUS
---------- ---------- -------------------- ------------------------------
         1          1 AUTOLOGIN            OPEN
         1          2 AUTOLOGIN            OPEN
         1          3 AUTOLOGIN            OPEN
         1          4 AUTOLOGIN            OPEN
         2          1 AUTOLOGIN            OPEN
         2          2 AUTOLOGIN            OPEN
         2          3 AUTOLOGIN            OPEN
         2          4 AUTOLOGIN            OPEN

They look no problem at all.

Solution

So I decide to take the key to the destination as well by adding INCLUDING SHARED KEY.

SQL> create pluggable database ERPAPP_CLONE from ERPAPP@erpapp_link storage unlimited tempfile reuse file_name_convert=('ERPAPP','ERPAPP_CLONE') keystore identified by "Welcome1" including shared key parallel 16;

Pluggable database created.

Is it a bug or something? I supposed that release 19.13 was a pretty decent patch level.

2 thoughts on “How to Resolve ORA-46659: master keys for the given PDB not found”

  1. This is a great post. I am giving you a gold star, Ed. Even Oracle Support did not have clear and concise direction for this error (at least, I could not find it). Using “including shared key” resolved my issue. Interesting thing is – the other 3 databases did not require this. I wonder why?

Leave a Reply

Your email address will not be published. Required fields are marked *