Saturday, February 13, 2016

RAC :Environment

Environment Description: 
##  Multi-tenant database "p1tncd" version 12.1.0.2 running on 12.1.0.2 GRID HOME

Number of Nodes in a Cluster
[oracle@tnc1 ~]$ olsnodes -n
tnc1 1
tnc2 2

To check Oracle Clusterware Version 
[oracle@tnc2 dbs]$ crsctl query crs softwareversion
Oracle Clusterware version on node [tnc2] is [12.1.0.2.0]

To check name of the cluster
[oracle@tnc1 bin]$ ./cemutlo -n
tnc-cluster

To check network Interface on the node
[oracle@tnc2 bin]$ ./oifcfg iflist
eth0  192.168.1.0
eth1  10.10.10.0
eth1  169.254.0.0
virbr0  192.168.122.0
eth2  10.0.0.0

To check Status of scan_listener on node of the cluster
[oracle@tnc2 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node tnc1 

Databases Running on RAC cluster 
[oracle@tnc1 ~]$ ps -ef | grep pmon
oracle    5066     1  0 09:01 ?        00:00:00 asm_pmon_+ASM1
oracle    5755     1  0 09:01 ?        00:00:00 mdb_pmon_-MGMTDB
oracle   13278     1  0 10:38 ?        00:00:00 ora_pmon_p1tncd1
oracle   23533 25200  0 15:32 pts/1    00:00:00 grep pmon 

"p1tncd" is CDB ROOT database running on 2 nodes on the cluster 

End point listener running on Node of the cluster
[oracle@tnc1 bin]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 13-FEB-2016 15:47:42
Copyright (c) 1991, 2014, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                13-FEB-2016 13:24:13
Uptime                    0 days 2 hr. 23 min. 29 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/12.1.0.2/grid/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/tnc1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.11)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=tnc1.localdomain)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/product/12.1.0.2/db_1/admin/p1tncd/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "-MGMTDBXDB" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "_mgmtdb" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "cbn" has 1 instance(s).
  Instance "p1tncd1", status READY, has 1 handler(s) for this service...
Service "p1tncd" has 1 instance(s).
  Instance "p1tncd1", status READY, has 1 handler(s) for this service...
Service "p1tncdXDB" has 1 instance(s).
  Instance "p1tncd1", status READY, has 1 handler(s) for this service...
Service "srvnsp" has 1 instance(s).
  Instance "p1tncd1", status READY, has 1 handler(s) for this service...
Service "tnc_cluster" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
The command completed successfully

Performing Health Checks on the cluster

[oracle@tnc1 bin]$ crsctl check cluster -all
**************************************************************
tnc1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
tnc2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************

To check status of resources running on cluster

[oracle@tnc2 ~]$ crsctl status resource -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.FRA.dg
               ONLINE  ONLINE       tnc1                     STABLE
               ONLINE  ONLINE       tnc2                     STABLE
ora.GRID.dg
               ONLINE  ONLINE       tnc1                     STABLE
               ONLINE  ONLINE       tnc2                     STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       tnc1                     STABLE
               ONLINE  ONLINE       tnc2                     STABLE
ora.SDXH.dg
               ONLINE  ONLINE       tnc1                     STABLE
               ONLINE  ONLINE       tnc2                     STABLE
ora.asm
               ONLINE  ONLINE       tnc1                     Started,STABLE
               ONLINE  ONLINE       tnc2                     Started,STABLE
ora.net1.network
               ONLINE  ONLINE       tnc1                     STABLE
               ONLINE  ONLINE       tnc2                     STABLE
ora.ons
               ONLINE  ONLINE       tnc1                     STABLE
               ONLINE  ONLINE       tnc2                     STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       tnc1                     STABLE
ora.MGMTLSNR
      1        ONLINE  ONLINE       tnc1                     169.254.248.60 10.10
                                                                                   .10.180,STABLE
ora.cvu
      1        ONLINE  ONLINE       tnc2                     STABLE
ora.mgmtdb
      1        ONLINE  ONLINE       tnc1                     Open,STABLE
ora.oc4j
      1        ONLINE  ONLINE       tnc1                     STABLE
ora.p1tncd.db
      1        ONLINE  ONLINE       tnc1                     Open,STABLE
      2        ONLINE  ONLINE       tnc2                     Open,STABLE
ora.p1tncd.srvnsp.svc
      1        ONLINE  ONLINE       tnc1                     STABLE
      2        ONLINE  ONLINE       tnc2                     STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       tnc1                     STABLE
ora.tnc1.vip
      1        ONLINE  ONLINE       tnc1                     STABLE
ora.tnc2.vip
      1        ONLINE  ONLINE       tnc2                     STABLE
--------------------------------------------------------------------------------

Services created on database 

"srvnsp" is the service created on Pluggable database "CBN" 

[oracle@tnc2 ~]$ srvctl config database -f
PRKO-2002 : Invalid command line option: -f
[oracle@tnc2 ~]$ srvctl config database -d p1tncd
Database unique name: p1tncd
Database name: p1tncd
Oracle home: /u01/app/oracle/product/12.1.0.2/db_1
Oracle user: oracle
Spfile: +SDXH/P1TNCD/PARAMETERFILE/spfile.271.903695731
Password file: +SDXH/P1TNCD/PASSWORD/pwdp1tncd.256.903695139
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: 
Disk Groups: FRA,SDXH
Mount point paths: 
Services: srvnsp
Type: RAC
Start concurrency: 
Stop concurrency: 
OSDBA group: dba
OSOPER group: oper
Database instances: p1tncd1,p1tncd2
Configured nodes: tnc1,tnc2
Database is administrator managed

---Nikhil Tatineni--
--12c RAC--

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...