Monday, May 4, 2015

12c - Change PDB global name

SQL> select name, open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB3N                          READ WRITE

SQL> alter pluggable database pdb3n close;

Pluggable database altered.

SQL> show con_id

CON_ID
------------------------------
5

SQL> show con_name

CON_NAME
------------------------------
PDB3N 

SQL> alter pluggable database open restricted;

Pluggable database altered.

SQL> alter pluggable database rename global_name to pdb3;


Pluggable database altered.

SQL> alter pluggable database close;

Pluggable database altered.

SQL> alter pluggable database open;

Pluggable database altered.


SQL> show con_name

CON_NAME
------------------------------
PDB3
SQL>


This will change also the listener configuration and will register the new global name with the listener.

$ lsnrctl status
....
Service "pdb3" has 1 instance(s).
  Instance "cdb", status READY, has 1 handler(s) for this service...
The command completed successfully


The only changes that must be done are at client side's tnsnames.ora file.

No comments:

Post a Comment