Managing Oracle clusterware (OCR)

Source: Internet
Author: User

Managing Oracle clusterware (OCR)

Oracle Clusterware places the configuration information of the entire cluster on shared storage. The information includes the list of cluster nodes, the ing between cluster database instances and nodes, and the CRS Application resource information. The storage location is on the OCR Disk. in the entire cluster, only one Node can perform read and write operations on the OCR Disk. This Node is called the Master Node and all nodes will keep an OCR copy in the memory, at the same time, an OCR Process reads content from this memory. When the OCR content changes, the OCR Process of the Master Node is responsible for synchronizing the OCR Process to other nodes.

If you already mirror the OCR, then you do not need to add an OCR location; Oracle automatically manages two OCRs when it mirrors the OCR. Oracle RAC environments do not support moreTwo OCRs, a primary OCR and a second OCR.

[SQL]
  1. -- Ocrconfig syntax
  2. [Root @ rac1 ~] # Ocrconfig-help
  3. Name:
  4. Ocrconfig-Configuration toolForOracle Cluster Registry.
  5. Synopsis:
  6. Ocrconfig [Option]
  7. Option:
  8. -Export <filename> [-s online]
  9. -Export cluster register contentsToA file
  10. -Import <filename>-Import cluster registry contentsFromA file
  11. -Upgrade [<User> [<Group>]
  12. -Upgrade cluster registryFromPrevious version
  13. -Downgrade [-version <version string>]
  14. -Downgrade cluster registryToThe specified version
  15. -Backuploc <dirname>-Configure periodic backup location
  16. -Showbackup-Show backup information
  17. -Restore <filename>-RestoreFromPhysical backup
  18. -ReplaceOcr | ocrmirror [<filename>]-Add/Replace/Remove a OCR device/file
  19. -Overwrite-Overwrite OCR configurationOnDisk
  20. -Repair ocr | ocrmirror <filename>-RepairLocalOCR configuration
  21. -Help-PrintOutThis help information
  22. Note:
  23. A log file will be createdIn
  24. $ ORACLE_HOME/log/
  25. You have file creationPrivileges InThe above directory before
  26. Running this tool.
Automatic OCR backup
-Every 4 hours: CRS retains the last 3 copies.
-At the end of each day: CRS retains the last two copies.
-At the end of each week: CRS retains the last two copies.
Automatic Backup is completed by the Master Node CRSD process. The default backup location is under the $ CRS_HOME/crs/cdata/<cluster_name> directory, you can use the ocrconfig-backuploc <directory_name> command to modify the directory.

Example:

[SQL]
  1. -- Display backup information
  2. [Root @ rac1 ~] # Ocrconfig-showbackup
  3. Rac1 20:45:32/u01/crs1020/cdata/crs
  4. Rac1 16:45:47/u01/crs1020/cdata/crs
  5. Rac1 22:18:40/u01/crs1020/cdata/crs
  6. Rac1 16:45:47/u01/crs1020/cdata/crs
  7. Rac1 16:45:47/u01/crs1020/cdata/crs
  8. [Root @ rac1 ~] # Ll/u01/crs1020/cdata/crs/
  9. Total 28296
  10. -Rw-r-- R -- 1 root 4816896 Feb 20 20:45 backup00.ocr
  11. -Rw-r-- R -- 1 root 4816896 Feb 19 16:45 backup01.ocr
  12. -Rw-r-- R -- 1 root 4816896 Feb 18 22:18 backup02.ocr
  13. -Rw-r-- R -- 1 root 4816896 Feb 20 20:45 day _. ocr
  14. -Rw-r-- R -- 1 root 4816896 Feb 19 16:45 day. ocr
  15. -Rw-r-- R -- 1 root 4816896 Feb 19 16:45 week. ocr
  16. -- Change the backup location
  17. [Root @ rac1 ~] # Ocrconfig-backuploc/oracle/backup/ocr
Use physical backup to restore OCR
1. Find the physical backup:
$ Ocrconfig-showbackup
2. Check its content:
# Ocrdump file_name-backupfile
3. Stop Oracle Clusterware on all nodes:
# Crsctl stop crs
4. Restore OCR physical backup:
# Ocrconfig-restore <crs home>/cdata/jfv_clus/day. ocr
5. Restart Oracle Clusterware on all nodes:
# Crsctl start crs
6. Check OCR integrity:
$ Cluvfy comp ocr-n all
Example:

[SQL]
  1. -- Find physical backup:
  2. [Root @ rac1 ~] # Ocrconfig-showbackup
  3. -- Check its content. dump fails:
  4. [Root @ rac1 crs] # ocrdump-backupfileDay. Ocr
  5. PROT-302: FailedToInitialize ocrdump
  6. -- Stop Oracle Clusterware on all nodes:
  7. [Root @ rac2 ~] # Crsctl stop crs
  8. [Root @ rac1 ~] # Crsctl stop crs
  9. -- Restore OCR physical backup:
  10. [Root @ rac1 ~] # Ocrconfig-restore/u01/crs1020/cdata/crs/backup00.ocr
  11. -- Restart Oracle Clusterware on all nodes:
  12. [Root @ rac2 ~] # Crsctl start crs
  13. [Root @ rac1 ~] # Crsctl start crs
  14. -- Check OCR integrity:
  15. RACDB1 @ rac1/home/oracle $ cluvfy comp ocr-nAll
Manual backup OCR
The optical character recognition (OCR) should be automatically backed up to other storage devices every day:
-Use the preferred backup tool.
Logical backup of OCR should be performed before and after major changes:
# Ocrconfig-export file name
Make sure that the OCR backup that matches the current system configuration is restored.
  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.