What is the cause and solution for Oracle error ORA-28374: typed master key not found in wallet?
Cause:
The temporary tablespace being utilized is associated with a master key which does not exist in the keystore (wallet) for the database. This is a consequence of how the temporary tablespace was created.
The behavior is observed to be intermittent because:
A) If the TDE implementation is otherwise healthy, encrypted tablespaces storing system and user data will abe associated with a master key that does exist in the keystore. Otherwise, TDE would not be able to function at all.
B) The missing master key (for the temporary tablespace) will only be requested by the database in order to perform operations involving temporary data, such as sorting. Queries that do not require sorting, or other temporary data usage, will not encounter ORA-28374 for this reason.
Solution:
Drop and recreate the offending temporary tablespace(s), without reusing any datafiles. The datafiles cannot be used because these also contain references to TDE master keys.