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

Useful Oracle RAC

The document provides commands for starting and stopping Oracle RAC components like the database, listeners, ASM, and nodeapps. It also includes commands for checking the status of RAC resources, databases, and nodes. Finally, it lists various ocrconfig, srvctl, crsctl, and asmcmd commands for configuring and managing the Oracle Cluster Registry (OCR) files, SCAN listeners, and ASM instances in an Oracle RAC environment.

Uploaded by

Akin Akinmosin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views

Useful Oracle RAC

The document provides commands for starting and stopping Oracle RAC components like the database, listeners, ASM, and nodeapps. It also includes commands for checking the status of RAC resources, databases, and nodes. Finally, it lists various ocrconfig, srvctl, crsctl, and asmcmd commands for configuring and managing the Oracle Cluster Registry (OCR) files, SCAN listeners, and ASM instances in an Oracle RAC environment.

Uploaded by

Akin Akinmosin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

STOP ORACLE RAC:1. emctl stop dbconsole2. srvctl stop listener -n racnode13.

srvctl
stop database -d RACDB4. srvctl stop asm -n racnode1 -f5. srvctl stop asm -n
racnode2 -f6. srvctl stop nodeapps -n racnode1 -f7. crsctl stop crsSTART ORACLE RAC
:1. crsctl start crs2. crsctl start res ora.crsd -init3. srvctl start nodeapps -n
racnode14. srvctl start nodeapps -n racnode25. srvctl start asm -n racnode16.
srvctl start asm -n racnode27. srvctl start database -d RACDB8. srvctl start
listener -n racnode19. emctl start dbconsole
To start and stop oracle clusterware (run as the

superuser) :

[root@node1 ~]# crsctl stop crs[root@node1 ~]# crsctl start crs


To start and stop oracle cluster resources running on all nodes :

[root@node1 ~]# crsctl stop cluster -all[root@node1 ~]# crsctl start cluster -all

Read free for 30 days.


Get 30 days of free Scribd membership when you invite your friends.

Invite FriendsInvite friends to join Scribd

To check the current status of a cluster :

[oracle@node1~]$ crsctl check clusterCRS-4537: Cluster Ready Services is onlineCRS-


4529: Cluster Synchronization Services is onlineCRS-4533: Event Manager is online
To check the current status of CRS :

[oracle@node1 ~]$ crsctl check crsCRS-4638: Oracle High Availability Services is


onlineCRS-4537: Cluster Ready Services is onlineCRS-4529: Cluster Synchronization
Services is onlineCRS-4533: Event Manager is online
To display the status cluster resources :

[oracle@node1 ~]$ crsctl stat res -t


To check version of Oracle Clusterware :

[oracle@node1 ~]$ crsctl query crs softwareversionOracle Clusterware version on


node [node1] is [11.2.0.4.0][oracle@node1 ~]$[oracle@node1 ~]$ crsctl query crs
activeversionOracle Clusterware active version on the cluster is[11.2.0.4.0]
[oracle@node1 ~]$ crsctl query crs releaseversionOracle High Availability Services
release version on the localnode is [11.2.0.4.0]
To check current status of OHASD (Oracle High Availability Services) daemon :

[oracle@node1 ~]$ crsctl check hasCRS-4638: Oracle High Availability Services is


onli
Forcefully deleting resource :

[oracle@node1 ~]$ crsctl delete resource testresource -f


Enabling and disabling CRS daemons (run as the superuser) :

[root@node1 ~]# crsctl enable crsCRS-4622: Oracle High Availability Services


autostart isenabled.[root@node1 ~]#[root@node1 ~]# crsctl disable crsCRS-4621:
Oracle High Availability Services autostart isdisabled.
To check the status of Oracle CRS :

[oracle@node1 ~]$ olsnodesnode1node2


To print node name with node number :
[oracle@node1 ~]$ olsnodes -nnode1 1node2 2
To print private interconnect address for the local node :

[oracle@node1 ~]$ olsnodes -l -pnode1 192.168.1.101


To print virtual IP address with node name :

[oracle@node1 ~]$ olsnodes -inode1 node1-vipnode2 node2-vip[oracle@node1 ~]$


olsnodes -i node1node1 node1-vip
To print information for the local node :

[oracle@node1 ~]$ olsnodes -lnode1pl


To print node status (active or inactive) :

[oracle@node1 ~]$ olsnodes -snode1 Activenode2 Active[oracle@node1 ~]$ olsnodes -l


-snode1 Active
To print node type (pinned or unpinned) :

[oracle@node1 ~]$ olsnodes -tnode1 Unpinnednode2 Unpinned[oracle@node1 ~]$ olsnodes


-l -tnode1 Unpinned
To print clusterware name :

[oracle@node1 ~]$ olsnodes -crac-scan


To display global public and global cluster_interconnect :

[oracle@node1 ~]$ oifcfg getifeth0 192.168.100.0 global publiceth1 192.168.1.0


global cluster_interconnect
To display the database registered in the repository :

[oracle@gpp4 ~]$ srvctl config databaseTESTRACDB


To display the configuration details of the database :

[oracle@TEST4 ~]$ srvctl config database -d TESTRACDBDatabase unique name:


TESTRACDBDatabase name: TESTRACDBOracle home:
/home/oracle/product/11.2.0/db_home1Oracle user: oracleSpfile:
+DATA/TESTRACDB/spfileTESTRACDB.oraDomain:Start options: openStop options:
immediateDatabase role: PRIMARYManagement policy: AUTOMATIC

Server pools: TESTRACDBDatabase instances: TESTRACDB1,TESTRACDB2Disk Groups:


DATA,ARCHMount point paths:Services: SRV_TESTRACDBType: RACDatabase is
administrator managed
To change policy of database from automatic to manual :

[oracle@TEST4 ~]$ srvctl modify database -d TESTRACDB -yMANUAL


To change the startup option of database from open to mount :

[oracle@TEST4 ~]$ srvctl modify database -d TESTDB -s mount


To start RAC listener :

[oracle@TEST4 ~]$ srvctl start listener


To display the status of the database :

[oracle@TEST4 ~]$ srvctl status database -d TESTRACDBInstance TESTRACDB1 is running


on node TEST4Instance TESTRACDB2 is running on node TEST5
To display the status services running in the database :

[oracle@TEST4 ~]$ srvctl status service -d TESTRACDBService SRV_TESTRACDB is


running on instance(s)TESTRACDB1,TESTRACDB2
To check nodeapps running on a node :

[oracle@TEST4 ~]$ srvctl status nodeappsVIP TEST4-vip is enabledVIP TEST4-vip is


running on node: TEST4VIP TEST5-vip is enabledVIP TEST5-vip is running on node:
TEST5Network is enabled

Network is running on node: TEST4Network is running on node: TEST5GSD is enabledGSD


is not running on node: TEST4GSD is not running on node: TEST5ONS is enabledONS
daemon is running on node: TEST4ONS daemon is running on node: TEST5[oracle@TEST4
~]$ srvctl status nodeapps -n TEST4VIP TEST4-vip is enabledVIP TEST4-vip is running
on node: TEST4Network is enabledNetwork is running on node: TEST4GSD is enabledGSD
is not running on node: TEST4ONS is enabledONS daemon is running on node: TEST4
To start or stop all instances associated with a database. This command alsostarts
services and listeners on each node :

[oracle@TEST4 ~]$ srvctl start database -d TESTRACDB


To shut down instances and services (listeners not stopped):

[oracle@TEST4 ~]$ srvctl stop database -d TESTRACDB


You can use -o option to specify startup/shutdown options.

To shutdown immediate database



srvctl stop database -d TESTRACDB -oimmediate
To startup force all instances

srvctl start database -d TESTRACDB -o force
To perform normal shutdown

srvctl stop database -d TESTRACDB -i instanceracnode1
To start or stop the ASM instance on racnode01 cluster node :

[oracle@TEST4 ~]$ srvctl start asm -n racnode1[oracle@TEST4 ~]$ srvctl stop asm -n
racnode1
To display current configuration of the SCAN VIP’s :

[oracle@test4 ~]$ srvctl config scanSCAN name: vmtestdb.exo.local,


Network:1/192.168.5.0/255.255.255.0/eth0SCAN VIP name: scan1, IP:
/vmtestdb.exo.local/192.168.5.100SCAN VIP name: scan2, IP:
/vmtestdb.exo.local/192.168.5.101SCAN VIP name: scan3, IP:
/vmtestdb.exo.local/192.168.5.102
Refreshing
SCAN VIP’s with new IP addresses from DNS :

[oracle@test4 ~]$ srvctl modify scan -n your-scan-name.example.com


To stop or start SCAN listener and the SCAN VIP resources :

[oracle@test4 ~]$ srvctl stop scan_listener[oracle@test4 ~]$ srvctl start


scan_listener[oracle@test4 ~]$ srvctl stop scan[oracle@test4 ~]$ srvctl start scan
To display the status of SCAN VIP’s and SCAN listeners :

[oracle@test4 ~]$ srvctl status scanSCAN VIP scan1 is enabledSCAN VIP scan1 is
running on node test4SCAN VIP scan2 is enabledSCAN VIP scan2 is running on node
test5SCAN VIP scan3 is enabledSCAN VIP scan3 is running on node test5[oracle@test4
~]$ srvctl status scan_listenerSCAN Listener LISTENER_SCAN1 is enabledSCAN listener
LISTENER_SCAN1 is running on node test4SCAN Listener LISTENER_SCAN2 is enabledSCAN
listener LISTENER_SCAN2 is running on node test5SCAN Listener LISTENER_SCAN3 is
enabledSCAN listener LISTENER_SCAN3 is running on node test5
To add/remove/modify SCAN :

[oracle@test4 ~]$ srvctl add scan -n your-scan[oracle@test4 ~]$ srvctl remove


scan[oracle@test4 ~]$ srvctl modify scan -n new-scan

To add/remove SCAN listener :

[oracle@test4 ~]$ srvctl add scan_listener[oracle@test4 ~]$ srvctl remove


scan_listener
To modify SCAN listener port :
srvctl modify scan_listener -p <port_number>srvctl modify scan_listener -p
<port_number>
(reflect changes to the current SCAN listener only)

To start the ASM instnace in mount state :

ASMCMD> startup --mount


To shut down ASM instance immediately(database instance must be shut downbefore the
ASM instance is shut down) :

ASMCMD> shutdown --immediate


Use lsop command on ASMCMD to list ASM operations :

ASMCMD > lsop


To perform quick health check of OCR :

[oracle@test4 ~]$ ocrcheckStatus of Oracle Cluster Registry is as


follows :Version : 3Total space (kbytes) : 262120Used space (kbytes) :
3304Available space (kbytes) : 258816ID : 1555543155Device/File Name :
+DATADevice/File integritycheck succeededDevice/File Name : +OCRDevice/File
integritycheck succeededDevice/File not configuredDevice/File not configured

Device/File not configuredCluster registry integrity check succeededLogical


corruption check bypassed due to non-privilegeduser
To dump content of OCR file into an xml :

[oracle@test4 ~]$ ocrdump testdump.xml -xml


To add or relocate the OCR mirror file to the specified location :

[oracle@test4 ~]$ ocrconfig -


replace ocrmirror ‘+TESTDG’
[oracle@test4 ~]$ ocrconfig -replace +CURRENTOCRDG -replacement +NEWOCRDG
To relocate existing OCR file :

[oracle@test4 ~]$ ocrconfig -


replce ocr ‘+TESTDG’

To add mirrod disk group for OCR :

[oracle@test4 ~]$ ocrconfig -add +TESTDG


To remove OCR mirror :
ocrconfig -delete +TESTDG
To remove the OCR or the OCR mirror :

[oracle@test4 ~]$ ocrconfig -replace ocr[oracle@test4 ~]$ ocrconfig replace


ocrmirror
To list ocrbackup list :

[oracle@test4 ~]$ ocrconfig -showbackup

test5 2016/04/16
17:30:29/home/oracle/app/11.2.0/grid/cdata/vmtestdb/backup00.ocrtest5 2016/04/16
13:30:29/home/oracle/app/11.2.0/grid/cdata/vmtestdb/backup01.ocrtest5 2016/04/16
09:30:28/home/oracle/app/11.2.0/grid/cdata/vmtestdb/backup02.ocrtest5 2016/04/15
13:30:26/home/oracle/app/11.2.0/grid/cdata/vmtestdb/day.ocrtest5 2016/04/08
09:30:03/home/oracle/app/11.2.0/grid/cdata/vmtestdb/week.ocr
Performs OCR backup manually :

[root@testdb1 ~]# ocrconfig -manualbackuptestdb1 2016/04/16


17:31:42/votedisk/backup_20160416_173142.ocr 0
Changes OCR autobackup directory

[root@testdb1 ~]# ocrconfig -backuploc /backups/ocr


To verify the integrity of all the cluster nodes:

[oracle@node1]$ cluvfy comp ocr -n all -verboseVerifying OCR integrityChecking OCR


integrity...Checking the absence of a non-clustered configuration...All nodes free
of non-clustered, local-only configurationsChecking daemon liveness...Check:
Liveness for "CRS daemon"Node Name Running?------------------------------------
------------------------node2 yesnode1 yesResult: Liveness check passed for "CRS
daemon"

Checking OCR config file "/etc/oracle/ocr.loc"...OCR config file


"/etc/oracle/ocr.loc" check successfulDisk group for ocr location "+DATA/testdb-
scan/OCRFILE/registry.255.903592771" is available on all thenodesDisk group for ocr
location "+CRS/testdb-scan/OCRFILE/registry.255.903735431" is available on all
thenodesDisk group for ocr location
"+MULTIPLEX/testdb-scan/OCRFILE/registry.255.903735561" is available on all
thenodesChecking OCR backup location "/bkpdisk"OCR backup location "/bkpdisk" check
passedChecking OCR dump functionalityOCR dump check passed

You might also like