Oracle Technologies Blog

By ASKM

OCR administration

Posted by Srikrishna Murthy Annam on March 28, 2010

OCR administration in RAC

Every clustering technology requires a repository through which the clustering software and other cluster-aware application processes can share information. Oracle Clusterware uses Oracle Cluster Registry to store information about resources it manages.

Command Option Example
OCRCONFIG -EXPORT ,

-IMPORT

ocrconfig -export <export file> -s online

ocrconfig -import <export file>

-UPGRADE ,

-DOWNGRADE

-BACKUPLOC,

-SHOWBACKUP ,

-MANUALBACKUP,

-RESTORE,

ocrconfig -backuploc /shared/bak

ocrconfig –showbackup

ocrconfig –manualbackup

ocrconfig -restore <CRS HOME>/cdata/askm/day.ocr

-REPLACE OCRMIRROR,

-REPLACE OCR

#ocrconfig -replace ocrmirror <filename>
#ocrconfig -replace ocr <filename>
-OVERWRITE
-REPAIR OCRMIRROR,

-REPAIR OCR

ocrconfig -repair ocrmirror <filename>

ocrconfig -repair ocr <filename>

OCRDUMP ocrdump -backupfile file_name
OCRCHECK NA ocrcheck

=> Automatic OCR Backups
OCR is automatically backed up physically:

  • Every four hours: CRS keeps the last three copies.
  • At the end of every day: CRS keeps the last two copies.
  • At the end of every week: CRS keeps the last two copies.
$ cd $ORACLE_BASE/crs/cdata/askm
$ ls -lt
-rw-r–r– 1 root root 4784128 Jan 9 02:54 backup00.ocr
-rw-r–r– 1 root root 4784128 Jan 9 02:54 day_.ocr
-rw-r–r– 1 root root 4784128 Jan 8 22:54 backup01.ocr
-rw-r–r– 1 root root 4784128 Jan 8 18:54 backup02.ocr
-rw-r–r– 1 root root 4784128 Jan 8 02:54 day.ocr
-rw-r–r– 1 root root 4784128 Jan 6 02:54 week_.ocr
-rw-r–r– 1 root root 4005888 Dec 30 14:54 week.ocr

=> Manual OCR Backups

# ocrconfig -manualbackup  -> Physical Backups
# ocrconfig -export <filename> -> Logical Backups

=> Recover OCR using Physical Backups

$ ocrconfig -showbackup
# ocrdump -backupfile file_name
# crsctl stop crs
# ocrconfig -restore <CRS HOME>/cdata/askm/day.ocr
# crsctl start crs
$ cluvfy comp ocr -n all

=> Recover OCR using Logical Backups

# crsctl stop crs
# ocrconfig -import <export file>
# crsctl start crs
$ cluvfy comp ocr -n all

=> Replacing/Adding an OCR devide or OCR mirror

#ocrconfig -replace ocrmirror <filename>
#ocrconfig -replace ocr <filename>

=> Removing an OCR device or OCR mirror

#ocrconfig -replace ocr
#ocrconfig -replace ocrmirror

=> Moving OCR file to different storage

Consider that we are moving OCR files from OCFS to raw devices

Considerthe OCR file are located in the ocfs2 file system:

/ocfs2/ocr1
/ocfs2/ocr2

Create raw device files of at least 100 MB.  In this example the new OCR file will be on the following devices:

/dev/raw/raw1
/dev/raw/raw2

Once the raw devices are created, use the dd command to zero out the device and make sure no data is written to the raw devices:

# dd if=/dev/zero of=/dev/raw/raw1
# dd if=/dev/zero of=/dev/raw/raw2

Now you are ready to move/replace the OCR file to the new storage location.

Move/Replace the OCR device

# ocrconfig -replace ocr /dev/raw/raw1

Add /dev/raw/raw2 as OCR mirror device

# ocrconfig -replace ocrmirror /dev/raw/raw2

Command

Option

Example

OCRCONFIG

-EXPORT ,

-IMPORT

-UPGRADE ,

-DOWNGRADE

-BACKUPLOC,

-SHOWBACKUP ,

-MANUALBACKUP,

-RESTORE,

-REPLACE OCRMIRROR,

-REPLACE OCR

-OVERWRITE

-REPAIR OCRMIRROR,

-REPAIR OCR

OCRDUMP

OCRCHECK

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: