Oracle RAC OCR and Amnesia

Source: Internet
Author: User

OCR is like a registry of Windows that stores all the configuration information associated with a cluster, RAC database. It is also a common configuration, which means that multiple nodes share the same configuration information. Therefore, the configuration should be stored on the shared disk. This paper mainly describes the OCR of cluster and the forgetfulness problem of OCR based on Oracle 10g RAC.

First, the characteristics of OCR
Similar to the Windows registry, used to store all configuration information related to the cluster, RAC database
is shared by multiple nodes, so it can only be stored on a shared disk. Supports single disk and mirrored mode for storage. The size is usually 100MB-1GB.
In Oracle 10g, it can only be stored on bare devices or OCFS file systems, as well as Nfs,gfs file systems. The Oracle 11g can be stored directly in ASM.
The entire cluster and RAC database configuration needs to be maintained in OCR. In other words, it's like importing and exporting Windows Registry, modifying, updating key values, and so on.
Typically, the configuration information in OCR is automatically updated as you use the tool. such as SRVCTL,DBCA,OEM,NETCA and so on.
While the configuration and maintenance of OCR usually includes OCR checksum, backup, view OCR content, add remove OCR file, reposition, repair OCR file.
There can be up to two OCR disks, one primary OCR and one mirror OCR, and two OCR disks mirroring each other to prevent a single point of failure of the OCR disk.
Note: Clusters, we usually refer to Clusterware, and the RAC database, which is a database based on the cluster.

Ii. what is included in OCR
OCR usually contains the following content
Node member information
Database instances, nodes, and other mapping relationships
Asm
Resource configuration information (vip,services, etc.)
Service features (characteristics)
Information about processes in the Oracle cluster
CRS-controlled third-party application information

Third, the working process of OCR
Because OCR is stored in shared storage, each node in cluster accesses a copy of the OCR cache maintained in its memory through the local OCR process. Also due to the OCR
All operations must ensure the integrity of the OCR content, so not all nodes can operate OCR Disk during the operation of the Oracle Clusterware. There is only one OCR process for the total
Read-write operations with OCR in the storage. This node is called the OCR Master node. This process is responsible for refreshing (refresh) its own local cache and other nodes in cluster
The OCR cache. That is, OCR client queries use local OCR processes to query a local OCR copy, and when the client needs to update OCR, they pass local OCR
The process interacts with the OCR master, the process that plays the read-write OCR file.

#下面是一个两节点的RAC, you can see that the OCR Master node was initially on the first node, then moved to the second node, and then to the first node.
#这是由于节点一关闭或节点一上的集群处于不可用状态导致ocr Master node has been transferred.
[email protected]:/u01/oracle/crs/log/bo2dbp/cssd> Cat Ocssd.log | grep "Master Node"
[CSSD] clss-3001:local node number 1, master node number 1
[CSSD] clss-3001:local node number 1, master node number 1
[CSSD] clss-3001:local node number 1, master node number 1
[CSSD] clss-3001:local node number 1, master node number 1
[CSSD] clss-3001:local node number 1, master node number 2
[CSSD] clss-3001:local node number 1, master node number 1
[email protected]:~> grep-i "Master node" $ORA _crs_home/log/bo2dbp/cssd/ocssd.log | Tail-1
[CSSD] clss-3001:local node number 1, master node number 1

OCR client applications are: Oracle Universal Installer (OUI), SRVCTL, Enterprise Manager (EM), DBCA, Dbua, NETCA, and Virtual network Protocol Assistant (VIPCA).
In addition, OCR maintenance manages the dependency and state information of resources for various applications defined within the CRS, especially applications for database, Instance, services, and nodes.

The name of the OCR configuration file is ocr.loc,linux located under/etc/oracle/ocr.loc.
Post-attached OCR structure diagram

Iv. representation of the contents of the OCR store
Similarly to the Windows registry analogy, OCR its storage content of the same expression, is the use of key-value pairs of the way to show.
The entire OCR information is a tree-shaped structure with 3 large branches. are System,database and CRS respectively.
There are many small branches under each branch. The information for these records can only be modified by the root user.
You can use the Ocrdump command to export all of its contents or by branch.

V. Amnesia
Forgetfulness is due to the fact that a node has updated the contents of OCR, while other nodes in the cluster are in the shutdown, maintenance or restart phase, the OCR master process is too late to update its information
Inconsistencies that result from caching of these exception nodes. For example, a command to add an OCR image is issued at the a node, at which point the B node is in the restart phase. After reboot A has been updated,
At this point, B does not know that it has added a new mirror disk for OCR, which is born of forgetfulness.

In the following example, when the new OCR is added to the node bo2dbp, the configuration file changes, and the ocr.loc of the node Bo2dbs is updated, and if Bo2dbs is in the shutdown or restart phase, the
The document does not get the update, this accession to the throne forgetfulness one case.

[email protected]:~> More/etc/oracle/ocr.loc
#Device/file getting replaced by DEVICE/DEV/RAW/RAW11
Ocrconfig_loc=/dev/raw/raw1
OCRMIRRORCONFIG_LOC=/DEV/RAW/RAW11 #可以看到增加了ocrmirror位置
Local_only=false

Author:robinson Cheng
blog:http://blog.csdn.net/robinson_0612

VI. OCR structure diagram

Ext.: http://blog.csdn.net/leshami/article/details/8572625

Oracle RAC OCR and Amnesia

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.