Renaming a Oracle Pluggable Database (PDB)

Note renaming a PDB does not automatically rename its associated directories or data files.
If you need to rename those, you can use the ALTER DATABASE MOVE DATAFILE command.

  1. Close PDB we are going to rename
    sqlplus / as sysdba
    ALTER PLUGGABLE DATABASE <current name> CLOSE IMMEDIATE;
  2. Open the PDB in restricted mode:
    ALTER PLUGGABLE DATABASE orclpdbee OPEN RESTRICTED;
  3. Rename the PDB:
    ALTER SESSION SET CONTAINER = <current name>;
    ALTER PLUGGABLE DATABASE RENAME GLOBAL_NAME TO <new name>;
    Restart the PDB:
  4. Close the PDB again:
    ALTER PLUGGABLE DATABASE CLOSE IMMEDIATE;
  5. ALTER PLUGGABLE DATABASE OPEN;
  6. Verify the Changes:
    SHOW PDBS;