Mir Sayeed Hassan – Oracle Blog

Oracle DBA – Tips & Techniques | Learn with real-time examples

  • Translate

  • It’s Me






  • My Certificates

  • Links

    My Acclaim Certification : Credly Profile
    My Oracle ACE Pro Profile

  • Achievements

    Awarded Top 100 Oracle Blogs from Worldwide - #RANK 39
  • VISITORS COUNT

  • Verified International Academic Qualification from World Education Service (WES)

    Verified International Academic Qualification from World Education Service (WES)

  • Jobs

RAC DB Command for CRSCTL & SRVCTL in Oracle 11gR2

Posted by Mir Sayeed Hassan on January 15th, 2019

RAC DB Command for CRSCTL & SRVCTL in Oracle 11gR2

CRSCTL COMMANDS

Database Status

SQL> select instance_name,version, status from v$instance;

INSTANCE_NAME VERSION STATUS
 ---------------- ----------------- ------------
 rac_1 11.2.0.4.0 OPEN

Login to the grid user & issue the CRSCTL Commands:

[root@trac1 ~]# su - grid
 grid(+ASM1)@trac1 ~$
grid(+ASM1)@trac1 bin$pwd
 /u01/app/11.2.0/grid_1/bin
grid(+ASM1)@trac1 bin$crs_stat –t

Name Type Target State Host
 ------------------------------------------------------------
 ora.DATA.dg ora....up.type ONLINE ONLINE trac1
 ora....ER.lsnr ora....er.type ONLINE ONLINE trac1
 ora....N1.lsnr ora....er.type ONLINE ONLINE trac1
 ora....N2.lsnr ora....er.type ONLINE ONLINE trac2
 ora....N3.lsnr ora....er.type ONLINE ONLINE trac2
 ora.OCR.dg ora....up.type ONLINE ONLINE trac1
 ora.asm ora.asm.type ONLINE ONLINE trac1
 ora.cvu ora.cvu.type ONLINE ONLINE trac2
 ora.gsd ora.gsd.type OFFLINE OFFLINE
 ora....network ora....rk.type ONLINE ONLINE trac1
 ora.oc4j ora.oc4j.type ONLINE ONLINE trac2
 ora.ons ora.ons.type ONLINE ONLINE trac1
 ora.rac.db ora....se.type ONLINE ONLINE trac1
 ora.scan1.vip ora....ip.type ONLINE ONLINE trac1
 ora.scan2.vip ora....ip.type ONLINE ONLINE trac2
 ora.scan3.vip ora....ip.type ONLINE ONLINE trac2
 ora....SM1.asm application ONLINE ONLINE trac1
 ora....C1.lsnr application ONLINE ONLINE trac1
 ora.trac1.gsd application OFFLINE OFFLINE
 ora.trac1.ons application ONLINE ONLINE trac1
 ora.trac1.vip ora....t1.type ONLINE ONLINE trac1
 ora....SM2.asm application ONLINE ONLINE trac2
 ora....C2.lsnr application OFFLINE OFFLINE
 ora.trac2.gsd application OFFLINE OFFLINE
 ora.trac2.ons application ONLINE ONLINE trac2
 ora.trac2.vip ora....t1.type ONLINE ONLINE trac2

crsstat – Check the Output of the crs_stat

grid(+ASM1)@trac1 bin$crs_stat
 NAME=ora.DATA.dg
 TYPE=ora.diskgroup.type
 TARGET=ONLINE
 STATE=ONLINE on trac1

NAME=ora.LISTENER.lsnr
 TYPE=ora.listener.type
 TARGET=ONLINE
 STATE=ONLINE on trac1

NAME=ora.LISTENER_SCAN1.lsnr
 TYPE=ora.scan_listener.type
 TARGET=ONLINE
 STATE=ONLINE on trac1

NAME=ora.LISTENER_SCAN2.lsnr
 TYPE=ora.scan_listener.type
 TARGET=ONLINE
 STATE=ONLINE on trac2

NAME=ora.LISTENER_SCAN3.lsnr
 TYPE=ora.scan_listener.type
 TARGET=ONLINE
 STATE=ONLINE on trac2

NAME=ora.OCR.dg
 TYPE=ora.diskgroup.type
 TARGET=ONLINE
 STATE=ONLINE on trac1

NAME=ora.asm
 TYPE=ora.asm.type
 TARGET=ONLINE
 STATE=ONLINE on trac1

NAME=ora.cvu
 TYPE=ora.cvu.type
 TARGET=ONLINE
 STATE=ONLINE on trac2

NAME=ora.gsd
 TYPE=ora.gsd.type
 TARGET=OFFLINE
 STATE=OFFLINE

NAME=ora.net1.network
 TYPE=ora.network.type
 TARGET=ONLINE
 STATE=ONLINE on trac1

NAME=ora.oc4j
 TYPE=ora.oc4j.type
 TARGET=ONLINE
 STATE=ONLINE on trac2

NAME=ora.ons
 TYPE=ora.ons.type
 TARGET=ONLINE
 STATE=ONLINE on trac1

NAME=ora.rac.db
 TYPE=ora.database.type
 TARGET=ONLINE
 STATE=ONLINE on trac1

NAME=ora.scan1.vip
 TYPE=ora.scan_vip.type
 TARGET=ONLINE
 STATE=ONLINE on trac1

NAME=ora.scan2.vip
 TYPE=ora.scan_vip.type
 TARGET=ONLINE
 STATE=ONLINE on trac2

NAME=ora.scan3.vip
 TYPE=ora.scan_vip.type
 TARGET=ONLINE
 STATE=ONLINE on trac2

NAME=ora.trac1.ASM1.asm
 TYPE=application
 TARGET=ONLINE
 STATE=ONLINE on trac1

NAME=ora.trac1.LISTENER_TRAC1.lsnr
 TYPE=application
 TARGET=ONLINE
 STATE=ONLINE on trac1

NAME=ora.trac1.gsd
 TYPE=application
 TARGET=OFFLINE
 STATE=OFFLINE

NAME=ora.trac1.ons
 TYPE=application
 TARGET=ONLINE
 STATE=ONLINE on trac1

NAME=ora.trac1.vip
 TYPE=ora.cluster_vip_net1.type
 TARGET=ONLINE
 STATE=ONLINE on trac1

NAME=ora.trac2.ASM2.asm
 TYPE=application
 TARGET=ONLINE
 STATE=ONLINE on trac2

NAME=ora.trac2.LISTENER_TRAC2.lsnr
 TYPE=application
 TARGET=OFFLINE
 STATE=OFFLINE

NAME=ora.trac2.gsd
 TYPE=application
 TARGET=OFFLINE
 STATE=OFFLINE

NAME=ora.trac2.ons
 TYPE=application
 TARGET=ONLINE
 STATE=ONLINE on trac2

NAME=ora.trac2.vip
 TYPE=ora.cluster_vip_net1.type
 TARGET=ONLINE
 STATE=ONLINE on trac2

crsctl check crs – Check the CSS, CRS, EVM status as healthy

grid(+ASM1)@trac1 bin$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

crsctl stop crs –  Shop crs & all other related services

grid(+ASM1)@trac1 bin$crsctl stop crs
 CRS-4563: Insufficient user privileges.
 CRS-4000: Command Stop failed, or completed with errors.

Note: To stop the crs services, you need to login as a root & execute
[root@trac1 bin]# ./crsctl stop crs

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'trac1'
 CRS-2673: Attempting to stop 'ora.crsd' on 'trac1'
 CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'trac1'
 CRS-2673: Attempting to stop 'ora.rac.db' on 'trac1'
 CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'trac1'
 CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'trac1'
 CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.scan1.vip' on 'trac1'
 CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.trac1.vip' on 'trac1'
 CRS-2677: Stop of 'ora.scan1.vip' on 'trac1' succeeded
 CRS-2672: Attempting to start 'ora.scan1.vip' on 'trac2'
 CRS-2677: Stop of 'ora.rac.db' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.DATA.dg' on 'trac1'
 CRS-2673: Attempting to stop 'ora.OCR.dg' on 'trac1'
 CRS-2677: Stop of 'ora.OCR.dg' on 'trac1' succeeded
 CRS-2677: Stop of 'ora.trac1.vip' on 'trac1' succeeded
 CRS-2672: Attempting to start 'ora.trac1.vip' on 'trac2'
 CRS-2676: Start of 'ora.scan1.vip' on 'trac2' succeeded
 CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'trac2'
 CRS-2676: Start of 'ora.trac1.vip' on 'trac2' succeeded
 CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'trac2' succeeded
 CRS-2677: Stop of 'ora.DATA.dg' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.asm' on 'trac1'
 CRS-2677: Stop of 'ora.asm' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.ons' on 'trac1'
 CRS-2677: Stop of 'ora.ons' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.net1.network' on 'trac1'
 CRS-2677: Stop of 'ora.net1.network' on 'trac1' succeeded
 CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'trac1' has completed
 CRS-2677: Stop of 'ora.crsd' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.ctssd' on 'trac1'
 CRS-2673: Attempting to stop 'ora.evmd' on 'trac1'
 CRS-2673: Attempting to stop 'ora.asm' on 'trac1'
 CRS-2673: Attempting to stop 'ora.mdnsd' on 'trac1'
 CRS-2677: Stop of 'ora.evmd' on 'trac1' succeeded
 CRS-2677: Stop of 'ora.ctssd' on 'trac1' succeeded
 CRS-2677: Stop of 'ora.mdnsd' on 'trac1' succeeded
 CRS-2677: Stop of 'ora.asm' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'trac1'
 CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.cssd' on 'trac1'
 CRS-2677: Stop of 'ora.cssd' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.crf' on 'trac1'
 CRS-2677: Stop of 'ora.crf' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.gipcd' on 'trac1'
 CRS-2677: Stop of 'ora.gipcd' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.gpnpd' on 'trac1'
 CRS-2677: Stop of 'ora.gpnpd' on 'trac1' succeeded
 CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'trac1' has completed
 CRS-4133: Oracle High Availability Services has been stopped.

Note: In this case all the crs,other related services will be stop also the instance will be down.

crsctl start crs – Start crs & all other related services

[root@trac1 bin]# ./crsctl start crs
 CRS-4123: Oracle High Availability Services has been started.

crsctl disable crs – Disable the CRS from starting on reboot

[root@trac1 bin]# ./crsctl disable crs
 CRS-4621: Oracle High Availability Services autostart is disabled.

crsctl enable crs – Enable crs start on reboot

[root@trac1 bin]# ./crsctl enable crs
 CRS-4622: Oracle High Availability Services autostart is enabled.

crs_stop all – Stops all registered resources

[root@trac1 bin]# ./crs_stop all
 CRS-0184: Cannot communicate with the CRS daemon.

crsctl stop cluster –Stops the cluster in all nodes

[root@trac1 bin]# ./crsctl stop cluster

CRS-2673: Attempting to stop 'ora.crsd' on 'trac1'
 CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'trac1'
 CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'trac1'
 CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'trac1'
 CRS-2673: Attempting to stop 'ora.rac.db' on 'trac1'
 CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.scan1.vip' on 'trac1'
 CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.trac1.vip' on 'trac1'
 CRS-2677: Stop of 'ora.scan1.vip' on 'trac1' succeeded
 CRS-2672: Attempting to start 'ora.scan1.vip' on 'trac2'
 CRS-2677: Stop of 'ora.rac.db' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.DATA.dg' on 'trac1'
 CRS-2673: Attempting to stop 'ora.OCR.dg' on 'trac1'
 CRS-2677: Stop of 'ora.OCR.dg' on 'trac1' succeeded
 CRS-2677: Stop of 'ora.trac1.vip' on 'trac1' succeeded
 CRS-2672: Attempting to start 'ora.trac1.vip' on 'trac2'
 CRS-2676: Start of 'ora.scan1.vip' on 'trac2' succeeded
 CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'trac2'
 CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'trac2' succeeded
 CRS-2676: Start of 'ora.trac1.vip' on 'trac2' succeeded
 CRS-2677: Stop of 'ora.DATA.dg' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.asm' on 'trac1'
 CRS-2677: Stop of 'ora.asm' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.ons' on 'trac1'
 CRS-2677: Stop of 'ora.ons' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.net1.network' on 'trac1'
 CRS-2677: Stop of 'ora.net1.network' on 'trac1' succeeded
 CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'trac1' has completed
 CRS-2677: Stop of 'ora.crsd' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.ctssd' on 'trac1'
 CRS-2673: Attempting to stop 'ora.evmd' on 'trac1'
 CRS-2673: Attempting to stop 'ora.asm' on 'trac1'
 CRS-2677: Stop of 'ora.evmd' on 'trac1' succeeded
 CRS-2677: Stop of 'ora.ctssd' on 'trac1' succeeded
 CRS-2677: Stop of 'ora.asm' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'trac1'
 CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'trac1' succeeded
 CRS-2673: Attempting to stop 'ora.cssd' on 'trac1'
 CRS-2677: Stop of 'ora.cssd' on 'trac1' succeeded

crsctl start cluster –all – starts the cluster in all nodes

[root@trac1 bin]# ./crsctl start cluster
 CRS-2672: Attempting to start 'ora.cssdmonitor' on 'trac1'
 CRS-2676: Start of 'ora.cssdmonitor' on 'trac1' succeeded
 CRS-2672: Attempting to start 'ora.cssd' on 'trac1'
 CRS-2672: Attempting to start 'ora.diskmon' on 'trac1'
 CRS-2676: Start of 'ora.diskmon' on 'trac1' succeeded
 CRS-2676: Start of 'ora.cssd' on 'trac1' succeeded
 CRS-2672: Attempting to start 'ora.ctssd' on 'trac1'
 CRS-2676: Start of 'ora.ctssd' on 'trac1' succeeded
 CRS-2672: Attempting to start 'ora.evmd' on 'trac1'
 CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'trac1'
 CRS-2676: Start of 'ora.evmd' on 'trac1' succeeded
 CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'trac1' succeeded
 CRS-2672: Attempting to start 'ora.asm' on 'trac1'
 CRS-2676: Start of 'ora.asm' on 'trac1' succeeded
 CRS-2672: Attempting to start 'ora.crsd' on 'trac1'
 CRS-2676: Start of 'ora.crsd' on 'trac1' succeeded

SRVCTL COMMANDS

Login to the Oracle user & issue the below commands

[root@trac1 bin]# su – oracle
 [oracle(rac_1)@trac1 ~$

Stop all the instances & the database (Which include all the nodes)

Syntax: srvctl stop database -d

[oracle(rac_1)@trac1 ~$srvctl stop database -d rac

Now check the status of the database

[oracle(rac_1)@trac1 ~$!sq

SQL> select status from V$instance;
 select status from V$instance
 *
 ERROR at line 1:
 ORA-01034: ORACLE not available
 Process ID: 0
 Session ID: 0 Serial number: 0

Start all the instances (Which include all the nodes)

Syntax: srvctl start database -d

[oracle(rac_1)@trac1 ~$srvctl start database -d rac

[oracle(rac_1)@trac1 ~$!sq

SQL> select status from v$instance;

STATUS
 ------------
 OPEN

Stop the single instance of database

Syntax: srvctl stop instance -d  -i

[oracle(rac_1)@trac1 ~$srvctl stop instance -d rac -i rac_1

In this case the single Node 1 instance database is down & verifies the status

[oracle(rac_1)@trac1 ~$srvctl status database -d rac
 Instance rac_1 is not running on node trac1
 Instance rac_2 is running on node trac2

Start the single instance

Syntax: srvctl start instance -d -  -i

[oracle(rac_1)@trac1 ~$srvctl start instance -d rac -i rac_1 - (This will start the NODE 1 Only)

In this case the single Node 1 instance database is startup & verifies the status

[oracle(rac_1)@trac1 ~$srvctl status database -d rac
 Instance rac_1 is running on node trac1
 Instance rac_2 is running on node trac2

Check the status of single instance in database

Syntax: srvctl status instance -d  -i

[oracle(rac_1)@trac1 ~$srvctl status instance -d rac -i rac_1
 Instance rac_1 is running on node trac1

Check the status of all instance in database

Syntax: srvctl status database -d

[oracle(rac_1)@trac1 ~$srvctl status database -d rac
 Instance rac_1 is running on node trac1
 Instance rac_2 is running on node trac2

Check the status of all the nodeapps & individual node

Syntax: srvctl start nodeapps
 srvctl start nodeapps -n
[oracle(rac_1)@trac1 ~$srvctl status nodeapps
 VIP trac1-vip is enabled
 VIP trac1-vip is running on node: trac1
 VIP trac2-vip is enabled
 VIP trac2-vip is running on node: trac2
 Network is enabled
 Network is running on node: trac1
 Network is running on node: trac2
 GSD is disabled
 GSD is not running on node: trac1
 GSD is not running on node: trac2
 ONS is enabled
 ONS daemon is running on node: trac1
 ONS daemon is running on node: trac2
[oracle(rac_1)@trac1 ~$srvctl status nodeapps -n trac1
 VIP trac1-vip is enabled
 VIP trac1-vip is running on node: trac1
 Network is enabled
 Network is running on node: trac1
 GSD is disabled
 GSD is not running on node: trac1
 ONS is enabled
 ONS daemon is running on node: trac1
[oracle(rac_1)@trac1 ~$srvctl status nodeapps -n trac2
 VIP trac2-vip is enabled
 VIP trac2-vip is running on node: trac2
 Network is enabled
 Network is running on node: trac2
 GSD is disabled
 GSD is not running on node: trac2
 ONS is enabled
 ONS daemon is running on node: trac2

Stop & Start the nodeapps

[oracle(rac_1)@trac1 ~$srvctl stop nodeapps -n trac1
 [oracle(rac_1)@trac1 ~$srvctl stop nodeapps -n trac2

Check the status of the SCAN listener

[oracle(rac_1)@trac1 ~$srvctl status scan
 SCAN VIP scan1 is enabled
 SCAN VIP scan1 is running on node trac1
 SCAN VIP scan2 is enabled
 SCAN VIP scan2 is running on node trac2
 SCAN VIP scan3 is enabled
 SCAN VIP scan3 is running on node trac2

Check the status of the configuration of the SCAN listener

[oracle(rac_1)@trac1 ~$srvctl config scan
 SCAN name: ractest-scan, Network: 1/10.20.0.0/255.255.255.0/eth1
 SCAN VIP name: scan1, IP: /ractest-scan/10.20.0.98
 SCAN VIP name: scan2, IP: /ractest-scan/10.20.0.94
 SCAN VIP name: scan3, IP: /ractest-scan/10.20.0.95

Check the status of the ASM Instance

[oracle(rac_1)@trac1 ~$srvctl status asm
 ASM is running on trac1,trac2

Hence tested in our env & verified