Wednesday, February 10, 2016

12c: Rename PDB’S from CDB Root

After the data refresh, we are going to rename PDB in lower environment (test | dev). Steps as follows

Step1: close the pdb which you are going to rename it on CDB Root 

SQL> alter pluggable database red close immediate;
Pluggable database altered.

step2: Open PDB in restricted mode as follows 

SQL> alter pluggable database red open restricted;
Pluggable database altered.

SQL> select name, restricted from v$pdbs;
NAME              RES
------------------------------ ---
PDB$SEED         NO
RED                  YES

Step3: Now connect to pluggable database & change global_name of pluggable database 

SQL> connect sys/oracle12@red as sysdba
Connected.
SQL> 
SQL> show con_name;
CON_NAME
———————————————
RED

SQL> alter pluggable database red rename global_name to pink;
Pluggable database altered.

SQL> show con_name;
CON_NAME
------------------------------
PINK

Step4: close and reopen the pluggable database;

SQL> alter pluggable database pink close immediate;                   
Pluggable database altered.

SQL> alter pluggable database pink open;
Pluggable database altered.

SQL> select name, open_mode from v$pdbs;
NAME                       OPEN_MODE
------------------------------ —————
PINK                          READ WRITE

Step5:  Make sure service is created after renaming PDB on CDB ROOT

SQL> column name format a20
SQL> column pdb format a40
SQL> select name, pdb from V$SERVICES order by creation_date;

NAME                             PDB
-------------------- ----------------------------------------
SYS$BACKGROUND        CDB$ROOT
SYS$USERS                    CDB$ROOT
colourXDB                     CDB$ROOT
colour                           CDB$ROOT
green                            GREEN
pink                              PINK
6 rows selected.

Step6: Make changes to tnsnames.ora accordingly  

PINK =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.118)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = pink)
    )
  )

[oracle@tnc61 admin]$ tnsping pink

TNS Ping Utility for Linux: Version 12.1.0.1.0 - Production on 10-FEB-2016 11:00:47
Copyright (c) 1997, 2013, Oracle.  All rights reserved.
Used parameter files:
/u01/app/oracle/product/12.1.0/dbhome_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.118)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = pink)))
OK (10 msec)

[oracle@tnc61 admin]$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 10-FEB-2016 11:02:45
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                10-FEB-2016 10:22:45
Uptime                    0 days 0 hr. 39 min. 59 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/tnc61/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tnc61.ffdc.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=tnc61.ffdc.com)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/colour/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "colour" has 1 instance(s).
  Instance "colour", status READY, has 1 handler(s) for this service...
Service "colourXDB" has 1 instance(s).
  Instance "colour", status READY, has 1 handler(s) for this service...
Service "green" has 1 instance(s).
  Instance "colour", status READY, has 1 handler(s) for this service...
Service "pink" has 1 instance(s).
  Instance "colour", status READY, has 1 handler(s) for this service...
The command completed successfully

We have dynamic listener configuration, when global_name is changed PMON automatically registered with the listener :) 


—Nikhil Tatineni—
—12c: pluggable databases — 

Querys to monitor RAC

following few  Query's will help to find out culprits-  Query to check long running transaction from last 8 hours  Col Sid Fo...