Pages

RAC commands help


http://rupamverma.blogspot.com/2013/07/11gr2-clusterware-and-grid-home-what.html

Active Version  : crsctl query crs activeversion

Status Check :
crs_stat
crs_stat -t
crsctl check crs
crsctl check cluster
crsctl check cluster -all

crsctl  stat  res  -t
crsctl  status  resource  -t
ocrcheck

olsnodes  | awk  '{ printf "\n-----"$0"----\n\n" ;system("cluvfy stage -post  crsinst   -n  " $0) ; print ""  }'

$GRID_HOME/crsctl check cluster -all
$GRID_HOME/crsctl  stat  res  -t

crsctl check cluster
crsctl start cluster
crsctl stop cluster

All these commands allow following usage
Default Stop local server

-all Stop all servers
-n Stop named servers
server [...] One or more blank-separated server names
-f Force option


$crsctl check cssd
$crsctl check crsd
$crsctl check evmd

crsctl delete resource <resource_name>  [ replaced crs_unregister ]


Start/Stop procedure  per node:

SQL> select instance_name, host_name, archiver, thread#, status from gv$instance;

$ export ORACLE_SID=orcl1
$ emctl stop dbconsole
$ srvctl stop instance -d orcl -i orcl1
$ srvctl stop asm -n linux1
$ srvctl stop nodeapps -n linux1

Sudo su - root
crsctl check crs
crsctl stop crs


Sudo su - root
root# crsctl check crs
root# crsctl start   crs  
root# /etc/init.d/init.crs start (old)
root# crs_start -all (old)

$ export ORACLE_SID=orcl1
$ srvctl start nodeapps -n linux1
$ srvctl start asm -n linux1
$ srvctl start instance -d orcl -i orcl1
$ emctl start dbconsole


Manual Start

crs_start -all
crs_start  ora.racnode1.vip
crsctl start  crs


Check ocr , voting disk and log locations :

ls -l $ORA_CRS_HOME/log/`hostname`

cat /etc/oracle/ocr.loc                       -- backup will be   in    $ORA_CRS_HOME/cdata/
ocrcheck

crsctl query css votedisk


On Node eviction

Check /var/log/messages
$GRID_HOME/log/host/alert<host>.log
$GRID_HOME/log/<host>/cssd/ocssd.log

Find and change private interconnect subnet

oifcfg getif

   bond0  xx.xx.xxx.0          global  public
   bondrc  xxx.xxx.xxx.xxx  global  cluster_interconnect

oifcfg   delif   -global   eth1
oifcfg   setif   -global   eth1/<your new subnet>:cluster_interconnect

Change the VIP address, subnetmask or interface

srvctl stop      nodeapps -n <node1>
srvctl stop      nodeapps -n <node2>
srvctl modify  nodeapps -n <node1> -A <ip_address>/<net mask>/<interface>
srvctl modify nodeapps -n <node2> -A <ip_address>/<net mask>/<interface>
srvctl start     nodeapps -n <node1>
srvctl start     nodeapps -n <node2>


Database :

srvctl config database -d {DBNAME} -a               : shows spfile location

srvctl config database

srvctl config database | awk  '{ printf "\n-----"$0"----\n\n" ;system("srvctl status database -d " $0) }'

srvctl config database | awk  '{ printf "\n-----"$0"----\n\n" ;system("srvctl config database -d " $0) }'

Nodeapps(VIP, GSD, ONS, Listener) :
olsnodes | awk  '{ printf "\n-----"$0"----\n\n" ;system("srvctl config nodeapps -n " $0) " -a -g -s -l" ; print "" }'

olsnodes  | awk  '{ printf "\n-----"$0"----\n\n" ;system("srvctl status nodeapps -n " $0) ; print ""  }'

ASM:
olsnodes  | awk  '{ printf "\n-----"$0"----\n\n" ;system("srvctl config asm -n " $0) ; print ""  }'


Services :
srvctl config database | awk  '{ printf "\n-----"$0"----\n\n" ;system("srvctl config service -d " $0) }'



srvctl config database
srvctl config database -d [-a] [-t]
srvctl config service -d [-s ] [-a] [-S ]
srvctl config nodeapps -n [-a] [-g] [-o] [-s] [-l]
srvctl config asm -n
srvctl config listener -n

srvctl add database -d -o [-m ] [-p ] [-A /netmask] [-r {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY}] [-s ] [-n ] [-y {AUTOMATIC | MANUAL}]
srvctl add instance -d -i -n
srvctl add service -d -s -r "" [-a ""] [-P ]
srvctl add service -d -s -u {-r "" | -a ""}
srvctl add nodeapps -n -o -A /netmask[/if1[|if2|...]]
srvctl add asm -n -i -o [-p ]

srvctl remove database -d [-f]
srvctl remove instance -d -i [-f]
srvctl remove service -d -s [-i ] [-f]
srvctl remove nodeapps -n "" [-f]
srvctl remove asm -n [-i ] [-f]

srvctl modify database -d [-n ] [-m ] [-p ]  [-r {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY}] [-s ] [-y {AUTOMATIC | MANUAL}]
srvctl modify instance -d -i -n
srvctl modify instance -d -i {-s | -r}
srvctl modify service -d -s -i -t [-f]
srvctl modify service -d -s -i -r [-f]
srvctl modify service -d -s -n -i [-a ] [-f]
srvctl modify asm -n -i [-o ] [-p ]

srvctl disable database -d
srvctl disable instance -d -i ""
srvctl disable service -d -s "" [-i ]
srvctl disable asm -n [-i ]
srvctl enable database -d
srvctl enable instance -d -i ""
srvctl enable service -d -s "" [-i ]
srvctl enable asm -n [-i ]

srvctl relocate service -d -s -i -t [-f]

srvctl status database -d [-f] [-v] [-S ]
srvctl status instance -d -i "" [-f] [-v] [-S ]
srvctl status service -d [-s ""] [-f] [-v] [-S ]
srvctl status nodeapps -n
srvctl status asm -n

srvctl start database -d [-o ]
srvctl start instance -d -i "" [-o ]
srvctl start service -d [-s "" [-i ]] [-o ]
srvctl start nodeapps -n
srvctl start asm -n [-i ] [-o ]
srvctl start listener -n [-l ]

srvctl stop database -d [-o ]
srvctl stop instance -d -i "" [-o ]
srvctl stop service -d [-s "" [-i ]] [-f]
srvctl stop nodeapps -n [-r]
srvctl stop asm -n [-i ] [-o ]
srvctl stop listener -n [-l ]


Diagnostic Data collection :

/u01/app/11.2.0/grid/bin/diagcollection.pl --collect

/u01/app/11.2.0/grid/bin/diagcollection.pl --clean

diagcollection.pl --collect --oh $ORACLE_HOME
diagcollection.pl --collect --crs $ORA_CRS_HOME


diagcollection.pl --coreanalysis



http://facedba.blogspot.in/2016/07/usefull-cluster-verification-commands.html