Oracle RAC Commands Quick Reference
Oracle RAC Commands Quick Reference
K.SARAVANAKUMAR
HTTPS://SKUMAR22K.BLOGSPOT.COM/
Table of Contents
Clusterware utilities ....................................................................................................................... 2
Checking Resource Status .............................................................................................................. 2
Starting and Stopping the Cluster and OHAS Locally and Remotely (as root) ........................................ 2
Enabling or Disabling Cluster Resource Auto-Start ............................................................................. 2
CRS Log and Its Use ...................................................................................................................... 2
Oracle Clusterware Configuration Files ............................................................................................. 3
OCR Backup and Maintenance ........................................................................................................ 3
Voting Disk management ............................................................................................................... 4
OLR Location, Data, Export and Import ............................................................................................ 4
SCAN Configuration information ...................................................................................................... 4
Cluster Database start and stop ...................................................................................................... 5
Cluster instances start and stop ...................................................................................................... 5
ASM start, stop, status, and configuration ........................................................................................ 5
Nodeapps start, stop, status, and configuration ................................................................................ 6
Network Interface Configuration – list, get, set and delete ................................................................. 6
Cluster node information ................................................................................................................ 6
Database service start and stop, add, modify, relocate and remove .................................................... 6
Miscellaneous commands ............................................................................................................... 7
Starting and Stopping the Cluster and OHAS Locally and Remotely (as root)
Cluster services can be managed either locally on a node or remotely from another node. As the root user, you can start or stop the entire
cluster stack using appropriate commands. This is useful during maintenance, troubleshooting, or planned outages.
crsctl start cluster
crsctl start cluster -n srv1
crsctl start cluster -all
crsctl start crs
Oracle High Availability Services are used in the ASM instance, which is essentially running as a standalone cluster. So below command
on this environment.
crsctl start has
crsctl stop has
crsctl check has
$GRID_BASE/diag/crs/<hostname>/crs/trace/alert.log
/u01/app/grid/diag/crs/srv1/crs/trace/alert.log
ocrcheck -config
Database service start and stop, add, modify, relocate and remove
In Oracle RAC, database services enable workload distribution and high availability by assigning specific applications or users to
preferred instances, supporting load balancing, failover, and easier connection management.
Add service
srvctl add service -d <db_unique_name> -s <service_name> -preferred <inst_name>
-available <inst_name>
[-pdb <pluggable_database>]
[-role PRIMARY|PHYSICAL_STANDBY|LOGICAL_STANDBY|SNAPSHOT_STANDBY]
srvctl add service -d rac -s pdb01_oln -preferred rac1 -available rac2
srvctl add service -d rac -s pdb01_oln -preferred rac1,rac3 -available rac2
srvctl add service -d rac -s pdb01_oln -preferred rac1,rac2 -role PHYSICAL_STANDBY
Modify service
srvctl modify service -d <db_unique_name> -s <service_name>
-modifyconfig -preferred <inst_name> -available <inst_name>
[-role PRIMARY|PHYSICAL_STANDBY|LOGICAL_STANDBY|SNAPSHOT_STANDBY]
srvctl modify service -d rac -s pdb01_oln -modifyconfig -preferred rac2 -available rac1
srvctl modify service -d rac -s pdb01_oln -modifyconfig -preferred rac1,rac2,rac3
Relocate service
srvctl relocate service -d <db_unique_name> [-s <service_name>]
-oldinst|-i <inst_name>
-newinst|-t <inst_name>
srvctl relocate service -d rac -s pdb01_oln -oldinst rac1 -newinst rac2
srvctl relocate service -d rac -i rac1 -t rac2
Remove
srvctl remove service -d <db_unique_name> [-s <service_name_list> | -pdb <pluggable_database>]
[-force]
srvctl stop service -d rac -s pdb01_oln
srvctl remove service -d rac -s pdb01_oln
Miscellaneous commands
srvctl config
srvctl config nodeapps
srvctl config vip -vip srv1-vip
srvctl config network
srvctl config scan [-scannumber 2]
srvctl config scan_listener