ORACLE RAC COMMANDS
Few Useful commands for handling oracle RAC services and database:
Command | Expected Output | Command for |
crsctl stop crs -f | Stops crs services | |
crsctl start crs -f | starts crs services | |
crsctl stop cluster -all | stop oracle cluster resources running on all nodes | |
crsctl start cluster -all | start oracle cluster resources running on all nodes | |
crsctl check cluster | CRS-4537: Cluster Ready Services is online CRS-4529: Cluster Synchronization Services is online CRS-4533: Event Manager is online | current status of a cluster |
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 | current status of CRS |
crsctl stat res -t | status of cluster resources | |
crsctl query crs softwareversion | Oracle Clusterware version on node [euu2594] is [11.2.0.2.0] | check version of Oracle Clusterware |
crsctl check has | CRS-4638: Oracle High Availability Services is online | current status of OHASD |
crsctl delete resource testresource -f | Forcefully deleting resource : | |
crsctl enable crs | CRS-4622: Oracle High Availability Services autostart is enabled | enabling CRS daemons |
crsctl disable crs | CRS-4621: Oracle High Availability Services autostart is disabled. | disabling CRS daemons |
olsnodes | euu2594 euu2596 | status of Oracle CRS |
olsnodes -n | euu2594 1 euu2596 2 | print node name with node number |
olsnodes -l -p | euu2594 10.10.5.1,10.10.6.1 | print private interconnect address for the local node |
olsnodes -i | euu2594 euu2594-vip euu2596 euu2596-vip | print virtual IP address with node name |
olsnodes -s | euu2594 Active euu2596 Active | print node status (active or inactive) |
olsnodes -t | euu2594 Unpinned euu2596 Unpinned | print node type (pinned or unpinned) : |
olsnodes -c | MWQcluster | print clusterware name |
oifcfg getif | eth0 10.10.5.0 global cluster_interconnect eth1 10.10.6.0 global cluster_interconnect bond0 10.75.36.0 global public | display global public and global cluster_interconnect : |
srvctl config database | MWQ | display the database registered in the repository |
srvctl config database -d MWQ | Database unique name: MWQ Database name: Oracle home: /oracleMWQ/MWQ/112_64 Oracle user: oracle Spfile: Domain: world Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Server pools: MWQ Database instances: MWQ001,MWQ002 Disk Groups: MWQ_DATA,MWQ_OLOG,MWQ_MLOG,MWQ_ARCH Mount point paths: /oracleMWQ/MWQ/112_64 Services: Type: RAC Database is administrator managed | display the configuration details of the database |
srvctl modify database -d MWQ -y MANUAL | change policy of database from automatic to manual | |
srvctl modify database -d MWQ -s mount | change the startup option of database from open to mount | |
srvctl start listener | start RAC listener | |
srvctl status database -d MWQ | Instance MWQ001 is running on node euu2594 Instance MWQ002 is running on node euu2596 | status of the database |
srvctl status service -d MWQ | display the status services running in the database | |
srvctl status nodeapps | VIP euu2594-vip is enabled VIP euu2594-vip is running on node: euu2594 VIP euu2596-vip is enabled VIP euu2596-vip is running on node: euu2596 Network is enabled Network is running on node: euu2594 Network is running on node: euu2596 GSD is disabled GSD is not running on node: euu2594 GSD is not running on node: euu2596 ONS is enabled ONS daemon is running on node: euu2594 ONS daemon is running on node: euu2596 | check nodeapps running on a node |
srvctl start database -d MWQ | start or stop all instances associated with a database This command also starts services and listeners on each node | |
srvctl stop database -d TESTRACDB | shut down instances and services (listeners not stopped) | |
srvctl stop database -d TESTRACDB -o immediate | To shutdown immediate database | |
srvctl start database -d TESTRACDB -o force | To startup force all instances | |
srvctl stop database -d TESTRACDB -i instance racnode1 | To perform normal shutdown | |
srvctl start asm -n racnode1 | start the ASM instance on racnode01 cluster node | |
srvctl stop asm -n racnode1 | stop the ASM instance on racnode01 cluster node | |
srvctl config scan | SCAN name: euu2562.sgp.st.com, Network: 1/10.75.36.0/255.255.255.0/bond0 SCAN VIP name: scan1, IP: /euu2562.sgp.st.com/10.75.36.159 SCAN VIP name: scan2, IP: /euu2562.sgp.st.com/10.75.36.160 SCAN VIP name: scan3, IP: /euu2562.sgp.st.com/10.75.36.161 | display current configuration of the SCAN VIP’s |
srvctl modify scan -n your-scan-name.example.com | Refreshing SCAN VIP’s with new IP addresses from DNS | |
srvctl start scan_listener ,srvctl start scan | start SCAN listener and the SCAN VIP resources | |
srvctl stop scan_listener , srvctl stop scan | stop SCAN listener and the SCAN VIP resources | |
srvctl status scan | SCAN VIP scan1 is enabled SCAN VIP scan1 is running on node euu2596 SCAN VIP scan2 is enabled SCAN VIP scan2 is running on node euu2594 SCAN VIP scan3 is enabled SCAN VIP scan3 is running on node euu2594 | display the status of SCAN VIP’s and SCAN listeners |
srvctl status scan_listener | SCAN Listener LISTENER_SCAN1 is enabled SCAN listener LISTENER_SCAN1 is running on node euu2596 SCAN Listener LISTENER_SCAN2 is enabled SCAN listener LISTENER_SCAN2 is running on node euu2594 SCAN Listener LISTENER_SCAN3 is enabled SCAN listener LISTENER_SCAN3 is running on node euu2594 | display the status of SCAN VIP’s and SCAN listeners |
srvctl add scan -n your-scan | Add scan | |
srvctl remove scan | Remove scan | |
srvctl modify scan -n new-scan | Modify scan | |
srvctl add scan_listener | Add scan listener | |
srvctl remove scan_listener | Remove scan listener | |
srvctl modify scan_listener -p | modify SCAN listener port | |
startup --mount | start the ASM instnace in mount state | |
shutdown --immediate | shut down ASM | |
lsop | on ASMCMD to list ASM operations | |
ocrcheck | Status of Oracle Cluster Registry is as follows : Version : 3 Total space (kbytes) : 262120 Used space (kbytes) : 3304 Available space (kbytes) : 258816 ID : 1096563487 Device/File Name : +OCR_VOTE Device/File integrity check succeeded Device/File not configured Device/File not configured Device/File not configured Device/File not configured Cluster registry integrity check succeeded Logical corruption check bypassed due to non-privileged user | perform quick health check of OCR |
ocrdump testdump.xml -xml | dump content of OCR file into an xml | |
ocrconfig -replace ocrmirror ‘+TESTDG’ | relocate the OCR mirror file to the specified location | |
ocrconfig -replace +CURRENTOCRDG -replacement +NEWOCRDG | Add the OCR mirror file to the specified location | |
ocrconfig -replce ocr ‘+TESTDG’ | relocate existing OCR file | |
ocrconfig -add +TESTDG | add mirrod disk group for OCR : | |
ocrconfig -delete +TESTDG | remove ocr mirror | |
ocrconfig -showbackup | euu2594 2017/11/13 06:13:57 /oracleMWQ/GRID/112_64/cdata/MWQcluster/backup00.ocr euu2594 2017/11/13 02:13:57 /oracleMWQ/GRID/112_64/cdata/MWQcluster/backup01.ocr euu2594 2017/11/12 22:13:56 /oracleMWQ/GRID/112_64/cdata/MWQcluster/backup02.ocr euu2594 2017/11/11 14:13:51 /oracleMWQ/GRID/112_64/cdata/MWQcluster/day.ocr euu2594 2017/11/04 14:13:25 /oracleMWQ/GRID/112_64/cdata/MWQcluster/week.ocr PROT-25: Manual backups for the Oracle Cluster Registry are not available | list ocrbackup list |
ocrconfig -manualbackup | Performs OCR backup manually | |
ocrconfig -backuploc /backups/ocr | Changes OCR autobackup directory | |
cluvfy comp ocr -n all -verbose | Verifying OCR integrity Checking OCR integrity... Checking the absence of a non-clustered configuration... All nodes free of non-clustered, local-only configurations ASM Running check passed. ASM is running on all specified nodes Checking OCR config file "/etc/oracle/ocr.loc"... OCR config file "/etc/oracle/ocr.loc" check successful Disk group for ocr location "+OCR_VOTE" available on all the nodes NOTE: This check does not verify the integrity of the OCR contents. Execute 'ocrcheck' as a privileged user to verify the contents of OCR. OCR integrity check passed Verification of OCR integrity was successful. | verify the integrity of all the cluster nodes |
Comments
Post a Comment