Renaming a Pluggable Database (PDB)
I’ve been working on a few scripts that will be used to build new CDB/PDB environments. At the last minute, the client requested that the PDB names be specific and enumerated. So this got me thinking, is there a way to rename a Pluggable Database (PDB) after it has been built? The answer is yes!
Former co-worker at Oracle, Mike Detrick documents the process over on his blog as well (here). This brief write up will serve as a reminder to the topic as well.
To rename an Oracle Pluggable Database, the following has to be done:
1. Take the Oracle Pluggable Database offline
$ sqlplus / as sysdba
SQL > alter pluggable database <NAME> close;
SQL> alter pluggable database <NAME> open restricted;
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 OGGTST READ WRITE YES
2. Connect to the PDB and rename the PDB
SQL> alter session set container=OGGTST;
SQL> alter pluggable database rename global_name to TESTPDB;
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 TSTPDB READ WRITE YES
3. Bring the renamed PDB back online
SQL> alter session set container=CDB$ROOT;
SQL> alter pluggable database TSTPDB close;
SQL> alter pluggable database TSTPDB open read write;
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 TSTPDB READ WRITE NO
Please note that when you change the PDB name, its underlying directory structure will not change.
Enjoy!!!
Bobby Curtis
I’m Bobby Curtis and I’m just your normal average guy who has been working in the technology field for awhile (started when I was 18 with the US Army). The goal of this blog has changed a bit over the years. Initially, it was a general blog where I wrote thoughts down. Then it changed to focus on the Oracle Database, Oracle Enterprise Manager, and eventually Oracle GoldenGate.
If you want to follow me on a more timely manner, I can be followed on twitter at @dbasolved or on LinkedIn under “Bobby Curtis MBA”.
It’s remarkable designed for me to have a web page, which is beneficial for my experience.
thanks admin
My web page: eharmony special coupon code 2025
That is very fascinating, You are an overly professional blogger.
I have joined your feed and stay up for in search of extra of your
excellent post. Also, I have shared your website in my social networks
My web site; Vpn
This is a great tip especially to those new to the blogosphere.
Short but very precise info… Many thanks for sharing this one.
A must read post! https://tinyurl.com/2cab6g88 gamefly
Wow that was odd. I just wrote an really long comment but after I clicked submit my comment didn’t
show up. Grrrr… well I’m not writing all that over
again. Anyway, just wanted to say wonderful blog!
https://tinyurl.com/2c2rno87 what is a vpn meaning