How to Rename PDB Database in 19c Database
Summary
Here
I will rename JIOPDB to AIRTELPDB
Connect
to the CDB and check the information about the PDB first
Open
PDB in restricted mode.
Rename
the PDB. You must be connected to the PDB to rename it.
Close
and open the PDB.
Connect
to the CDB and check the information about the PDB first
SQL>
select name, open_mode, restricted from v$pdbs;
SQL>
select name, con_id, dbid,con_uid,guid from v$containers order by con_id;
SQL>
select service_id,name,network_name,creation_date,pdb,con_id from cdb_services;
Open
PDB in restricted mode
SQL>
select name, open_mode, restricted from v$pdbs;
NAME OPEN_MODE RES
--------------------
---------- ---
PDB$SEED READ ONLY NO
TESTPDB READ WRITE NO
JIOPDB READ WRITE NO
SQL>
alter pluggable database JIOPDB close;
Pluggable
database altered.
SQL>
alter pluggable database JIOPDB open restricted;
Pluggable
database altered.
SQL>
Rename
the PDB. You must be connected to the PDB to rename it.
SQL>
alter session set container="JIOPDB";
Session
altered.
SQL>
alter pluggable database JIOPDB rename global_name to airtelpdb;
Pluggable
database altered.
SQL>
Note:
-
If
you are not in restricted mode will get below error:
SQL>
alter pluggable database DEVPDB rename global_name to clonepdb;
alter
pluggable database DEVPDB rename global_name to clonepdb
*
ERROR
at line 1:
ORA-65045:
pluggable database not in a restricted mode
Close
and open the PDB
SQL>
alter pluggable database close immediate;
Pluggable
database altered.
SQL>
alter pluggable database open;
Pluggable
database altered.
SQL>
select name, open_mode from v$pdbs;
NAME OPEN_MODE
--------------------
----------
AIRTELPDB READ WRITE
Reference:
-
Rename a Pluggable Database In Oracle 12c (Doc ID 2439885.1).
Comments
Post a Comment