A technical troubleshooting blog about Oracle with other Databases & Cloud Technologies.

How To Rename A Pluggable Database ( PDB)

1 min read

The following explains how to rename a container (pluggable databases).

Step-By-Step

1. Shutdown the pluggable database (PDB).

SQL> show pdbs;

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------ ---------- ----------
	 3 SHAPDB			  READ WRITE NO

SQL> shu immediate;
Pluggable Database closed.

2. Startup the PDB in restricted mode

SQL> show pdbs;

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ----------------------------- ----------
	 3 SHAPDB			  MOUNTED

SQL> startup open restrict;
Pluggable Database opened.

SQL> show pdbs;

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------ ---------- ----------
	 3 SHAPDB			  READ WRITE YES

(OR)
CDB:

Alter pluggable database SHAPDB open restricted;

3. Rename the PDBs

SQL> alter pluggable database SHAPDB rename global_name to ORCL;
Pluggable database altered.

SQL> show pdbs;
    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------ ---------- ----------
	 3 ORCL 			  READ WRITE YES

4. Restart the PDB

SQL> shu immediate;
Pluggable Database closed.

SQL> startup
Pluggable Database opened.

SQL> show pdbs;

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------ ---------- ----------
	 3 ORCL 			  READ WRITE NO

(or)
From CDB:

SQL> alter pluggable database ORCL open READ WRITE;