Oracle Clusterware manual control command lines

Cluster Ready Service

- crsctl must run as root:

> crsctl stop crs
> crsctl start crs

> crsctl disable crs
> crsctl enable crs


- crs_stat run as root or oracle:

> crs_stat
> crs_stat -t
> crs_stat -p ora.RACDB.RACDB1.inst


- List nodes:

> olsnodes


Voting Disk Configuration

- Dynamically change voting disk, as root:

> crsctl add css votedisk <-force>
> crsctl delete css votedisk <-force>

* Use -force only when cluster node is down.

> crsctl query css votedisk

Oracle Cluster Registry (OCR)

- Oracle Cluster Registry (OCR) is backed up physically:

- every 4 hours to $CRS_HOME/cdata/crs/*.ocr
- at the end of every day to $CRS_HOME/cdata/crs
- at end of every week to $CRS_HOME/cdata/crs

run as root:

> ocrconfig -export FILENAME.dmp - backup OCR files
> ocrdump -backupfile FILENAME - backup OCR files

* stop crs first before restore: crsctl stop crs
> ocrconfig -restore day.ocr - restore OCR files
> ocrconfig -import FILENAME.dmp - restore OCR files

* start crs after restore:
> crsctl start crs

* Show backups list:
> ocrconfig -showbackup

* Change backup location:
> ocrconfig -backuploc /orabak/ocr

* Check OCR registry:
> cluvfy comp ocr -n all

* Replace an OCR mirror
> ocrcheck
> ocrconfig -replace ocrmirror /oradata/ocr2
> ocrconfig -repair ocrmirror /oradata/ocr2

Network Services

- Add VIP address:
> srvctl modify nodeapps -n rac1 -A
> srvctl start nodeapps -n rac1

> crs_stat -p

Database Services

- Create database Services with command line:

> srvctl add service -d RACDB -s REPORT -r RACDB1,RACDB2 -a RACDB3
> srvctl add service -d RACDB -s BATCH1 -r RACDB2,RACDB1 -a RACDB1

-r = Preferred
-a = Available

> srvctl start service -d RACDB -s BATCH1 -i RACDB2,RACDB2
> srvctl stop service -d RACDB -s BATCH1 -i RACDB1
> srvctl disable service -d RACDB -s BATCH1 -i RACDB1

- Modify an Available instance as a Preferred instance:

> srvctl modify service -d RACDB -s BATCH1 -i RACDB3,RACDB2 -a RACDB1 -n
-n to remove initial settings
> srvctl stop service -d RACDB -s BATCH1 -i RACDB1 -f
> srvctl start service -d RACDB -s BATCH1 -i RACDB1