How to clone encrypted PDBs without "shared keys"

During my time as the TDE and OKV PM, I always struggled to understand where customers get command snippets from that never show up in any MOS note, let alone in the TDE documentation.

One of my favorites is "using shared key" when cloning encrypted PDBs. This part of the cloning command isn't documented, and Google doesn't find it either — it remains a mystery where it comes from, but it comes up pretty often.

The unintended consequence of using "shared key" when cloning encrypted PDBs is that all clones from that source database end up with the SAME TDE master key. Nobody wants that.

When an (encrypted) PDB is cloned, that clone is (per definition) 100% identical, and that includes the TDE master key. If you've paid attention to the TDE documentation, you'll have noticed it's recommended to tag a key, for example "FINPDB 2026-08-17 21:06:36Z" (tags are only supported by the TDE wallet and Oracle Key Vault). If that's the key of your source PDB, it will be the same key in the clone. There's the discrepancy already: a cloned PDB with a new name (say, CLONEPDB) still carries a TDE master key with the tag of the source PDB.

If you try to clone that clone again, Oracle throws an error about a missing key because  CLONEPDB doesn't have its own key yet. That error goes away if you add "using shared key" to the command, which is presumably why people reach for it: it makes the immediate error disappear. But it doesn't fix the actual problem, it just extends the shared-key chain one link further, so now three PDBs share one master key instead of two.

The correct way is a SET KEY operation in CLONEPDB, regardless of TDE wallet or OKV:

ADMINISTER KEY MANAGEMENT SET KEY
  USING TAG 'CLONEPDB 2026-08-17 21:53:07Z'
  FORCE KEYSTORE
  IDENTIFIED BY <keystore_password>|EXTERNAL STORE
  [WITH BACKUP];

Now CLONEPDB has its own master key, tagged with its own identity, and any further clones of CLONEPDB won't need shared keys at all.

__________________________________________________________________________________________
Contact me via email or WhatsApp, I read every message.
 

Comments

Popular posts from this blog

TDE Healthcheck

Upgrade encrypted databases to 26ai

Encryption and Compression in Exadata: How It Really Works