Steps To Change PDB NAME


STEP 1: Check PDB status in both the node

NAME                                    OPEN_MODE  RESTRICTED

------------------------------ ---------- ------------------------------

TEST01                                  READ WRITE NO

TEST01                                  READ WRITE NO

STEP 2: Validate basic information related to target PDB

SQL> select name,con_id,dbid,con_uid,guid from v$containers order by con_id;

NAME                                          CON_ID  DBID          CON_UID GUID

------------------------------ ---------- ---------- ---------- -----------

CDB$ROOT                         1  846718669       1 86B637B62FDF7A65E053F706E80A27CA

PDB$SEED                         2 4171422238 4171422238 22EDD25528C83F07E0630701A8C0B617

TEST01                           3 1767643166 1767643166 22EDFFF300C9602EE0630701A8C01F01

STEP 3: Collect database's Service Information

 SQL> select service_id,name,network_name,creation_date,pdb,con_id from cdb_services; 

SERVICE_ID NAME                                       NETWORK_NAME      CREATION_ PDB                            CON_ID

---------- ---------------------------------------- -------------------- --

       1 SYS$BACKGROUND                               17-APR-19 CDB$ROOT                 1

       2 SYS$USERS                                          17-APR-19 CDB$ROOT                1

       3 UK_PRIM                        UK_PRIM       29-SEP-24 CDB$ROOT                 1

       5 ORAPRIMXDB                           ORAPRIMXDB            25-SEP-24 CDB$ROOT                1

       6 ORA_PRIM                       ORA_PRIM            25-SEP-24 CDB$ROOT                1

       8 TEST01                         TEST01        25-SEP-24 TEST01             3

       1 TEST01_SVC                           TEST01_SVC            29-SEP-24 TEST01            3

7 rows selected.

 

STEP 4: Collect PDB related service information

[oracle@oratest1 ~]$ srvctl status service -d ORA_PRIM -pdb TEST01

Service test01_svc is running on instance(s) ORAPRIM1

STEP 5: Create blackout for the Target PDB

STEP 6: shut the pdb and open only one instance in restricted mode

 SQL> alter pluggable database TEST01 close immediate instances=all;

Pluggable database altered.

 SQL> alter pluggable database TEST01 open restricted;

Pluggable database altered.

 SQL> col name for a30        

SQL> col restriced for a30

SQL> select name,open_mode,restricted from gv$pdbs where con_id>2;

NAME                                    OPEN_MODE  RES

------------------------------ ---------- ---

TEST01                                  READ WRITE YES

TEST01                                  MOUNTED

 

STEP 7: set container and change PDB name

 SQL> alter session set container=TEST01;

Session altered.

 SQL> show con_name

CON_NAME

------------------------------

TEST01

 SQL> alter pluggable database TEST01 rename global_name to UK_PDB;

Pluggable database altered.

 

STEP 8: bring down the pdb and open the pdb as its original state

SQL> show pdbs                     

   CON_ID CON_NAME                              OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

           3 UK_PDB                                 READ WRITE YES

SQL> alter pluggable database UK_PDB close immediate;

Pluggable database altered.

SQL> show pdbs                     

    CON_ID CON_NAME                              OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

           3 UK_PDB                                 READ WRITE YES

 

SQL> alter pluggable database UK_PDB open instances=all;

Pluggable database altered.

 

STEP 9: validate new PDB name and guid

 SQL> select name,con_id,dbid,con_uid,guid from v$containers order by con_id;

NAME                                          CON_ID  DBID          CON_UID GUID

------------------------------ ---------- ----------

UK_PDB                              3 1767643166 1767643166 22EDFFF300C9602EE0630701A8C01F01

 

STEP 10: Remove old service and add new service

 [oracle@oratest1 ~]$ srvctl status service -d ORA_PRIM -pdb TEST01

Service test01_svc is running on instance(s) ORAPRIM1

[oracle@oratest1 ~]$ srvctl stop service -s TEST01_SVC -d ORA_PRIM

[oracle@oratest1 ~]$ srvctl remove service -s TEST01_SVC -d ORA_PRIM

 

[oracle@oratest1 ~]$ srvctl add service -s UK_SVC -d ORA_PRIM -pdb UK_PDB -role primary -preferred ORAPRIM1,ORAPRIM2 -P BASIC

[oracle@oratest1 ~]$ srvctl status service -s UK_SVC -d ORA_PRIM

Service UK_SVC is not running.

[oracle@oratest1 ~]$ srvctl start service -s UK_SVC -d ORA_PRIM

[oracle@oratest1 ~]$ srvctl status service -s UK_SVC -d ORA_PRIM

Service UK_SVC is running on instance(s) ORAPRIM1,ORAPRIM2

STEP 11: if wallet is configured for the database then copy ewallet and cwallet file into the new PDB guid

STEP 12: Remove Blackout from the database

STEP 13: Validate remote connectivity

STEP 14: Run L0 backup immediately



 

 

 

 

Post a Comment

Previous Post Next Post