Wednesday 24 July 2019

rac command to stop and start cluster

[oracle@OMPRLEXD001 grid]$ oifcfg getif
em1 10.96.32.0 global public
em2 192.168.0.0 global cluster_interconnect,asm
[oracle@OMPRLEXD001 grid]$

[root@racnode1 bin]# olsnodes
racnode1
racnode2
Olsnodes is especially useful using the following options:
-i - includes VIP information
-n - includes node number
-p - includes private interconnect information
-v - verbose mode
[root@racnode1 bin]# olsnodes -i -n -p
racnode1 1 racnode1-priv racnode1-vip
racnode2 2 racnode2-priv racnode2-vip

[root@hseau376 ~]# 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



Show CRS stat verbosely.
[grid@primary01 ~]$ crs_stat -v
NAME=ora.DATA.dg

NAME=ora.hsuuat.db
TYPE=ora.database.type
GEN_START_OPTIONS@SERVERNAME(hseau375)=open
GEN_START_OPTIONS@SERVERNAME(hseau376)=open
GEN_USR_ORA_INST_NAME@SERVERNAME(hseau375)=hsuuat1
GEN_USR_ORA_INST_NAME@SERVERNAME(hseau376)=hsuuat2
RESTART_ATTEMPTS=2
RESTART_COUNT=0
USR_ORA_INST_NAME@SERVERNAME(hseau375)=hsuuat1
USR_ORA_INST_NAME@SERVERNAME(hseau376)=hsuuat2
FAILURE_THRESHOLD=1
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau375

NAME=ora.hsuuat.ismuatservice1.svc
TYPE=ora.service.type
RESTART_ATTEMPTS=0
RESTART_COUNT=0
FAILURE_THRESHOLD=0
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau375

NAME=ora.net1.network
TYPE=ora.network.type
RESTART_ATTEMPTS=5
RESTART_COUNT=0
FAILURE_THRESHOLD=
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau375

NAME=ora.oc4j
TYPE=ora.oc4j.type
RESTART_ATTEMPTS=1
RESTART_COUNT=0
FAILURE_THRESHOLD=2
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau375

NAME=ora.ons
TYPE=ora.ons.type
RESTART_ATTEMPTS=3
RESTART_COUNT=0
FAILURE_THRESHOLD=
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau375

NAME=ora.registry.acfs
TYPE=ora.registry.acfs.type
RESTART_ATTEMPTS=5
RESTART_COUNT=0
FAILURE_THRESHOLD=
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau375

NAME=ora.scan1.vip
TYPE=ora.scan_vip.type
RESTART_ATTEMPTS=0
RESTART_COUNT=0
FAILURE_THRESHOLD=0
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau376

NAME=ora.scan2.vip
TYPE=ora.scan_vip.type
RESTART_ATTEMPTS=0
RESTART_COUNT=0
FAILURE_THRESHOLD=0
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau376

NAME=ora.scan3.vip
TYPE=ora.scan_vip.type
RESTART_ATTEMPTS=0
RESTART_COUNT=0
FAILURE_THRESHOLD=0
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau375


[root@hseau376 ~]# ps -ef | grep lsnr | grep -v 'grep' | grep -v 'ocfs' | awk '{print $9}'
LISTENER_SCAN2
LISTENER
LISTENER_SCAN1





















*****************************************************************************







http://satya-racdba.blogspot.in/2009/12/srvctl-commands.html

Refer :


How to Stop/Start RAC components

In this article, I am going to explain how to stop/start rac components. Here is the my system:

My db version : 11.2.0.3
My Operating System : AIX 7.1
My servers hostname : node1-node2
My database name : TEST01
My instance name : TEST011-TEST012

Here is the some basic  commands, for commands details&options  please review Reference docs:


Checking CRS Status
[oracle@node1]</home/oracle> 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

[oracle@node2]</home/oracle> 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

Checking Node Status

[oracle@node1]</home/oracle> srvctl status nodeapps

VIP node1-vip is enabled
VIP node1-vip is running on node: node1
VIP 192.168.100.101 is enabled
VIP 192.168.100.101 is running on node: node2
Network is enabled
Network is running on node: node1
Network is running on node: node2
GSD is disabled
GSD is not running on node: node1
GSD is not running on node: node2
ONS is enabled
ONS daemon is running on node: node1
ONS daemon is running on node: node2

[oracle@node2]</home/oracle> srvctl status nodeapps

VIP node1-vip is enabled
VIP node1-vip is running on node: node1
VIP 192.168.100.101 is enabled
VIP 192.168.100.101 is running on node: node2
Network is enabled
Network is running on node: node1
Network is running on node: node2
GSD is disabled
GSD is not running on node: node1
GSD is not running on node: node2
ONS is enabled
ONS daemon is running on node: node1
ONS daemon is running on node: node2

Checking Clusterware Resource Status
[oracle@node1]</home/oracle> crsctl status resource -t

I will not paste result because output is not clear in that page

You can use below command which is not recommended for 11g and which is depreciated

[oracle@node1]</home/oracle> crs_stat -t
Name Type Target State Host
————————————————————
ora….DATA.dg ora….up.type ONLINE ONLINE node1
ora….ER.lsnr ora….er.type ONLINE ONLINE node1
ora….N1.lsnr ora….er.type ONLINE ONLINE node1
ora….N2.lsnr ora….er.type ONLINE ONLINE node2
ora.ORADATA.dg ora….up.type ONLINE ONLINE node1
ora.asm ora.asm.type ONLINE ONLINE node1
ora.cvu ora.cvu.type ONLINE ONLINE node2
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora….SM1.asm application ONLINE ONLINE node1
ora….11.lsnr application ONLINE ONLINE node1
ora….b11.gsd application OFFLINE OFFLINE
ora….b11.ons application ONLINE ONLINE node1
ora….b11.vip ora….t1.type ONLINE ONLINE node1
ora….SM2.asm application ONLINE ONLINE node2
ora….12.lsnr application ONLINE ONLINE node2
ora….b12.gsd application OFFLINE OFFLINE
ora….b12.ons application ONLINE ONLINE node2
ora….b12.vip ora….t1.type ONLINE ONLINE node2
ora….network ora….rk.type ONLINE ONLINE node1
ora.oc4j ora.oc4j.type ONLINE ONLINE node2
ora.ons ora.ons.type ONLINE ONLINE node1
ora.test01.db ora….se.type ONLINE ONLINE node1
ora….int.svc ora….ce.type ONLINE ONLINE node2
ora….int.svc ora….ce.type ONLINE ONLINE node2
ora….kis.svc ora….ce.type ONLINE ONLINE node2
ora….est.svc ora….ce.type ONLINE ONLINE node1
ora….ry.acfs ora….fs.type ONLINE ONLINE node1
ora.scan1.vip ora….ip.type ONLINE ONLINE node1
ora.scan2.vip ora….ip.type ONLINE ONLINE node2

Oracle High Availability Services

— disable/enable Oracle HAS.
Use the “crsctl enable/disable has” command to disable automatic startup of the Oracle High Availability Services stack when the server boots up.

To can see current settings for Oracle High Availability Services stack when the server boots up, follow:

[root@node1]crsctl config has
CRS-4622: Oracle High Availability Services autostart is enabled.

or

[root@node1]cat /etc/oracle/scls_scr/node1/root/ohasdstr
enable

So as you can see my current setting is enable.If your system shown disable than :

For Disable:
[root@node1]crsctl disable has
CRS-4621: Oracle High Availability Services autostart is disabled.

[root@node1] crsctl config has
CRS-4621: Oracle High Availability Services autostart is disabled.

# cat /etc/oracle/scls_scr/node1/root/ohasdstr
disable

For Enable:
[root@node1]crsctl enable has
CRS-4621: Oracle High Availability Services autostart is enabled.

Check new setting:

[root@node1] crsctl config has
CRS-4621: Oracle High Availability Services autostart is enabled.

[root@node1] cat /etc/oracle/scls_scr/node1/root/ohasdstr
enable

Stop the Oracle clusterware stack

You can use below commands:

With root user:

crsctl stop crs or crsctl stop has

[root@node1]crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘node1'
CRS-2673: Attempting to stop ‘ora.crsd’ on ‘node1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on ‘node1'
CRS-2673: Attempting to stop ‘ora.LISTENER_SCAN2.lsnr’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.LISTENER.lsnr’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.test01.db’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.LISTENER_SCAN3.lsnr’ on ‘node1'
CRS-2677: Stop of ‘ora.LISTENER_SCAN2.lsnr’ on ‘node1' succeeded
CRS-2673: Attempting to stop ‘ora.scan2.vip’ on ‘node1'
CRS-2677: Stop of ‘ora.LISTENER.lsnr’ on ‘node1' succeeded
CRS-2673: Attempting to stop ‘ora.node1.vip’ on ‘node1'
CRS-2677: Stop of ‘ora.LISTENER_SCAN3.lsnr’ on ‘node1' succeeded
CRS-2673: Attempting to stop ‘ora.scan3.vip’ on ‘node1'
CRS-2677: Stop of ‘ora.node1.vip’ on ‘node1' succeeded
CRS-2672: Attempting to start ‘ora.node1.vip’ on ‘node2'
CRS-2677: Stop of ‘ora.scan2.vip’ on ‘node1' succeeded
CRS-2672: Attempting to start ‘ora.scan2.vip’ on ‘node2'
CRS-2677: Stop of ‘ora.scan3.vip’ on ‘node1' succeeded
CRS-2672: Attempting to start ‘ora.scan3.vip’ on ‘node2'
CRS-2676: Start of ‘ora.node1.vip’ on ‘node2' succeeded
CRS-2677: Stop of ‘ora.test01.db’ on ‘node1' succeeded
CRS-2676: Start of ‘ora.scan2.vip’ on ‘node2' succeeded
CRS-2672: Attempting to start ‘ora.LISTENER_SCAN2.lsnr’ on ‘node2'
CRS-2676: Start of ‘ora.scan3.vip’ on ‘node2' succeeded
CRS-2672: Attempting to start ‘ora.LISTENER_SCAN3.lsnr’ on ‘node2'
CRS-2676: Start of ‘ora.LISTENER_SCAN2.lsnr’ on ‘node2' succeeded
CRS-2676: Start of ‘ora.LISTENER_SCAN3.lsnr’ on ‘node2' succeeded
CRS-2673: Attempting to stop ‘ora.ons’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.eons’ on ‘node1'
CRS-2677: Stop of ‘ora.ons’ on ‘node1' succeeded
CRS-2673: Attempting to stop ‘ora.net1.network’ on ‘node1'
CRS-2677: Stop of ‘ora.net1.network’ on ‘node1' succeeded
CRS-2677: Stop of ‘ora.eons’ on ‘node1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on ‘node1' has completed
CRS-2677: Stop of ‘ora.crsd’ on ‘node1' succeeded
CRS-2673: Attempting to stop ‘ora.mdnsd’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.gpnpd’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.cssdmonitor’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.ctssd’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.evmd’ on ‘node1'
CRS-2677: Stop of ‘ora.cssdmonitor’ on ‘node1' succeeded
CRS-2677: Stop of ‘ora.mdnsd’ on ‘node1' succeeded
CRS-2677: Stop of ‘ora.gpnpd’ on ‘node1' succeeded
CRS-2677: Stop of ‘ora.evmd’ on ‘node1' succeeded
CRS-2677: Stop of ‘ora.ctssd’ on ‘node1' succeeded
CRS-2673: Attempting to stop ‘ora.cssd’ on ‘node1'
CRS-2677: Stop of ‘ora.cssd’ on ‘node1' succeeded
CRS-2673: Attempting to stop ‘ora.diskmon’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.gipcd’ on ‘node1'
CRS-2677: Stop of ‘ora.gipcd’ on ‘node1' succeeded
CRS-2677: Stop of ‘ora.diskmon’ on ‘node1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ‘node1' has completed
CRS-4133: Oracle High Availability Services has been stopped.

Start the Oracle clusterware stack

You can use below commands:

With root user:
crsctl start crs or crsctl start has

[root@node1] crsctl start crs
CRS-4123: Oracle High Availability Services has been started.

Start the Oracle Database
To start all Oracle RAC instances for a database:
[oracle@node1]</home/oracle> $ORACLE_HOME/bin/srvctl start database -d db_name

PS: db_name is the name of the databasethis command is starting all the instances

Stop the Oracle Database
To shut down all Oracle RAC instances for a database:
[oracle@node1]</home/oracle> $ORACLE_HOME/bin/srvctl stop database -d db_name

PS: db_name is the name of the databasethis command is starting all the instances

Start the Oracle Instance:

[oracle@node1]</home/oracle> $ORACLE_HOME/bin/srvctl start instance –d db_name –i instance_name

Stop the Oracle Instance:

[oracle@node1]</home/oracle> $ORACLE_HOME/bin/srvctl stop instance –d db_name –i instance_name
Stop/Start Listener-SCAN_LISTENER

srvctl stop/start listener -n node1
srvctl stop/start listener -n node2
srvctl stop scan_listener

Stop ASM

srvctl stop asm [-o stop_options] [-f]
srvctl stop asm -n node1

**************************************************************************************************************************






No comments:

Post a Comment

Featured post

Postgres commads

 [oracle@Tesdb ~]$ systemctl status postgresql-15 ● postgresql-15.service - PostgreSQL 15 database server    Loaded: loaded (/usr/lib/system...