Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • rm_backup_arch_file.ksh Linux/Unix
  • plan10g.sql good1 Oracle
  • export import with parameter file. Oracle
  • Kernel Parameters for Solaris Linux/Unix
  • TNSNAMES entries details Oracle
  • grep multuple patterns Linux/Unix
  • Jai Shree Ram Oracle
  • Temporary Tablespsace Temp tablespace behaviour Oracle
  • eplan.sql Oracle
  • New Latest Param.sql for finding all hidden parameters also Oracle
  • send email from unix mailx with attachment. Linux/Unix
  • pvm_metric.sql for gathering report from vmstat tables Oracle
  • findobj.sql Oracle
  • run this before doing any dbchange pvm_pre_change.sql Oracle
  • ORA-4031 issue and solution on 09-MAY-2008 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.
Next Post: AMC10

Related Posts

  • Find All internal Parameters Oracle
  • Exadata Basics Oracle
  • refre.sql Oracle
  • New OFA for 11g Oracle
  • Oracle 10g Wait Model Oracle
  • DBA_HIST_SQLSTAT contents Oracle

Leave a Reply Cancel reply

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

Categories

  • AMC10 (0)
  • 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 (9)
  • Videos (0)

Recent Posts

  • Tutornet.US — Source of excellent learning14-Oct-2026
  • OCI Infrastructure Patching14-Oct-2026
  • Free API credits for AI models14-Oct-2026
  • AMC1020-Sep-2026
  • 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

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Import and export statements Oracle
  • Does DBMS_JOB recompute the NEXT_DATE interval after or before Oracle
  • Rollback force for distributed transactions Oracle
  • ORA-4031 issue and solution on 09-MAY-2008 Oracle
  • Backup and Recovery Scenarios Oracle
  • arch_configUOCIOTTO.ora Oracle
  • dbms_job.submit example Oracle
  • Check_recovery.sh program to run sqlplus and return its values remotely. Linux/Unix

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme