Rename Pluggable Database

Introduction:

This document is intended for DBA’s who need to know how to change the name of the existing PDB in a multitenant database. Oracle’s multitenant architecture has revolutionized database management, but renaming a PDB can be a challenging task. In this concise guide, we’ll walk you through the process step-by-step, ensuring a seamless transition without compromising data integrity.

Why we need to do:

There might be a situation when you created a pluggable database with the wrong name then it’s not time to worry, you can simply rename it using rename command, in another situation where the client requested to change the name of the pluggable database, then rename command will do amazing work. Here we will discuss renaming Oracle PDB.

Steps to rename the PDB:

1.Connect to the Sqlplus as SYSDBA and review the PDBs,

SQL> sho pdbs;

CON_ID CON_NAME       OPEN MODE    RESTRICTED

———- ————————  ———-            ———-

2 PDB$SEED                  READ ONLY     NO

3 PDBRENAME              READ WRITE  NO

 

2.Close the pluggable database that needs to be renamed,

SQL> alter pluggable database PDBRENAME close;

Pluggable database altered.

 

3.Open the Pluggable database in restricted mode,

SQL> alter pluggable database PDBRENAME open restricted;

Pluggable database altered.

 

4.Connect to the pluggable database,

SQL> alter session set container=PDBRENAME;

Session altered.

 

5.Rename the pluggable database,

SQL> alter pluggable database rename global_name to NEWNAME;

Pluggable database altered.

 

6.Review the PDB’s,

SQL> sho pdbs

CON_ID CON_NAME         OPEN MODE  RESTRICTED

———- ————————- ———-            ———-

3 NEWNAME                READ WRITE    YES

 

7.Close and Open the pluggable database,

SQL> alter pluggable database close immediate;

Pluggable database altered.

 

SQL> alter pluggable database open;

Pluggable database altered.

 

8.The Pluggable database is renamed,

SQL> sho pdbs

CON_ID CON_NAME               OPEN MODE  RESTRICTED

———- —————————— —————-    ———-

3 NEWNAME                         READ WRITE NO

 

Conclusion:

In conclusion, renaming PDBs in a multitenant database demands careful execution, considering data integrity and potential challenges. With the knowledge gained from this guide, you’re now equipped to confidently navigate the process and optimize your multitenancy environment.

Recent Posts

Start typing and press Enter to search