Frequently used OCR commands

Hello Friend's,

In RAC, administer and set up Oracle Cluster Registry (OCR) for high availability. The often used command to manage Oracle Cluster Registry (OCR) will be examined in this article.

1) Verify OCR

2) Check OCR Backups

3) OLR Management

4) Oracle Clusterware Logs

1) Verify OCR


[root@dm01db01 gr_home]# ocrcheck
Status of Oracle Cluster Registry is as follows :
	 Version                  :          4
	 Total space (kbytes)     :     901284
	 Used space (kbytes)      :      84572
	 Available space (kbytes) :     816712
	 ID                       :  534246430
	 Device/File Name         :      +CRS1
                                    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 succeeded

2) Check OCR Backups

ocrconfig -showbackup auto - Every 4 hrs backup (3 max) ñ File Names: backup00.ocr, backup01.ocr and backup02.ocr - Daily backups (2max) ñ day.ocr and day_.ocr - Weekly backups (2 max) ñ week.ocr and week_.ocr

[root@dm01db01 gr_home]# ocrconfig -manualbackup --> manual backup of OCR

dm01db01     2025/01/11 19:36:05     +CRS1:/dm01db-cluster/OCRBACKUP/backup_20250111_193605.ocr.258.1190144165     3844574830  

[root@dm01db01 gr_home]# ocrconfig -backuploc +DATA --> to change OCR backup location

ocrconfig -restore --> to restore OCR file from backup file

3) OLR Management


[root@dm01db01 gr_home]# cat /etc/oracle/olr.loc --> Default OLR location
olrconfig_loc=/grid/app/grid19c/gr_base/crsdata/dm01db01/olr/dm01db01_19.olr
crs_home=/grid/app/grid19c/gr_home

[root@dm01db01 gr_home]# ocrcheck -local --> Check OLR configuration file location using ocrcheck
Status of Oracle Local Registry is as follows :
	 Version                  :          4
	 Total space (kbytes)     :     491684
	 Used space (kbytes)      :      83204
	 Available space (kbytes) :     408480
	 ID                       : 1745063553
	 Device/File Name         : /grid/app/grid19c/gr_base/crsdata/dm01db01/olr/dm01db01_19.olr
                                    Device/File integrity check succeeded

	 Local registry integrity check succeeded

	 Logical corruption check succeeded

[root@dm01db01 gr_home]# ocrdump -local /tmp/olr.bkp --> To see the contents of OLR

[root@dm01db01 gr_home]# ocrdump -local -xml /tmp/olr1.bkp --> To see the contents of OLR

 
[root@dm01db01 gr_home]# ocrconfig -local -manualbackup --> To take manual backup of OLR

dm01db01     2025/01/11 19:50:33     /grid/app/grid19c/gr_base/crsdata/dm01db01/olr/backup_20250111_195033.olr     3844574830     

dm01db01     2025/01/08 21:39:03     /grid/app/grid19c/gr_base/crsdata/dm01db01/olr/backup_20250108_213903.olr     3844574830 

4) Oracle Clusterware Logs

Location : $GRID_HOME/log/


[root@dm01db01 dm01db01]# pwd
/grid/app/grid19c/gr_home/log/dm01db01

[root@dm01db01 dm01db01]# ls -l
total 8
drwxr-xr-x. 6 grid oinstall   81 Jan  8 21:33 acfs
drwxr-x---. 2 grid oinstall    6 Jan  8 21:33 admin
drwxr-xr-x. 2 grid oinstall    6 Jan  8 21:33 afd
drwxr-x---. 2 grid oinstall    6 Jan  8 21:33 chad
drwxrwxrwt. 2 grid oinstall 4096 Jan 11 19:37 client
drwxr-x---. 2 root oinstall    6 Jan  8 21:33 crsd
drwxr-x---. 2 grid oinstall    6 Jan  8 21:33 cssd
drwxr-x---. 2 root oinstall    6 Jan  8 21:33 ctssd
drwxr-x---. 2 grid oinstall    6 Jan  8 21:33 diskmon
drwxr-x---. 2 grid oinstall    6 Jan  8 21:33 evmd
drwxr-x---. 2 grid oinstall    6 Jan  8 21:33 gipcd
drwxr-x---. 2 grid oinstall    6 Jan  8 21:33 gnsd
drwxr-x---. 2 grid oinstall    6 Jan  8 21:33 gpnpd
drwxr-x---. 2 grid oinstall    6 Jan  8 21:33 mdnsd
drwxr-x---. 2 root oinstall    6 Jan  8 21:34 ohasd
drwxrwxr-t. 5 grid oinstall   53 Jan  8 21:33 racg
drwxr-x---. 2 grid oinstall    6 Jan  8 21:33 srvm
drwxrwxr-x. 2 grid oinstall    6 Jan  8 21:33 xag

Alertlog for ASM


[grid@dm01db01 ~]$ cd /grid/app/grid19c/gr_base/diag/asm/+asm/+ASM1/trace
[grid@dm01db01 trace]$ ls -ltr alert_+ASM1.log 
-rw-r-----. 1 grid oinstall 150296 Jan 11 19:31 alert_+ASM1.log

Other process log files


/grid/app/grid19c/gr_home/log/dm01db01/crsd         --> crs log
/grid/app/grid19c/gr_home/log/dm01db01/ctssd        --> cts log
/grid/app/grid19c/gr_home/log/dm01db01/evmd         --> evmd log
/grid/app/grid19c/gr_home/log/dm01db01/ohasd        --> ohasd log
Previous
Next Post »