January 6, 2019

ocrconfig commands in Oracle RAC

Oracle RAC ocrconfig commands

OCRCONFIG: -- OCR (Oracle Cluster Registry) CONFIGuration tool / Oracle Local Registry (OLR) config tool

#ocrconfig -help or ocrconfig -h

ocrconfig [option]
option:
[-local] -export filename - Export OCR/OLR contents to a file
[-local] -import filename        - Import OCR/OLR contents from a file
[-local] -upgrade [user [group]] - Upgrade OCR from previous version
-downgrade [-version version string] - Downgrade OCR to the specified version
[-local] -backuploc [dirname | +diskgroupname ]        - Configure OCR/OLR backup location
[-local] -showbackup [auto|manual]  - Show OCR/OLR backup information
[-local] -manualbackup              - Perform OCR/OLR backup
[-local] -restore filename        - Restore OCR/OLR from physical backup
-replace current filename -replacement new filename - Replace an OCR device or file current filename with new filename
-add filename                      - Add a new OCR device/file
-delete filename                  - Remove a OCR device/file
-overwrite                          - Overwrite OCR configuration on disk
-repair -add filename | -delete filename | -replace current filename -replacement new filename - Repair OCR configuration on the local node
-help                                - Print out this help information

In Oracle 12c RAC,
[-local] -showbackuploc              - Show OCR/OLR backup location
-copy source_filename destination_filename  - Copy OCR physical backup from source to destination

# ocrconfig -showbackup [auto|manual]   
-- default location is $ORA_CRS_HOME/cdata/cluster_name
# ocrconfig -showbackup
# ocrconfig -backuploc dir_name    -- change OCR autobackup directory location
# ocrconfig -backuploc /u02/backups


# ocrconfig -manualbackup      -- Oracle RAC 11g command, to perform OCR backup manually
# ocrconfig -restore backup_file.ocr    -- recovering from autobackup file
# ocrconfig -restore /u02/backups/backup00.ocr

# ocrconfig -restore /u01/app/11.2.0/gi/cdata/cluster-name/backup02.ocr

# ocrconfig -export file_name.dmp [-s online]     -- exports OCR content to a file
# ocrconfig -export /tmp/ocr_exp
# ocrconfig -import file_name.dmp      -- recover OCR logically, must be done on all nodes
# ocrconfig -import /tmp/ocr_exp

# ocrconfig -replace ocr [file_name]   -- adding/replacing an OCR file
# ocrconfig -replace ocrmirror [file_name]
# ocrconfig -replace ocrmirror /data/ocr/ocrfile2

# ocrconfig -repair ocr file_name
# ocrconfig -repair ocrmirror file_name
# ocrconfig -repair -replace current_OCR_location -replacement target_OCR_location

# ocrconfig -upgrade [user [group]]         -- upgrades OCR
# ocrconfig -downgrade [-version version_string]   -- downgrades OCR

# ocrconfig -overwrite

# ocrconfig –local –import file_name
# ocrconfig –local –manualbackup
# ocrconfig -local -backuploc new_olr_backup_path
# ocrconfig -local -restore file_name
# ocrconfig -local -restore $GRID_HOME/cdata/host06/backup_20171106_02946.olr   --restoring OLR file

# ocrconfig -add +new_disk_group
# ocrconfig -add file_location
# ocrconfig -add /dev/sdd1
# ocrconfig -delete +unused_disk_group
# ocrconfig -delete old_storage_location
# ocrconfig -delete /dev/raw/raw2

Log file will be $ORACLE_HOME/log/node_name/client/ocrconfig_pid.log

Debugging can be controlled through $ORA_CRS_HOME/srvm/admin/ocrlog.ini

How to take backup of OCR / OLR file?
# ocrconfig -manualbackup
# ocrconfig -export file_name.dmp

How to recover OCR / OLR file?
# ocrconfig -restore backup_file.ocr
# ocrconfig -import file_name.dmp

Related Oracle RAC Articles:     ocrdump commands RAC     ocrcheck commands RAC


No comments:

Post a Comment