Table of Contents
OCR
备份
日志
检测
导入与恢复
查看主和镜像
voting disk
查看
VIPCA
Home Database Mysql Tutorial 【ORACLE RAC】root.sh原理,ocr管理

【ORACLE RAC】root.sh原理,ocr管理

Jun 07, 2016 pm 03:06 PM
ocr oracle rac principle manage

************************************************************************ ****原文: blog.csdn.net/clark_xu 徐长亮的专栏 ************************************************************************ Root.sh的原理 1. In root.sh script, it will ad

************************************************************************ ****原文:blog.csdn.net/clark_xu  徐长亮的专栏 ************************************************************************ Root.sh的原理

1.      In root.sh script, it will addCRS related entry in /etc/inittab,

2.      Root.sh运行

/oracle/product/crs/install/rootinstall

/oracle/product/crs/install/rootconfig

3.      Rootinstall作用:

a)        /oracle/product/crs/bin/crs*的程序改成root 555

b)        /oracle/product/crs/bin/crsd改为 744

c)        建立路径:/oracle/product/crs/crs/init

d)        /oracle/product/crs/crs/public被所有读写 777.

e)        Crs/evm  crs/evm/init 750

f)         Crs/css crs/css/initcrs/css/log  crs/css/auth  711

4.      Rootconfig的作用

a)        概述:

                        i.             1) Stop if any GSDs are runningfrom 9.x oracle homes

                      ii.             2) Initialize new OCR device orupgrade the existing OCR device

                     iii.             3) Setup OCR for running CRSstack

                     iv.             4) Copy the CRS init script toinit.d for init process to start

                      v.              5) Start the CRS stack

                     vi.              6) Configure NodeApps if CRS is up and runningon all nodes

b)        Setup ocr

                        i.             $CH/bin/clscfg -install -nn$CRS_NODE_NAME_LIST -pn $CRS_PRIVATE_NAME_LIST \

      $HOSTNAMES_ARGS-o $CH -c $CRS_CLUSTER_NAME -l "$CRS_LANGUAGE_ID" -q $CRS_V

OTING_DISKS \

      $CLSCFG_MISCNT

c)        更改/tmp/.oracle的属性

                        i.             复杂# basic copies first...

                      ii.             $CP $CH/evm/admin/init.evmd$ID/init.evmd || { $ECHO $?; exit 1; }

                     iii.             $CP $CH/css/admin/init.cssd $ID/init.cssd|| { $ECHO $?; exit 1; }

                     iv.             $CP $CH/crs/admin/init.crsd$ID/init.crsd || { $ECHO $?; exit 1; }

                      v.             $CP $CH/crs/admin/init.crs$ID/init.crs || { $ECHO $?; exit 1; }

d)        启动crs stack过程

                        i.             # Prepare to start the daemons.    /init.crs start

                      ii.             #Check to see if they are goingto start.

$ID/init.cssd startcheck CSS

          $CRSCTL check install -wait 600

     检查VIP$CH/bin/vipca -silent -nodelist $CRS_NODELIST -nodevips$CRS_NODEVIPS

5.      Init.crs

a)        概述

                        i.             #    init.crs start       manual startup of the CRS stack

                      ii.             #    init.crs stop        shuts down the CRS stack

                     iii.             #    init.crs disable     prevents CRS stack from starting at boottime

                     iv.             #    init.crs enable      allows CRS stack to start at boot time

b)        cssd and evmd. evmd should beshutdown before crsd.

6.      Init.cssd

a)        [root@host1 etc]# ps -ef | grep-v grep | grep init.cssd

b)        root      2598    1  0 08:16 ?        00:00:11 /bin/sh /etc/init.d/init.cssdfatal

c)        root      3014 2598  0 08:17 ?        00:00:00 /bin/sh /etc/init.d/init.cssddaemon

d)        [root@host1 etc]# pstree 2598-a

OCR

1.定义

集群注册表(Oracle ClusterRegistryOCR):维护集群的配置信息及集群中任何集群数据库的配置信息。OCR也管理那些Oracle Clusterware控制的相关进程的相关信息。OCR将配置信息存储在一个目录树结构中的一系列关键字-值对中(key-value pairs)。OCR必须位于集群中所有结点可同时访问的共享磁盘中。Oracle Clusterware可使用多重OCRmultiplex或称为多路复用)。Oracle建议使用此特性以保证高可用性。你可以在联机时替换一个故障的OCR,可通过支持的API(如企业管理器、srvctldbca)来更新OCR

备份

[root@host1 crs]# ls

backup00.ocr  backup01.ocr day_.ocr  day.ocr  OCRDUMPFILE week.ocr

[root@host1 crs]# pwd

/oracle/product/crs/cdata/crs

Oracle 4个小时对其做一次备份,并且保留最后的3个备份,以及前一天,前一周的最后一个备份。只有一个节点能对OCR Disk进行读写操作,这个节点叫作Master Node,所有节点都会在内存中保留一份OCR的拷贝。

日志

/oracle/product/crs/log/host1/client/路径下面

OCR磁盘最多只能有两个,一个PrimaryOCR和一个Mirror OCR

/oracle/product/crs/cdata/crs /OCRDUMPFILE文件中存放ocr注册表信息。

检测

cluvfy comp ocr -n all

导入与恢复

[root@host1 oracle]#/oracle/product/crs/bin/ocrconfig -import /oracle/ocr.exp

 [root@host1oracle]# /oracle/product/crs/bin/ocrconfig -export /oracle/ocr.exp

恢复OCR文件:ocrconfig-restore /u01/app/oracle/product/10.2.0/crs_1/cdata/crs/backup00.ocr

添加OCR文件,crs必须启动,否则会遇到PROT-1错误:(PROT-1:Failed to initialize ocrconfig

查看主和镜像

[oracle@host1 crs]$ cat /etc/oracle/ocr.loc

ocrconfig_loc=/dev/raw/raw1

ocrmirrorconfig_loc=/dev/raw/raw2

local_only=FALSE

voting disk

查看

[oracle@host1 crs]$ crsctl query cssvotedisk

 0.    0    /dev/raw/raw3

 1.    0    /dev/raw/raw4

 2.    0    /dev/raw/raw5

 

located 3 votedisk(s).

VIPCA

出于种种原因我们可能需要为已安装的Oracle集群软件修改其使用的公用或私有网络所使用的网络接口(How to Change Interconnect/Public Interface IP or Subnet in OracleClusterware),这些共有或私有网络(public/private network)被保存在ocr中,我们需要以root用户的身份执行oifcfg命令来对这些网络接口信息进行修改:

/* 使用ocrdump命令转储ocr信息 */

 

[oracle@vrh1 ~]$ ocrdump ocr

 

[oracle@vrh1 ~]$ cat ocr

 

[SYSTEM.css.interfaces]UNDEF

[SYSTEM.css.interfaces.global]UNDEF

[SYSTEM.css.interfaces.global.eth0]UNDEF

[SYSTEM.css.interfaces.global.eth0.131|d32|d1|d0]UNDEF

[SYSTEM.css.interfaces.global.eth0.131|d32|d1|d0]ORATEXT: public

 

[SYSTEM.css.interfaces.global.eth1]UNDEF

[SYSTEM.css.interfaces.global.eth1.131|d33|d1|d0]UNDEF:

[SYSTEM.css.interfaces.global.eth1.131|d33|d1|d0]ORATEXT: cluster_interconnect

 

.............

 

/* 实际上cssmisscount参数和votingdisk所在的位置也存在ocr文件中  */

 

[SYSTEM.css.misscount]UB4 (10) : 60

[SYSTEM.css.diskfile]ORATEXT :/dev/raw/raw2

 

1.首先我们可以通过oifcfg getif了解当前的public/interconnect网络配置情况:

[root@vrh1 ~]# who am i

root    pts/1        2011-04-18 18:23(192.168.0.1)

 

[root@vrh1 ~]# cd $ORA_CRS_HOME/bin

 

[root@vrh1 bin]# oifcfg getif

eth0 131.32.1.0  global  public

eth1 131.33.1.0  global  cluster_interconnect

 

/* 可以看到这里分别用131.32.1/2网段配置了publiccluster_interconnect网络  */

 

2.确认在/etc/hosts文件中为新的网络接口IP做了必要的修改,之后我们要保证当前CRS已经启动(否则将出现PRIF-10: failed to initialize the cluster registry错误而无法配置),使用oifcfgsetif命令首先添加新的public公用网络接口:

[root@vrh1 bin]# oifcfg delif -global eth0

 

/* 首先删除旧有的公用网络接口信息  */

 

[root@vrh1 bin]# oifcfg setif -globaleth0/192.168.1.0:public

 

/* 注意这里制定192.168.1.0这个网段即可,不用输入完整的ip */

 

/* 因为以上操作是global全局操作,在单个节点完成即可 */

 

3.修改内联网络(cluster_interconnect)接口的方法也是类似的:

[root@vrh1 bin]# oifcfg delif -global eth1

 

[root@vrh1 bin]# oifcfg setif -globaleth1/192.168.0.0:cluster_interconnect

 

/* public network配置时类似指定网段即可  */

 

4.确认网络接口的修改情况,以及当前数据库使用的inter connecter状况:

[oracle@vrh1 ~]$ oifcfg getif

eth0 192.168.1.0  global  public

eth1 192.168.0.0  global  cluster_interconnect

 

SQL> select * from x$skgxpia;

 

ADDR           INDX    INST_ID PUB_SKGXPI PICKED_SKGXPIA

-------- ---------- ---------- ---------------------------------------------

NAME_SKGXPIA    IP_SKGXPIA

--------------- ----------------

4572EC54          0          1 N          OSD

eth1            131.33.1.107

 

/* 可以看到当前数据库实例仍使用旧有的interconnect网络 */

 

[root@vrh1 ~]# crsctl stop crs

 

[root@vrh1 ~]# crsctl start crs

 

[oracle@vrh1 ~]$ sqlplus / as sysdba

 

Oracle Database 10g Enterprise EditionRelease 10.2.0.4.0 - Production

With the Partitioning, Real ApplicationClusters, OLAP, Data Mining

and Real Application Testing options

 

SQL>

SQL> select * from x$skgxpia;

 

ADDR           INDX    INST_ID PUB_SKGXPI PICKED_SKGXPIA

-------- ---------- ---------- ---------------------------------------------

NAME_SKGXPIA    IP_SKGXPIA

--------------- ----------------

4572EC54          0          1 N          OSD

eth1            192.168.0.107

 

/* 这里需要重启CRS后实例才能正确使用更新后的clusterinterconnect网络接口 */

Statement of this Website
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

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 Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What to do if the oracle can't be opened What to do if the oracle can't be opened Apr 11, 2025 pm 10:06 PM

Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.

How to solve the problem of closing oracle cursor How to solve the problem of closing oracle cursor Apr 11, 2025 pm 10:18 PM

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

How to create cursors in oracle loop How to create cursors in oracle loop Apr 12, 2025 am 06:18 AM

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

How to paginate oracle database How to paginate oracle database Apr 11, 2025 pm 08:42 PM

Oracle database paging uses ROWNUM pseudo-columns or FETCH statements to implement: ROWNUM pseudo-columns are used to filter results by row numbers and are suitable for complex queries. The FETCH statement is used to get the specified number of first rows and is suitable for simple queries.

How to stop oracle database How to stop oracle database Apr 12, 2025 am 06:12 AM

To stop an Oracle database, perform the following steps: 1. Connect to the database; 2. Shutdown immediately; 3. Shutdown abort completely.

What steps are required to configure CentOS in HDFS What steps are required to configure CentOS in HDFS Apr 14, 2025 pm 06:42 PM

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

How to create oracle dynamic sql How to create oracle dynamic sql Apr 12, 2025 am 06:06 AM

SQL statements can be created and executed based on runtime input by using Oracle's dynamic SQL. The steps include: preparing an empty string variable to store dynamically generated SQL statements. Use the EXECUTE IMMEDIATE or PREPARE statement to compile and execute dynamic SQL statements. Use bind variable to pass user input or other dynamic values ​​to dynamic SQL. Use EXECUTE IMMEDIATE or EXECUTE to execute dynamic SQL statements.

How to solve garbled code in oracle How to solve garbled code in oracle Apr 11, 2025 pm 10:09 PM

Oracle garbled problems can be solved by checking the database character set to ensure they match the data. Set the client character set to match the database. Convert data or modify column character sets to match database character sets. Use Unicode character sets and avoid multibyte character sets. Check that the language settings of the database and client are correct.

See all articles