There are following RAC basic commands
How to Start and Stop Local Listener and SCAN ListenerFirst check which services are running from which nodes.
oragrid$ps -eaf|grep tns
---------How to set environment if environment is not set---------
bash-4.3$ which srvctl
/u02/grid/product/11.2.0/bin/srvctl
bash-4.3$ export PATH=$ORACLE_HOME/bin:$PATH
/u02/grid/product/11.2.0/bin/lsnrctl
--How to STOP Local Listener:- Run this command from one by one all nodes
oragrid$srvctl stop LISTENER -n adupgdb1
oragrid$srvctl stop LISTENER -n oracledb1
oragrid$srvctl stop LISTENER -n oracledb2
--How to STOP SCAN Listener ---- Run only from any one nodeoragrid$srvctl stop scan_listener
----- How to START Local Listener ------oragrid$srvctl start LISTENER -n adupgdb1
oragrid$srvctl start LISTENER -n oracledb1
oragrid$srvctl start LISTENER -n oracledb2
-----How to start SCAN Listener ------
oragrid$srvctl start scan_listener
-----------------------------------------------------------------------
How to bounced Single SCAN Listener one by one on nodesRun from the grid user.
bash-4.3$ srvctl status scan_listener -i 3
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node adupgdb1
bash-4.3$ srvctl stop scan_listener -i 3
bash-4.3$ srvctl status scan_listener -i 3
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is not running
bash-4.3$ srvctl start scan_listener -i 3
bash-4.3$ srvctl status scan_listener -i 3
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node adupgdb1
------------------------------------------------------------------
11gR2
Clusterware and Grid Home – What you need to know [ID 1053147.1] [ POST VIEWS : 15323 ]
1.
Clusterware Resource Status Check
bash-4.3# ./crsctl status resource -t
--------------------------------------------------------------------------------
NAME
TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE testdb1
ONLINE ONLINE testdb2
ora.TESTARCH.dg
ONLINE ONLINE
testdb1
ONLINE ONLINE testdb2
ora.TESTDATA.dg
ONLINE ONLINE testdb1
ONLINE ONLINE testdb2
ora.TESTDATA1.dg
ONLINE ONLINE testdb1
ONLINE
ONLINE testdb2
ora.TEST_VOTE.dg
ONLINE ONLINE testdb1
ONLINE ONLINE testdb2
ora.asm
ONLINE ONLINE testdb1 Started
ONLINE ONLINE testdb2 Started
ora.gsd
OFFLINE OFFLINE testdb1
OFFLINE OFFLINE testdb2
ora.net1.network
ONLINE ONLINE testdb1
ONLINE ONLINE testdb2
ora.ons
ONLINE ONLINE testdb1
ONLINE ONLINE testdb2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE
ONLINE testdb1
ora.LISTENER_SCAN2.lsnr
1 ONLINE
ONLINE testdb2
ora.LISTENER_SCAN3.lsnr
1 ONLINE
ONLINE testdb2
ora.cvu
1 ONLINE
ONLINE testdb2
ora.oc4j
1 OFFLINE OFFLINE
ora.scan1.vip
1 ONLINE
ONLINE testdb1
ora.scan2.vip
1 ONLINE
ONLINE testdb2
ora.scan3.vip
1 ONLINE
ONLINE testdb2
ora.test.db
1 ONLINE
ONLINE testdb1 Open
2 ONLINE
ONLINE testdb2 Open
ora.testdb1.vip
1 ONLINE
ONLINE testdb1
ora.testdb2.vip
2. STOP A and START A LISTENER
bash-4.3$
srvctl status listener -l LISTENER
Listener LISTENER is enabled
Listener LISTENER is running on node(s): testdb2,testdb1
bash-4.3$
srvctl stop listener -l LISTENER
bash-4.3$
srvctl status listener -l LISTENER
Listener LISTENER is enabled
Listener LISTENER is not running
bash-4.3$
srvctl start listener -l LISTENER
bash-4.3$
srvctl status listener -l LISTENER
Listener LISTENER is enabled
Listener LISTENER is running
on node(s): testdb2,testdb1
3. stop all the clusterware services/ resources on specific node (including DB and listener) (run as root)
bash-4.3#
./crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability
Services-managed resources on 'testdb1'
CRS-2673: Attempting to stop 'ora.crsd' on 'testdb1'
CRS-2790: Starting shutdown of Cluster Ready
Services-managed resources on 'testdb1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on
'testdb1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on
'testdb1'
CRS-2673: Attempting to stop 'ora.TESTARCH.dg' on
'testdb1'
CRS-2673: Attempting to stop 'ora.TEST_VOTE.dg' on
'testdb1'
CRS-2673: Attempting to stop 'ora.test.db' on 'testdb1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'testdb1'
succeeded
CRS-2673: Attempting to stop 'ora.testdb1.vip' on
'testdb1'
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'testdb1'
succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'testdb1'
CRS-2677: Stop of 'ora.testdb1.vip' on 'testdb1'
succeeded
CRS-2672: Attempting to start 'ora.testdb1.vip' on 'testdb2'
CRS-2677: Stop of 'ora.scan1.vip' on 'testdb1' succeeded
CRS-2672: Attempting to start 'ora.scan1.vip' on
'testdb2'
CRS-2677: Stop of 'ora.TESTARCH.dg' on 'testdb1'
succeeded
CRS-2676: Start of 'ora.testdb1.vip' on 'testdb2'
succeeded
CRS-2676: Start of 'ora.scan1.vip' on 'testdb2' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr'
on 'testdb2'
CRS-2677: Stop of 'ora.test.db' on 'testdb1' succeeded
CRS-2673: Attempting to stop 'ora.TESTDATA.dg' on
'testdb1'
CRS-2673: Attempting to stop 'ora.TESTDATA1.dg' on
'testdb1'
CRS-2677: Stop of 'ora.TESTDATA1.dg' on 'testdb1'
succeeded
CRS-2677: Stop of 'ora.TESTDATA.dg' on 'testdb1'
succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'testdb2'
succeeded
CRS-2677: Stop of 'ora.TEST_VOTE.dg' on 'testdb1'
succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'testdb1'
CRS-2677: Stop of 'ora.asm' on 'testdb1' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'testdb1'
CRS-2677: Stop of 'ora.ons' on 'testdb1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on
'testdb1'
CRS-2677: Stop of 'ora.net1.network' on 'testdb1'
succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed
resources on 'testdb1' has completed
CRS-2677: Stop of 'ora.crsd' on 'testdb1' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'testdb1'
CRS-2673: Attempting to stop 'ora.evmd' on 'testdb1'
CRS-2673: Attempting to stop 'ora.asm' on 'testdb1'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'testdb1'
CRS-2677: Stop of 'ora.ctssd' on 'testdb1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'testdb1' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'testdb1' succeeded
CRS-2677: Stop of 'ora.asm' on 'testdb1' succeeded
CRS-2673: Attempting to stop
'ora.cluster_interconnect.haip' on 'testdb1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on
'testdb1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'testdb1'
CRS-2677: Stop of 'ora.cssd' on 'testdb1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'testdb1'
CRS-2677: Stop of 'ora.gipcd' on 'testdb1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'testdb1'
CRS-2677: Stop of 'ora.gpnpd' on 'testdb1' succeeded
CRS-2793: Shutdown of Oracle High Availability
Services-managed resources on 'testdb1' has completed
CRS-4133: Oracle High
Availability Services has been stopped.
4. Start all the clusterware services/ resources on specific node (including DB and listener) (run as root)
bash-4.3#
./crsctl start has
CRS-4123: Oracle High Availability Services has been
started.
5. to stop csr services on all nodes of clusterware (run as root)
bash-4.3#
./crsctl stop cluster –all
6. to start crs services on all nodes of clusterware (run as root)
bash-4.3# ./crsctl start cluster -all
7. to check if ohasd is running/ stopped (run as root)
bash-4.3# ./crsctl check
has
CRS-4638: Oracle High Availability Services is online
8. enable Oracle High Availability Services autostart (run as root)
bash-4.3# ./crsctl enable has
CRS-4622: Oracle High Availability Services autostart is
enabled.
9. disable Oracle High Availability Services autostart (run as root)
bash-4.3# ./crsctl
disable has
CRS-4621: Oracle High Availability Services autostart is
disabled.
10. check if Oracle High Availability Services autostart is enabled/ disabled (run
bash-4.3#
./crsctl config has
CRS-4622: Oracle High Availability Services autostart is
enabled.
11.
Verifying
scan status scan_listener
Run this through grid user.
bash-4.3$
./cluvfy comp scan -verbose
Verifying scan
Checking Single Client Access Name (SCAN)...
SCAN Name Node Running? ListenerName Port
Running?
----------------
------------ ------------ ------------
------------ ------------
scan-test.seha.ae testdb1 true LISTENER_SCAN1 1521
true
scan-test.seha.ae testdb2
true LISTENER_SCAN2 1521
true
scan-test.seha.ae testdb2 true LISTENER_SCAN3 1521
true
Checking TCP connectivity to SCAN Listeners...
Node ListenerName TCP connectivity?
------------ ------------------------ ------------------------
testdb1 LISTENER_SCAN1 yes
testdb1 LISTENER_SCAN2 yes
testdb1 LISTENER_SCAN3 yes
TCP connectivity to SCAN Listeners exists on all cluster
nodes
Checking name resolution setup for
"scan-test.seha.ae"...
SCAN Name IP Address Status Comment
------------ ------------------------ ------------------------ ----------
scan-test.seha.ae 10.105.22.133 passed
scan-test.seha.ae
10.105.22.132 passed
scan-test.seha.ae
10.105.22.131 passed
Verification of SCAN VIP and Listener setup passed
Verification of scan was successful.
12. Verifying scan port
bash-4.3$
srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521
13. To check the status of services on all nodes
bash-4.3$
srvctl status nodeapps
VIP testdb1_vip is enabled
VIP testdb1_vip is running on node: testdb1
VIP 10.104.21.56 is enabled
VIP 10.104.21.57 is running on node: testdb2
Network is enabled
Network is running on node: testdb1
Network is running on node: testdb2
GSD is disabled
GSD is not running on node: testdb1
GSD is not running on node: testdb2
ONS is enabled
ONS daemon is running on node: testdb1
ONS daemon is running on node: testdb2
14. stop all the clusterware services/ resources ON THAT NODE! (run as root)
bash-4.3# ./crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
15. Check if Oracle High Availability Services autostart is enabled/ disabled (run as root)
bash-4.3# ./crsctl config has
CRS-4622: Oracle High
Availability Services autostart is enabled.
How to Check
Clusterware Version and Name
To check the software versions on a single node. Software
version is the lastest version installed in on an cluster.
You would use this option,When you do the rolling
upgrade.
$ crsctl query crs softwareversion [hostname]
Active version is lowest version anywhere in the cluster.
This is the command you would normally need to use
$ crsctl query crs activeversion
The version of oracle Clusterware must be always greater
than the oracle products installed in the clusters
Permanently operating oracle Clusterware (software
version vs active version) is not supported.
To check the cluster
name use,
$ORA_CRS_HOME/bin/cemutlo -n
bash-4.3#
./crsctl query crs softwareversion testdb1
Oracle Clusterware version on node [testdb1] is
[11.2.0.3.0]
bash-4.3#
./crsctl query crs activeversion
Oracle Clusterware active version on the cluster is
[11.2.0.3.0]
/u02/appl/product/grid/11.2.0/bin
bash-4.3#
./cemutlo -n
How to Start
11g R2 RAC Cluster
There are 2 methods.
Method 1:
1).Start the HAS (High Availability Service) on each
node.
$
crsctl start has
2).To Start the Cluster on both the nodes.
$
crsctl start cluster –all
If OHASD is already running, you can start the
Clusterware stack on any node from local node
Method 2:
1).Run the below command on each node. Starts both HAS
and CRS
$
crsctl start crs
Noticed that just starting has also starts up the whole
stack.
How to START and STOP
Database services in Mount and Nomount mode.
oratest@srvctl start
database -d TEST -o mount
oratest@srvctl start
database -d TEST -o nomount