Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • 556976.1 Oracle Clusterware: Components installed Oracle
  • How to Use DBMS_STATS to Move Statistics to a Different Database Oracle
  • Oracle Support Metalink ID 161818.1 Oracle
  • xargs use Linux/Unix
  • S3 Basic info AWS
  • perf_today.sql Oracle
  • before_trunc.sql Before Truncate table needs to execute following: Oracle
  • MYSQL and Oracle Comparison for Oracle DBA MYSQL
  • ORA-3136 Oracle
  • My Test Case On 21-OCT-2005 Oracle
  • export import with parameter file. Oracle
  • Deleting first line and lastline of a file using sed Linux/Unix
  • findx.sql /* Find Indexes on specified USER.TABLE_NAME */ Oracle
  • Adding or Dropping Online Redo Log Files When Physical Standby in place Oracle
  • sql_plan9i.sql Oracle

Key Management in Oracle: The Core Issue: Missing Master Key

Posted on 12-May-202612-May-2026 By Admin No Comments on Key Management in Oracle: The Core Issue: Missing Master Key

Here is the step-by-step summary of the issue and the resolution, including the exact commands used.

1. The Core Issue: Missing Master Key

In an Oracle Cloud (OCI) environment, every Pluggable Database (PDB) must have its own “Master Encryption Key” stored in a secure file called a Wallet. When you tried to clone YOURPDB, the operation failed because this specific PDB had never been assigned its own key.

How we checked for the missing key:

SQL

-- Run in Source CDB
SELECT CON_ID, KEY_ID FROM V$ENCRYPTION_KEYS 
WHERE CON_ID = (SELECT CON_ID FROM V$PDBS WHERE NAME = 'YOURPDB');
-- Result was "no rows selected," confirming the key was missing.

2. The Hurdle: Auto-Login vs. Password

OCI databases usually run with an Auto-Login wallet. This is a “read-only” mode that allows the database to start up automatically. However, you cannot create a new key while the wallet is in this read-only mode. We had to manually “log in” with the administrative password to gain write access.

How we gained write access (at the CDB level):

SQL

-- Step A: Close the "Read-Only" session
ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE;

-- Step B: Open the "Write" session using your password
ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY "Your_Password";

-- If this is giving error for ORA-28354: encrypt or decrypt output file cannot be created (or the related ORA-28374) occurs because you are attempting to perform a write operation—opening a keystore with a password—while the database is already using an AUTOLOGIN wallet.

3. The Fix: Creating the PDB Key

Once we had write access at the top level, we had to go specifically into the PDB and tell Oracle to generate a new unique key for it.

How we created the new key:

SQL

-- Step C: Move into the PDB
ALTER SESSION SET CONTAINER = YOURPDB;

-- Step D: Open the PDB's specific "drawer" in the wallet
ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY "Your_Password";

-- Step E: Create and activate the new Master Key
ADMINISTER KEY MANAGEMENT SET KEY IDENTIFIED BY "Your_Password" WITH BACKUP;

4. The Result: Success

After running these, the PDB finally had a “Master Key ID.” You verified this by running the query again and seeing a long string of numbers and letters (the KEY_ID) assigned to your PDB.

The final verification query:

SQL

SELECT CON_ID, KEY_ID, ACTIVATION_TIME FROM V$ENCRYPTION_KEYS;

Summary for your records:

  • The Error: ORA-28374 meant the PDB was “unlocked” but had no key to move.
  • The Fix: We used the admin password to create a unique key for the PDB.

Oracle

Post navigation

Previous Post: SAT Mathematics 10 questions and answer at the end.

Related Posts

  • SQL_PLAN.sql for checking real execution plan Oracle
  • Renaming Oracle Instance Name Oracle
  • Does DBMS_JOB recompute the NEXT_DATE interval after or before Oracle
  • tblwopk.sql /* Find Tables Without PK */ Oracle
  • ENQ: KO – FAST OBJECT CHECKPOINT tips Oracle
  • find_longsql.sql Oracle

Leave a Reply Cancel reply

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

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (150)
  • MYSQL (5)
  • Oracle (403)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (18)
  • rman-dataguard (26)
  • shell (151)
  • SQL scripts (349)
  • SQL Server (6)
  • Uncategorized (5)
  • Videos (0)

Recent Posts

  • Key Management in Oracle: The Core Issue: Missing Master Key12-May-2026
  • SAT Mathematics 10 questions and answer at the end.30-Apr-2026
  • top 10 AI news today30-Apr-2026
  • runon_allpdbs_show_conname.sh23-Apr-2026
  • runon_allcdbs_find_pdbs.sh23-Apr-2026
  • Running PDB on single node in RAC09-Apr-2026
  • find_arc.sql09-Apr-2026
  • pvm_pre_change.sql08-Apr-2026
  • find_encr_wallet.sql08-Apr-2026
  • find_pdbs.sql08-Apr-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • pvm_rbs1.sql (to collect rbs info from db) Oracle
  • Optimizer_Index init.ora parameter explaination. Oracle
  • How to calculate PROCESSES parameter Oracle
  • Best approach for Oracle database patching sequence to latest/required patchset along with CPU/PSU/any-other-one-off patch ID 865255.1 Oracle
  • run this before doing any dbchange pvm_pre_change.sql Oracle
  • How To Resolve Stranded DBA_2PC_PENDING Entries ID 401302.1 (Very Good prooven) Oracle
  • avail.sh ( find filesystem spae usage) Linux/Unix
  • Pending Transaction Neighbors Script Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme