Someone asked me this question recently.
The answer is: yes!
Let’s see it in action.
On the primary I have:
1 2 3 4 5 6 7 8 |
----- PRIMARY SQL> show pdbs; CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 RED READ WRITE NO 4 SAND READ WRITE NO |
And of course the same PDBs on the standby:
1 2 3 4 5 6 7 8 |
----- STANDBY SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED MOUNTED 3 RED MOUNTED 4 SAND MOUNTED |
Let’s change the PDB RED name to TOBY: The PDB rename operation is straightforward (but it requires a brief downtime). To be done on the primary:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
SQL> alter pluggable database red close; Pluggable database altered. SQL> alter pluggable database red open restricted; Pluggable database altered. SQL> alter session set container=red; Session altered. SQL> alter pluggable database rename global_name to toby; Pluggable database altered. SQL> alter session set container=cdb$root; Session altered. SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 TOBY READ WRITE YES 4 SAND READ WRITE NO SQL> alter pluggable database toby close; Pluggable database altered. SQL> alter pluggable database toby open; Pluggable database altered. SQL> |
On the standby, I can see that the PDB changed its name:
1 2 3 4 5 6 7 8 |
SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED MOUNTED 3 TOBY MOUNTED 4 SAND MOUNTED SQL> |
The PDB name change is propagated transparently with the redo apply.
—
Ludo
The following two tabs change content below.
Latest posts by Ludovico (see all)
- New views in Oracle Data Guard 23c - January 3, 2024
- New in Data Guard 21c and 23c: Automatic preparation of the primary - December 22, 2023
- Does FLASHBACK QUERY work across incarnations or after a Data Guard failover? - December 13, 2023
Hi Ludovico, thank you for this interesting article.
Is it possible to rename only a PDB on the standby CDB and keep the dataguard in sync without issues ?
In your example we would keep RED on PRIMARY and TOBY on Standby ?
thank you.
ali.