How to rename a Pluggable database in oracle database?
How to rename a Pluggable database???
SQL> -- we will change the name of container database STSPDB to WALPDB
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 STSPDB READ WRITE NO
SQL> shutdown immediate;
Pluggable Database closed.
SQL>
SQL>
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 STSPDB MOUNTED
SQL> startup open restrict;
Pluggable Database opened.
SQL>
SQL>
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 STSPDB READ WRITE YES
SQL>
SQL>
SQL> alter pluggable database STSPDB rename global_name to WALPDB;
Pluggable database altered.
SQL>
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 WALPDB READ WRITE YES
SQL>
SQL>
SQL> show con_name
CON_NAME
------------------------------
WALPDB
SQL>
SQL> shutdown immediate;
Pluggable Database closed.
SQL>
SQL> startup;
Pluggable Database opened.
SQL>
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 WALPDB READ WRITE NO
SQL> select name,open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
WALPDB READ WRITE
SQL>
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
Post this,Do not forget to update your connection string in tnsnames.ora and listener.ora file accordingly.
Thanks & Regards
Nikhil Kumar.
SQL> -- we will change the name of container database STSPDB to WALPDB
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 STSPDB READ WRITE NO
SQL> shutdown immediate;
Pluggable Database closed.
SQL>
SQL>
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 STSPDB MOUNTED
SQL> startup open restrict;
Pluggable Database opened.
SQL>
SQL>
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 STSPDB READ WRITE YES
SQL>
SQL>
SQL> alter pluggable database STSPDB rename global_name to WALPDB;
Pluggable database altered.
SQL>
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 WALPDB READ WRITE YES
SQL>
SQL>
SQL> show con_name
CON_NAME
------------------------------
WALPDB
SQL>
SQL> shutdown immediate;
Pluggable Database closed.
SQL>
SQL> startup;
Pluggable Database opened.
SQL>
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 WALPDB READ WRITE NO
SQL> select name,open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
WALPDB READ WRITE
SQL>
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
Post this,Do not forget to update your connection string in tnsnames.ora and listener.ora file accordingly.
Thanks & Regards
Nikhil Kumar.
Comments
Post a Comment