Prepare the Pluggable Database (PDB) Check the current name of the user defined PDB.
conn / as sysdba
show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
2 PDB$SEED READ ONLY NO 3 PDB1 READ WRITE NO
SQL> Switch to the PDB and check the names of the datafiles.
alter session set container = pdb1;
select name from v$datafile;
NAME
/u02/oradata/CDB1/pdb1/system01.dbf /u02/oradata/CDB1/pdb1/sysaux01.dbf /u02/oradata/CDB1/pdb1/undotbs01.dbf /u02/oradata/CDB1/pdb1/users01.dbf /u02/oradata/CDB1/EFB4284A464F52E3E055000000000001/datafile/o1_mf_apex_ksjoblv5_.dbf We close the PDB and open it in restricted mode.
conn / as sysdba
alter pluggable database pdb1 close;
alter pluggable database pdb1 open restricted; Rename the Pluggable Database (PDB) We switch to the PDB and rename the global name.
alter session set container=pdb1;
alter pluggable database rename global_name to pdb2; We restart the PDB and display the PDB name.
alter pluggable database close immediate; alter pluggable database open;
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
3 PDB2 READ WRITE NO
SQL> We can see this has no impact on the paths or names of the data files.
select name from v$datafile;
NAME
/u02/oradata/CDB1/pdb1/system01.dbf /u02/oradata/CDB1/pdb1/sysaux01.dbf /u02/oradata/CDB1/pdb1/undotbs01.dbf /u02/oradata/CDB1/pdb1/users01.dbf /u02/oradata/CDB1/EFB4284A464F52E3E055000000000001/datafile/o1_mf_apex_ksjoblv5_.dbf
SQL> If we want to alter them, we can perform an online move of the data files, as described here.