0% found this document useful (0 votes)
0 views

Oracle RAC Commands Quick Reference

The document is a quick guide to RAC commands, detailing various Oracle Clusterware utilities and their functions, such as managing cluster resources, checking resource status, and configuring network interfaces. It includes commands for starting and stopping clusters, managing Oracle Cluster Registry (OCR) and voting disks, and handling database services. Additionally, it covers miscellaneous commands and configuration checks necessary for maintaining Oracle RAC environments.

Uploaded by

Abdo Mohamed
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Oracle RAC Commands Quick Reference

The document is a quick guide to RAC commands, detailing various Oracle Clusterware utilities and their functions, such as managing cluster resources, checking resource status, and configuring network interfaces. It includes commands for starting and stopping clusters, managing Oracle Cluster Registry (OCR) and voting disks, and handling database services. Additionally, it covers miscellaneous commands and configuration checks necessary for maintaining Oracle RAC environments.

Uploaded by

Abdo Mohamed
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

RAC COMMANDS QUICK GUIDE

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

SARAVANAKUMAR K Oracle DBA - https://skumar22k.blogspot.com/


Clusterware utilities
crsctl → Manage cluster
srvctl → Managing cluster resources
ocrconfig → Configuration tool for Oracle Cluster/Local Registry to Manage OCR
ocrcheck → Displays health of Oracle Cluster/Local Registry and to troubleshoot OCR
ocrdump → Dump contents of Oracle Cluster/Local Registry to a file
oifcfg → Oracle Interface Configuration Tool to managing network interfaces
olsnodes → To find node information

Checking Resource Status


This process involves verifying the current status or condition of a resource such as a server, database, or application component to
ensure it is available, functioning correctly, and performing as expected. It helps in identifying issues early and maintaining system
reliability.
$ crsctl stat res -t
If the cluster fails to start, you can check the initialization status of resources using the following command:
$ crsctl stat res -t -init

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

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

Enabling or Disabling Cluster Resource Auto-Start


You can configure whether a cluster resource should automatically start when the server reboots. This setting is useful to control resource
behavior during planned restarts or maintenance windows, ensuring only the desired resources are brought online.

crsctl enable crs crsctl enable has


crsctl disable crs crsctl disable has
crsctl config crs crsctl config has

CRS Log and Its Use


CRS (Cluster Ready Services) logs are critical for diagnosing issues in Oracle Clusterware environments. These logs record detailed
information about cluster events, resource status changes, node communication, and failures. They are essential for troubleshooting
problems related to cluster startup, node eviction, and resource management.

SARAVANAKUMAR K Oracle DBA - https://skumar22k.blogspot.com/


CRS logs are typically located in:

$GRID_BASE/diag/crs/<hostname>/crs/trace/alert.log
/u01/app/grid/diag/crs/srv1/crs/trace/alert.log

Oracle Clusterware Configuration Files


Oracle Clusterware uses configuration files like the Oracle Cluster Registry (OCR) to store important cluster data, including resource
definitions and cluster node details. It's important to verify the location and integrity of these files to ensure the cluster functions correctly.
Determine OCR file location (root/grid)

ocrcheck -config

Verify integrity of OCR file using ocrcheck(root/grid)


Ocrcheck

Verify OCR integrity using Cluster Verification Utility (grid)


cluvfy comp ocr -n all -verbose

OCR Backup and Maintenance


OCR (Oracle Cluster Registry) is a vital component of Oracle Clusterware that stores cluster configuration information, such as node
details and resource metadata. Backing up the OCR is essential to recover the cluster in case of corruption or loss, ensuring continuity
and stability of the clustered environment.
Show OCR backup (root/grid)
ocrconfig -showbackup

Taking manual backup (root)


ocrconfig -manualbackup

Change default OCR backup location (root)


ocrconfig -backuploc <new_backup_location/DISKGROUP>
ocrconfig -backuploc +FRA

Add additional OCR location (root)


In Oracle RAC, up to 5 OCR locations (1 primary + 4 mirrors) can be configured. Adding additional OCR locations provides high
availability, redundancy, and fault tolerance. It ensures cluster stability by protecting against storage failures and supports faster recovery
in case the primary OCR becomes inaccessible or corrupted.
ocrconfig -add +FRA
ocrconfig -add /dev/sdf

Replace current OCR location (root)


OCR replace means removing an existing OCR location and adding a new one—essentially migrating the Oracle Cluster Registry (OCR)
to a new storage location (e.g., a different ASM disk group or physical disk).Replace first specified OCR device or file with second
specified device/file. Note: when only one copy of OCR is configured we can’t replace it.

ocrconfig -replace <current diskgroupname> -replacement +<new diskgroupname> | <new filename>


ocrconfig -replace +DATADG -replacement /dev/sdf1

SARAVANAKUMAR K Oracle DBA - https://skumar22k.blogspot.com/


Voting Disk management
A voting disk in Oracle RAC is a shared disk used to record node membership information. It helps determine which nodes are part of
the cluster and assists in quorum-based decisions during communication failures. Each node regularly writes a heartbeat to the voting
disk. If a node fails to update its heartbeat, it may be evicted from the cluster. Two types of heartbeat: Network heartbeat and Disk
heartbeat. Network heartbeat ensures nodes can communicate over the cluster interconnect, while disk heartbeat (via voting disks)
confirms access to shared storage. Both are essential for detecting node failures and maintaining cluster integrity, enabling Oracle
Clusterware to make eviction or failover decisions. Multiple voting disks can be configured for high availability and fault tolerance.
Displaying Voting Disk Configuration
crsctl query css votedisk

Checking and Changing Heartbeat intervel and timeout limits (root)


crsctl get css disktimeout
crsctl get css misscount
crsctl get css reboottime
# crsctl set css disktimeout <secs> [-force]
# crsctl set css misscount <secs> [-force]
# crsctl set css reboottime <secs> [-force]

Replacing voting disk (root)


crsctl replace votedisk <+asm_diskgroup>
crsctl replace votedisk +DATADG02

OLR Location, Data, Export and Import


OLR (Oracle Local Repository) is a configuration store in Oracle RAC that holds clusterware-related information, such as cluster
configuration, node membership, and the status of cluster resources. It is used by Oracle Clusterware to manage the local configuration
on each node in the cluster. OLR is crucial for proper cluster functionality and resource management, ensuring consistent configurations
across all nodes in a RAC environment.
OLR location
<$GRID_BASE>/crsdata/<node_name>/olr
/u01/app/grid/crsdata/srv1/olr

Export OLR (root)


ocrconfig -local -export <file_name>
ocrconfig -local -export /acfs01/app/ocr_backup/olr_backup_13apr2025

Import OLR (root)

Typically used during OLR recovery or restoration scenarios

ocrconfig -local -import <file_name>

Read OLR Data (grid/root)


ocrdump -local -stdout

SCAN Configuration information


SCAN (Single Client Access Name) is a single network name used in Oracle RAC for database connections. It allows clients to connect
to the cluster without needing to know individual node hostnames or IPs. SCAN provides load balancing and high availability,
automatically directing client requests to available nodes, simplifying client configuration and connection management in multi-node
RAC environments.

SARAVANAKUMAR K Oracle DBA - https://skumar22k.blogspot.com/


View scan configuration
srvctl config scan

View scan listener configuration


srvctl config scan_listener

Cluster Database start and stop


Database status

srvctl status database -d <db_unique_name> -v


srvctl status database -d rac -v

START and STOP database with options


srvctl start database -d <db_unique_name> [-startoption open|mount|nomomunt|restrict]
srvctl start database -d rac -startoption nomount

srvctl stop database -d <db_unique_name> [-stopoption normal|immediate|transactional|abort]


srvctl stop database -d rac -stopoption transactional

Cluster database configuration


srvctl config database -d <db_unique_name> [-v]
srvctl config database -d rac -v

Cluster instances start and stop


Instance status
srvctl status instance -d <db_unique_name> -i <instance_name> [-v]
srvctl status database -d rac -i rac1,rac3 -v

Instance start and stop

srvctl start instance -d <db_unique_name> {-i <instance_name> | -n <node_name>}


[-startoption open|mount|nomomunt|restrict]
srvctl start instance -d rac -i rac1,rac4 -startoption nomount
srvctl start instance -d rac -n srv1,srv2

srvctl stop instance -d <db_unique_name> {-i <instance_name>| -n <node_name>}


[-stopoption normal|immediate|transactional|abort]
srvctl stop instance -d rac -i rac1 -stopoption transactional
srvctl stop instance -d rac -n srv1,srv2 -stopoption transactional

ASM start, stop, status, and configuration

srvctl start asm -n <node_name>


srvctl start asm -n srv1

srvctl stop asm -n <node_name>


srvctl stop asm -n srv1 | srvctl stop has

srvctl status asm -n srv1 -v

srvctl config asm

SARAVANAKUMAR K Oracle DBA - https://skumar22k.blogspot.com/


Nodeapps start, stop, status, and configuration
Nodeapps (Node Applications) in Oracle RAC include essential cluster components running on each node, such as the VIP (Virtual
IP), GSD (Global Services Daemon), Listener, and ONS (Oracle Notification Service). These support client connectivity, service
registration, and inter-node communication, ensuring proper RAC operation and failover handling.

srvctl start nodeapps [-node <node_name>]


srvctl stop nodeapps [-node <node_name>]
srvctl status nodeapps [-node <node_name>]
srvctl config nodeapps [-viponly] [-onsonly]
srvctl config nodeapps -onsonly

Network Interface Configuration – list, get, set and delete


OIFCFG (Oracle Interface Configuration Tool) is a utility in Oracle RAC used to configure and manage network interfaces for cluster
communication. It helps define which interfaces are used for the public and private (interconnect) networks. OIFCFG ensures proper
network role assignment, supporting high availability and performance. It’s commonly used during RAC setup or when modifying
network configurations.
List of interfaces available to the cluster
oifcfg iflist -p -n
Display interfaces type
oifcfg iflist -p -n
Displays current network interface configurations used by Oracle RAC (public and private)
oifcfg getif
Sets or modifies the role of a network interface public or cluster_interconnect (root)
oifcfg setif -global <interface_name>/<subnet>:<role>
oifcfg setif -global eth1/10.0.0.0:cluster_interconnect

Delete or remove the network interface (root)


oifcfg delif -global <interface_name>/<subnet>
oifcfg delif -global eth1/192.168.0.0

Cluster node information


olsnodes is a command-line tool in Oracle RAC that displays information about cluster nodes, such as node names, node numbers, and
their status. It's useful for verifying cluster membership.
Display cluster node information (grid)
olsnodes -n -i -s
Display local node information (grid)
olsnodes -n -i -s
Display the cluster name (grid)
olsnodes -c

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.

SARAVANAKUMAR K Oracle DBA - https://skumar22k.blogspot.com/


Start and stop service
srvctl start service -d <db_unique_name> -s <service_name_list> | -pdb <pluggable_database>
[-node <node_name> | -instance <inst_name>]
srvctl start service -d rac -s pdb01_oln -i rac1,rac2
srvctl start service -d rac -pdb orclpdb01

srvctl stop service -d <db_unique_name> -s <service_name_list> | -pdb <pluggable_database>


[-node <node_name> | -instance <inst_name>] [-stopoption TRANSACTIONAL| IMMEDIATE]
srvctl stop service -d rac
srvctl stop service -d rac -i rac2
srvctl stop service -d rac -pdb orclpdb02

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

Clusterware version (grid/root)


crsctl query crs releaseversion crsctl query has releaseversion
crsctl query crs softwareversion crsctl query has softwareversion

SARAVANAKUMAR K Oracle DBA - https://skumar22k.blogspot.com/

You might also like