Showing posts with label Oracle RAC. Show all posts
Showing posts with label Oracle RAC. Show all posts

Wednesday, May 14, 2014

Difference between crsctl start/stop crs and crsctl start/stop cluster


crsctl start/stop crs - This command starts/stops the OHASD process along with the complete Clusterware stack on the local node we are logged in.

crsctl start/stop cluster - This command starts/stops the Clusterware stack on a server except the OHASD process.

The following processes will still be running if we stop the cluster using crsctl stop cluster.

Process Owner Processes
------------- -------------------------------------------------
root     $GRID_HOME/bin/ohasd.bin reboot
root     $GRID_HOME/bin/orarootagent.bin
root   $GRID_HOME/bin/osysmond.bin
root    $GRID_HOME/bin/ologgerd -m linux02 -r -d $GRID_HOME/crf/db/linux01
oracle  $GRID_HOME/bin/gipcd.bin
oracle  $GRID_HOME/bin/oraagent.bin
oracle  $GRID_HOME/bin/mdnsd.bin
oracle   $GRID_HOME/bin/gpnpd.bin

Note: The advantage of crsctl stop cluster compared to stop crs command is that it prevent the relocation of 'certain' resources to other servers in the cluster before the Clusterware is stopped on that server.

Wednesday, May 7, 2014

How to find Cluster name on Oracle RAC

How to find Cluster name on Oracle RAC

Environment Details:
OS: Linux 5.8
User: oracle
Two Node RAC: linux01, linux02
Database Version: 11.2.0.4.0
Oracle Home: /u01/app/oracle/product/11.2.0/dbhome_1
Grid Home: /u01/app/11.2.0/grid

There are various method through which we can find out the cluster name. Few of them listed below

Set the GRID HOME & PATH Variable
[oracle@linux01 ~]export ORACLE_HOME=/u01/app/11.2.0/grid
[oracle@linux01 ~]$ export PATH=$ORACLE_HOME/bin:$PATH

Method 1: Execute the below command
[oracle@linux01 ~]$ cemutlo -n
racclu01

Method 2: Execute the below command
[oracle@linux01 ~]$ olsnodes -c
racclu01

Method 3: In Grid Home, there is a cdata directory, inside there will be a directory having the same name as cluster name
[oracle@linux01 ~]$ cd $ORACLE_HOME/cdata
[oracle@linux01 /u01/app/11.2.0/grid/cdata]$ ls
linux01  linux01.olr  localhost racclu01

Method 4: Do a ocrdump and open the dumpfile. Search for SYSTEM.css.clustername in the file.
[oracle@linux01 ~]$ ocrdump
[oracle@linux01 ~]$ vi OCRDUMPFILE

[SYSTEM.css.clustername]
ORATEXT : racclu01
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_READ, OTHER_PERMISSION : PROCR_READ, USER_NAME : root, GROUP_NAME : root}


Friday, January 24, 2014

Kill session on specific node of RAC

How to kill a user session on specific node of Oracle RAC


SQL> select INST_ID,  username, sid, serial#, osuser, status from gv$session where username in ('TEST');

   INST_ID USERNAME       SID    SERIAL# OSUSER          STATUS
---------- ----------- ------ ---------- --------------- --------
         1 TEST           597       1901 oraem           ACTIVE
         8 TEST           695       5391 oradba          ACTIVE

2 rows selected.

When we try to kill the session as we do in a single instance database it throws a error.

SQL> alter system kill session '695,5391' immediate;
alter system kill session '695,5391' immediate
*
ERROR at line 1:
ORA-00030: User session ID does not exist.


Solution: We need to provide the Instance ID along with the kill session command. i.e.

alter system kill session 'SID,SERIAL#,@<INST_ID>' immediate;

SQL> alter system kill session '695,5391,@8' immediate;

System altered.

Elapsed: 00:00:07.02
SQL> select INST_ID,  username, sid, serial#, osuser, status from gv$session where username in ('TEST');

   INST_ID USERNAME       SID    SERIAL# OSUSER          STATUS
---------- ----------- ------ ---------- --------------- --------
         1 TEST           597       1901 oraem           ACTIVE

1 row selected.