search
HomeDatabaseMysql TutorialOracle RAC OCR 与健忘症

OCR就好比Windows的一个注册表,存储了所有与集群,RAC数据库相关的配置信息。而且是公用的配置,也就是说多个节点共享相同的配置

OCR就好比Windows的一个注册表,存储了所有与集群,,RAC数据库相关的配置信息。而且是公用的配置,也就是说多个节点共享相同的配置信息。因此该配置应当存储于共享磁盘。本文主要基于Oracle 10g RAC描述了集群的OCR以及OCR产生的健忘问题。

一、OCR的特点
  类似于Windows注册表,用于存储所有与集群,RAC数据库相关的配置信息
  被多个节点所共享,因此,只能存储于共享磁盘。支持单disk以及镜像方式来存放。大小通常100MB-1GB。
  在Oracle 10g中,只能存储于裸设备或者ocfs文件系统,以及nfs,gfs文件系统。Oracle 11g中可以直接存放在asm中。
  整个集群及RAC数据库配置需要在OCR中来进行维护。换句话说,就像windows注册表的导入导出,修改、更新键值等。
  通常情况下,OCR中的配置信息会随着使用工具对其进行自动更新。如SRVCTL,DBCA,OEM,NETCA等。
  而OCR的配置与维护则通常包括OCR的校验,备份,查看OCR的内容,添加移出OCR文件,重定位,修复OCR文件。
  OCR磁盘最多只能有两个,一个Primary OCR 和一个Mirror OCR,两个OCR 磁盘互为镜像,以防止OCR 磁盘的单点故障。
  注:集群,我们通常指的是clusterware,而RAC数据库,即是基于集群之上的数据库。

 

二、OCR包含的内容
  OCR中通常包含下列内容
  节点成员信息
  数据库实例,节点,以及其他的映射关系
  ASM
  资源配置信息(vip,services等等)
  服务特性(Service characteristics)
  Oracle集群中相关进程的信息
  CRS控制的第三方应用程序信息

 

三、OCR的工作过程
        由于OCR存放于共享存储,因此在Cluster中的每个节点都通过本地OCR进程访问OCR缓存在其内存中维护着的一个副本。同时由于对OCR
    的所有操作必须确保OCR内容完整性,所以在ORACLE Clusterware运行过程中,并不是所有结点都能操作OCR Disk。 只有一个OCR进程对共
    享存储中的OCR进行读写操作。这个节点叫作OCR Master结点。此进程负责刷新(refresh)其自己拥有的本地缓存以及Cluster中其他节点
    的OCR cache。也就是说,OCR客户端查询都是通过本地OCR进程来查询本地的一个OCR副本,而当客户端需要更新OCR时,它们将通过本地OCR
    进程与那个扮演读写OCR文件的进程OCR Master进行交互。
   
    #下面是一个两节点的RAC,可以看出ocr master节点起初在第一个节点,后来转移到第二个节点,再后来又到第一个节点。
    #这是由于节点一关闭或节点一上的集群处于不可用状态导致ocr master节点发生了转移。
    oracle@bo2dbp:/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
  oracle@bo2dbp:~> 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客户端应用有:Oracle通用安装器(OUI)、SRVCTL、企业管理器(EM)、DBCA、DBUA、NetCA和虚拟网络协议助理(VIPCA)。
    此外,OCR维护管理着CRS内部中定义的各种应用程序的资源的依赖和状态信息,特别是Database、Instance、Services和节点的应用程序。

    OCR配置文件的名字是ocr.loc,Linux下位于/etc/oracle/ocr.loc。
    后附OCR结构图

linux

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What Are the Limitations of Using Views in MySQL?What Are the Limitations of Using Views in MySQL?May 14, 2025 am 12:10 AM

MySQLviewshavelimitations:1)Theydon'tsupportallSQLoperations,restrictingdatamanipulationthroughviewswithjoinsorsubqueries.2)Theycanimpactperformance,especiallywithcomplexqueriesorlargedatasets.3)Viewsdon'tstoredata,potentiallyleadingtooutdatedinforma

Securing Your MySQL Database: Adding Users and Granting PrivilegesSecuring Your MySQL Database: Adding Users and Granting PrivilegesMay 14, 2025 am 12:09 AM

ProperusermanagementinMySQLiscrucialforenhancingsecurityandensuringefficientdatabaseoperation.1)UseCREATEUSERtoaddusers,specifyingconnectionsourcewith@'localhost'or@'%'.2)GrantspecificprivilegeswithGRANT,usingleastprivilegeprincipletominimizerisks.3)

What Factors Influence the Number of Triggers I Can Use in MySQL?What Factors Influence the Number of Triggers I Can Use in MySQL?May 14, 2025 am 12:08 AM

MySQLdoesn'timposeahardlimitontriggers,butpracticalfactorsdeterminetheireffectiveuse:1)Serverconfigurationimpactstriggermanagement;2)Complextriggersincreasesystemload;3)Largertablesslowtriggerperformance;4)Highconcurrencycancausetriggercontention;5)M

MySQL: Is it safe to store BLOB?MySQL: Is it safe to store BLOB?May 14, 2025 am 12:07 AM

Yes,it'ssafetostoreBLOBdatainMySQL,butconsiderthesefactors:1)StorageSpace:BLOBscanconsumesignificantspace,potentiallyincreasingcostsandslowingperformance.2)Performance:LargerrowsizesduetoBLOBsmayslowdownqueries.3)BackupandRecovery:Theseprocessescanbe

MySQL: Adding a user through a PHP web interfaceMySQL: Adding a user through a PHP web interfaceMay 14, 2025 am 12:04 AM

Adding MySQL users through the PHP web interface can use MySQLi extensions. The steps are as follows: 1. Connect to the MySQL database and use the MySQLi extension. 2. Create a user, use the CREATEUSER statement, and use the PASSWORD() function to encrypt the password. 3. Prevent SQL injection and use the mysqli_real_escape_string() function to process user input. 4. Assign permissions to new users and use the GRANT statement.

MySQL: BLOB and other no-sql storage, what are the differences?MySQL: BLOB and other no-sql storage, what are the differences?May 13, 2025 am 12:14 AM

MySQL'sBLOBissuitableforstoringbinarydatawithinarelationaldatabase,whileNoSQLoptionslikeMongoDB,Redis,andCassandraofferflexible,scalablesolutionsforunstructureddata.BLOBissimplerbutcanslowdownperformancewithlargedata;NoSQLprovidesbetterscalabilityand

MySQL Add User: Syntax, Options, and Security Best PracticesMySQL Add User: Syntax, Options, and Security Best PracticesMay 13, 2025 am 12:12 AM

ToaddauserinMySQL,use:CREATEUSER'username'@'host'IDENTIFIEDBY'password';Here'showtodoitsecurely:1)Choosethehostcarefullytocontrolaccess.2)SetresourcelimitswithoptionslikeMAX_QUERIES_PER_HOUR.3)Usestrong,uniquepasswords.4)EnforceSSL/TLSconnectionswith

MySQL: How to avoid String Data Types common mistakes?MySQL: How to avoid String Data Types common mistakes?May 13, 2025 am 12:09 AM

ToavoidcommonmistakeswithstringdatatypesinMySQL,understandstringtypenuances,choosetherighttype,andmanageencodingandcollationsettingseffectively.1)UseCHARforfixed-lengthstrings,VARCHARforvariable-length,andTEXT/BLOBforlargerdata.2)Setcorrectcharacters

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor