RAC安装时需要执行4个脚本及意义

 

RAC安装时需要执行4个脚本

1) $ORACLE_BASE/oraInventory/orainstRoot.sh (clusterware 结束时执行)

2) $CRS_HOME/root.sh (clusterware 结束时执行)

3) $CRS_HOME/bin/vipca.sh(该脚本是在第二个节点执行$CRS_HOME/root.sh时被自动调用)

4$ORACLE_HOME/root.sh (安装完数据库以后执行)

 

1. orainstRoot.sh 脚本

1.1 orainstRoot.sh 脚本执行过程

root@node2 #/oracle/oraInventory/orainstRoot.sh 

Changing permissions of /oracle/oraInventory to 770.

Changing groupname of /oracle/oraInventory to oinstall.

The execution of the script is complete

 

1.2 orainstRoot.sh 脚本内容

root@node1 # more /oracle/oraInventory/orainstRoot.sh

#!/bin/sh

if [ ! -d "/var/opt/oracle" ]; then

mkdir -p /var/opt/oracle;

fi

if [ -d "/var/opt/oracle" ]; then

chmod 755 /var/opt/oracle;

fi

if [ -f "/oracle/oraInventory/oraInst.loc" ]; then

cp /oracle/oraInventory/oraInst.loc /var/opt/oracle/oraInst.loc;

chmod 644 /var/opt/oracle/oraInst.loc;

else

INVPTR=/var/opt/oracle/oraInst.loc

INVLOC=/oracle/oraInventory

GRP=oinstall

PTRDIR="`dirname $INVPTR`";

# Create the software inventory location pointer file

if [ ! -d "$PTRDIR" ]; then

 mkdir -p $PTRDIR;

fi

echo "Creating the Oracle inventory pointer file ($INVPTR)";

echo   inventory_loc=$INVLOC > $INVPTR

echo   inst_group=$GRP >> $INVPTR

chmod 644 $INVPTR

# Create the inventory directory if it doesn't exist

if [ ! -d "$INVLOC" ];then

 echo "Creating the Oracle inventory directory ($INVLOC)";

 mkdir -p $INVLOC;

fi

fi

echo "Changing permissions of /oracle/oraInventory to 770.";

chmod -R 770 /oracle/oraInventory;

if [ $? != 0 ]; then

 echo "OUI-35086:WARNING: chmod of /oracle/oraInventory to 770 failed!";

fi

echo "Changing groupname of /oracle/oraInventory to oinstall.";

chgrp oinstall /oracle/oraInventory;

if [ $? != 0 ]; then

 echo "OUI-10057:WARNING: chgrp of /oracle/oraInventory to oinstall failed!";

fi

echo "The execution of the script is complete"

 

从脚本我们可以看出,这个脚本主要是创建/var/opt/oracle目录(如果不存在的话),再在该目录下建oraInst.loc文件(该文件记录orainventory的位置和组)。并改变orainventory的属性。

 

root@node2 # ls –rlt /var/opt/oracle/

total 2

-rw-r--r--  1 root    root         55 Apr 2 14:42 oraInst.loc

root@node2 # more oraInst.loc

inventory_loc=/oracle/oraInventory

inst_group=oinstall

 

在另一个节点上运行该脚本

root@node1 #/oracle/oraInventory/orainstRoot.sh 

Changing permissions of /oracle/oraInventory to 770.

Changing groupname of /oracle/oraInventory to oinstall.

The execution of the script is complete

 

2. Root.sh 脚本

 

2.1 root.sh 脚本执行过程

root@node2 #/oracle/crs/root.sh

WARNING: directory '/oracle' is not owned by root

Checking to see if Oracle CRS stack is already configured

Checking to see if any 9i GSD is up

 

Setting the permissions on OCR backup directory

Setting up NS directories

Oracle Cluster Registry configuration upgraded successfully

WARNING: directory '/oracle' is not owned by root

Successfully accumulated necessary OCR keys.

Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.

node <nodenumber>: <nodename> <private interconnect name> <hostname>

node 0: node2 node2-priv node2

node 1: node1 node1-priv node1

Creating OCR keys for user 'root', privgrp 'root'..

Operation successful.

Now formatting voting device: /oracle/ocrcfg1

Format of 1 voting devices complete.

Startup will be queued to init within 30 seconds.

Adding daemons to inittab

Expecting the CRS daemons to be up within 600 seconds.

CSS is active on these nodes.

       node2

CSS is inactive on these nodes.

       node1

Local node checking complete.

Run root.sh on remaining nodes to start CRS daemons.

 

   从输出我们可以看出,该脚本主要执行crs的配置,格式化ocr disk,更新/etc/inittab文件,启动css进程,在/var/opt/oracle/新建了ocr.loc文件及,scls_scroprocd文件夹。

 

2.2 查看crs进程及/etc/inittab文件可以看出节点的变化。

root@node2 # ps -ef|grep crs|grep –v grep

 oracle 18212 18211  0 14:47:28 ?     0:00 /oracle/crs/bin/ocssd.bin

 oracle 18191 18180  0 14:47:28 ?     0:00 /oracle/crs/bin/oclsmon.bin

 oracle 17886    1  0 14:47:27 ?     0:00 /oracle/crs/bin/evmd.bin

 oracle 18180 18092  0 14:47:28 ?     0:00 /bin/sh -c cd /oracle/crs/log/node2/cssd/oclsmon; ulimit -c unlimited; /ora

 root 17889    1  0 14:47:27 ?       0:00 /oracle/crs/bin/crsd.bin reboot

 oracle 18211 18093  0 14:47:28 ?      0:00 /bin/sh -c ulimit -c unlimited; cd /oracle/crs/log/node2/cssd; /oracle/crs

 

root@node2 # ls –rlt /var/opt/oracle/

total 8

-rw-r--r--  1 root    root         55 Apr 2 14:42 oraInst.loc

drwxrwxr-x  5 root    root        512 Apr 2 14:47 oprocd

drwxr-xr-x  3 root    root        512 Apr 2 14:47 scls_scr

-rw-r--r--  1 root    oinstall     48 Apr 2 14:47 ocr.loc

 

注意:新创建了ocr.locscls_scroprocd,但没有创建/var/opt/oracle/oratab

 

root@node1 # more inittab

# Copyright 2004 Sun Microsystems, Inc. All rights reserved.

# Use is subject to license terms.

#

# The /etc/inittab file controls the configuration of init(1M); for more

# information refer to init(1M) and inittab(4). It is no longer

# necessary to edit inittab(4) directly; administrators should use the

# Solaris Service Management Facility (SMF) to define services instead.

# Refer to smf(5) and the System Administration Guide for more

# information on SMF.

#

# For modifying parameters passed to ttymon, use svccfg(1m) to modify

# the SMF repository. For example:

#

#      # svccfg

#      svc:> select system/console-login

#      svc:/system/console-login> setprop ttymon/terminal_type = "xterm"

#      svc:/system/console-login> exit

#

#ident "@(#)inittab   1.41   04/12/14 SMI"

ap::sysinit:/sbin/autopush -f /etc/iu.ap

sp::sysinit:/sbin/soconfig -f /etc/sock2path

smf::sysinit:/lib/svc/bin/svc.startd   >/dev/msglog 2<>/dev/msglog </dev/console

p3:s1234:powerfail:/usr/sbin/shutdown -y -i5 -g0 >/dev/msglog 2<>/dev/msglog

h1:3:respawn:/etc/init.d/init.evmd run >/dev/null 2>&1 </dev/null

h2:3:respawn:/etc/init.d/init.cssd fatal >/dev/null 2>&1 </dev/null

h3:3:respawn:/etc/init.d/init.crsd run >/dev/null 2>&1 </dev/null

 

root@node1 # ls -rlt /etc/inittab*

-rw-r--r--  1 root    root       1072 Nov 2 12:39 inittab.cssd

-rw-r--r--  1 root    root       1206 Mar 21 17:15 inittab.pre10203

-rw-r--r--  1 root    root       1006 Mar 21 17:15 inittab.nocrs10203

-rw-r--r--  1 root    root       1040 Apr 2 14:50 inittab.orig

-rw-r--r--  1 root    root       1040 Apr 2 14:50 inittab.no_crs

-rw-r--r--  1 root    root       1240 Apr 2 14:50 inittab

-rw-r--r--  1 root    root       1240 Apr 2 14:50 inittab.crs

 

该脚本会将inittab复制为inittab.no_crs,修改后的inittab另复制一份为inittab.crs.

 

 

2.3 在另外一个节点执行$CRS_HOME/root.sh

root@node1 #/oracle/crs/root.sh

WARNING: directory '/oracle' is not owned by root

Checking to see if Oracle CRS stack is already configured

Checking to see if any 9i GSD is up

 

Setting the permissions on OCR backup directory

Setting up NS directories

Oracle Cluster Registry configuration upgraded successfully

WARNING: directory '/oracle' is not owned by root

clscfg: EXISTING configuration version 3 detected.

clscfg: version 3 is 10G Release 2.

Successfully accumulated necessary OCR keys.

Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.

node <nodenumber>: <nodename> <private interconnect name> <hostname>

node 0: node2 node2-priv node2

node 1: node1 node1-priv node1

clscfg: Arguments check out successfully.

 

NO KEYS WERE WRITTEN. Supply -force parameter to override.

-force is destructive and will destroy any previous cluster configuration.

Oracle Cluster Registry for cluster has already been initialized

Startup will be queued to init within 30 seconds.

Adding daemons to inittab

Expecting the CRS daemons to be up within 600 seconds.

CSS is active on these nodes.

       node2

       node1

CSS is active on all nodes.

Waiting for the Oracle CRSD and EVMD to start

Oracle CRS stack installed and running under init(1M)

Running vipca(silent) for configuring nodeapps

 

Creating VIP application resource on (2) nodes...

Creating GSD application resource on (2) nodes...

Creating ONS application resource on (2) nodes...

Starting VIP application resource on (2) nodes...

Starting GSD application resource on (2) nodes...

Starting ONS application resource on (2) nodes...

 

Done.

 

 

3. 在第二个节点上运行时会多比在第一个节点上运行多执行一个任务

    -------运行$CRS_HOME/bin/vipca.sh


VIPCA.sh主要是配置vip并启动crs的默认资源(未建库时默认为6个),多启动三个后台进程。

root@node1 # ps -ef|grep crs|grep -v grep

 oracle 18347 17447  0 14:51:06 ?          0:00 /oracle/crs/bin/evmlogger.bin -o /oracle/crs/evm/log/evmlogger.info -l /oracle/

oracle 17447    1  0 14:50:47 ?          0:00 /oracle/crs/bin/evmd.bin

oracle 17763 17756  0 14:50:48 ?          0:00 /oracle/crs/bin/ocssd.bin

oracle 17756 17643  0 14:50:48 ?          0:00 /bin/sh -c ulimit -c unlimited; cd /oracle/crs/log/node1/cssd; /oracle/crs

oracle 21216    1  0 14:52:28 ?          0:00 /oracle/crs/opmn/bin/ons -d

oracle 21217 21216  0 14:52:28 ?          0:00 /oracle/crs/opmn/bin/ons -d

oracle 17771 17642  0 14:50:48 ?          0:00 /bin/sh -c cd /oracle/crs/log/node1/cssd/oclsmon; ulimit -c unlimited; /ora

oracle 17773 17771  0 14:50:48 ?          0:00 /oracle/crs/bin/oclsmon.bin

root 17449    1  0 14:50:47 ?          0:01 /oracle/crs/bin/crsd.bin reboot

 

root@node2 # ps -ef|grep crs|grep -v grep

oracle 18212 18211  0 14:47:28 ?          0:00 /oracle/crs/bin/ocssd.bin

oracle 27467 27466  0 14:52:25 ?          0:00 /oracle/crs/opmn/bin/ons -d

oracle 25252 17886  0 14:51:16 ?          0:00 /oracle/crs/bin/evmlogger.bin -o /oracle/crs/evm/log/evmlogger.info -l /oracle/

oracle 27466    1  0 14:52:25 ?          0:00 /oracle/crs/opmn/bin/ons -d

oracle 18191 18180  0 14:47:28 ?          0:00 /oracle/crs/bin/oclsmon.bin

oracle 17886    1  0 14:47:27 ?          0:00 /oracle/crs/bin/evmd.bin

oracle 18180 18092  0 14:47:28 ?       0:00 /bin/sh -c cd /oracle/crs/log/node2/cssd/oclsmon; ulimit -c unlimited; /ora

root 17889    1  0 14:47:27 ?          0:00 /oracle/crs/bin/crsd.bin reboot

 oracle 18211 18093  0 14:47:28 ?          0:00 /bin/sh -c ulimit -c unlimited; cd /oracle/crs/log/node2/cssd; /oracle/crs

从现在node2上的进程就能看出,执行完vipca.sh后,会多出三个后台进程。

 

root@node1 # crs_stat -t

Name          Type          Target   State    Host       

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

ora....c03.gsd application   ONLINE   ONLINE   node1  

ora....c03.ons application   ONLINE   ONLINE   node1  

ora....c03.vip application   ONLINE   ONLINE   node1  

ora....c04.gsd application   ONLINE   ONLINE   node2  

ora....c04.ons application   ONLINE   ONLINE   node2  

ora....c04.vip application   ONLINE   ONLINE   node1

 

 

4. 安装数据库软件(binary)时需在最后一步:执行$ORACLE_HOME/root.sh

 

root@node2 #$ORACLE_HOME/root.sh

Running Oracle10 root.sh script...

 

The following environment variables are set as:

   ORACLE_OWNER= oracle

   ORACLE_HOME= /oracle/10g

 

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y

  Copying dbhome to /usr/local/bin ...

The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y

  Copying oraenv to /usr/local/bin ...

The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y

  Copying coraenv to /usr/local/bin ...

 

Creating /var/opt/oracle/oratab file...

Entries will be added to the /var/opt/oracle/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root.sh script.

Now product-specific root actions will be performed.

 

该脚本的作用在于在指定的目录(默认为/usr/local/bin)下创建dbhome,oraenv,coraenv,/var/opt/oracle/里创建oratab文件。

 

root@node2# ls –rlt /usr/local/bin

total 18

-rwxr-xr-x  1 oracle  root       2428 Apr 2 15:07 dbhome

-rwxr-xr-x  1 oracle  root       2560 Apr 2 15:07 oraenv

-rwxr-xr-x  1 oracle  root       2857 Apr 2 15:07 coraenv

 

root@node2 # ls –rlt /var/opt/oracle/

total 10

-rw-r--r--  1 root    root         55 Apr 2 14:42 oraInst.loc

drwxrwxr-x  5 root    root        512 Apr 2 14:47 oprocd

drwxr-xr-x  3 root    root        512 Apr 2 14:47 scls_scr

-rw-r--r--  1 root    oinstall     48 Apr 2 14:47 ocr.loc

-rw-rw-r--  1 oracle  root        678 Apr 2 15:07 oratab

 

root@node1 # /oracle/10g/root.sh

Running Oracle10 root.sh script...

 

The following environment variables are set as:

   ORACLE_OWNER= oracle

   ORACLE_HOME= /oracle/10g

 

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y

  Copying dbhome to /usr/local/bin ...

The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y

  Copying oraenv to /usr/local/bin ...

The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y

  Copying coraenv to /usr/local/bin ...

 

Creating /var/opt/oracle/oratab file...

Entries will be added to the /var/opt/oracle/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root.sh script.

Now product-specific root actions will be performed.

 

 

转载于:https://www.cnblogs.com/tianlesoftware/archive/2010/02/22/3610253.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/262143.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

python 逐行读取csv_在R中如何逐行读取CSV文件并将内容识别为正确的数据类型?...

根据DWin的评论&#xff0c;您可以尝试这样的事情&#xff1a; read.clump <- function(file, lines, clump){ if(clump > 1){ header <- read.csv(file, nrows1, headerFALSE) p read.csv(file, skip lines*(clump-1), #p read.csv(file, skip (lines*(clump-1))…

QMouseEvent 的坐标__Win

1、 QMouseEvent.x() 和 QMouseEvent.y() 是窗口里面的坐标&#xff0c;相当于 Windows API 里面的 ClientX和ClientY 。 2、 QMouseEvent.GlobalX() 和 QMouseEvent.GlobalY() 是位于屏幕上的坐标&#xff0c;相当于 Windows API 里面的 ScreenX 和 ScreenY 。 3、 Windows AP…

主板不通电检测流程

主板不上电的故障&#xff0c;在日常维修中比较常见&#xff0c;其实从我的维修经验上来说&#xff0c;不上电的故障是最好修的&#xff0c;只是大家在维修过程中没有掌握正确的维修流程&#xff0c;所以思路也就不正确&#xff0c;在这里向大家作一个关于主板不上电维修的流程…

开源项目管理软件禅道使用帮助下载

Author: 王春生 大家好&#xff01;前面一段时间都在忙于开发功能&#xff0c;所以文档都还没有怎么整理。后面陆续的会完善相应的文档。今天先给大家一份概要的帮助&#xff0c;旨在帮助大家了解禅道的设计宗旨和基本的使用指南。下载地址&#xff1a;http://zentaoms.googlec…

php 掌握jquery,完全掌握jquery tmpl模板

之前用模板渲染都是用angular&#xff0c;无意间发现了jquery tmpl这种轻量级&#xff0c;其文档在这里&#xff0c;本文主要为大家带来一篇jquery tmpl模板(实例讲解)。小编觉得挺不错的&#xff0c;现在就分享给大家&#xff0c;也给大家做个参考。一起跟随小编过来看看吧&am…

uniaccess进程无法结束 拒绝访问_嵌入式Linux编程——程序员小白不懂的进程、信号量、并发、互斥...

所有学嵌入式Linux系统的看过来了&#xff0c;以下内容是每一位想学习Linux嵌入式系统想要了解的内容&#xff0c;真的很想要分享给大家&#xff01;本文分享的内容主要如下几个方面&#xff1a;3.1 并发的原理3.1.1 一个简单的例子3.1.2 竞争条件3.1.3 操作系统关注的问题3.1.…

向mvc controller传递json数组

对于这个主题我没有找到最合适的办法&#xff0c;只是找出了个可以暂时规避问题的方法。发到这里非常希望各位大侠&#xff0c;能给小弟些思路解决此问题。 一开始的需求 本想实现这么一个功能 这里的 var titles [{ title: "ONE",List: ["1", "2&qu…

我常用的在线取色器

颜色明淡 http://www.colorschemer.com/online.html 2.http://tool.cc/color/ 转载于:https://www.cnblogs.com/xiaoliu66007/p/5145955.html

大家好!欢迎来到我的博客!

大家好&#xff0c;欢迎你们来到我的博客&#xff0c;我是你们的好朋友egg&#xff0c;一个疯狂的Java爱好者&#xff01;这里我会分享一个程序员成长所需的点点滴滴&#xff0c;以Java为主体&#xff0c;从基础到高级知识都会不断的出炉&#xff01;真心欢迎每一位读者朋友&am…

PHP开发erp账号登陆问题,浪潮ERP软件E系列创建账套时提示“由于登陆不正确、请重新登陆” | 浪潮888博客...

浪潮ERP软件E系列创建账套时提示“由于登陆不正确、请重新登陆”数 据 库&#xff1a; MSDE2000软件版本&#xff1a; E4 软件模块&#xff1a; 账套管理问题描述&#xff1a;E系列创建账套时提示“由于登陆不正确、请重新登陆”产生原因&#xff1a; 无解决方法&#xff1a;首…

python支持向量机回归_Python中支持向量机SVM的使用方法详解

除了在Matlab中使用PRTools工具箱中的svm算法&#xff0c;Python中一样可以使用支持向量机做分类。因为Python中的sklearn库也集成了SVM算法&#xff0c;本文的运行环境是Pycharm。 一、导入sklearn算法包 Scikit-Learn库已经实现了所有基本机器学习的算法&#xff0c;具体使用…

c#正则表达式

到目前为止&#xff0c;许多的编程语言和工具都包含对正则表达式的支持&#xff0c;当然.NET也不例外&#xff0c;.NET基础类库中包含有一个名称空间和一系列可以充分发挥规则表达式威力的类。 正则表达式的知识可能是不少编程人员最烦恼的事儿了。如果你还没有规则表达…

linux awk命令详解

简介 awk是一个强大的文本分析工具&#xff0c;相对于grep的查找&#xff0c;sed的编辑&#xff0c;awk在其对数据分析并生成报告时&#xff0c;显得尤为强大。简单来说awk就是把文件逐行的读入&#xff0c;以空格为默认分隔符将每行切片&#xff0c;切开的部分再进行各种分析处…

python3网络爬虫开发实战豆瓣_大牛程序员教你1天入门Python3 网络爬虫例子

在我们日常上网浏览网页的时候&#xff0c;经常会看到一些好看的图片&#xff0c;我们就希望把这些图片保存下载&#xff0c;或者用户用来做桌面壁纸&#xff0c;或者用来做设计的素材。其实我们可以通过python 来实现这样一个简单的爬虫功能&#xff0c;把我们想要的代码爬取到…

解决了界面上菜单项跑到其它AE控件后面的问题(java)

菜单项竟然跑到后面去了&#xff0c;搞了好多天&#xff0c;终于解决了 只要把这句代码放到main()的最前面就可以了 JPopupMenu.setDefaultLightWeightPopupEnabled(false); 转载于:https://www.cnblogs.com/bluemaplestudio/archive/2010/02/28/1675171.html

There is no public key available for the following key IDs: 3B4FE6ACC0B21F32

Ubuntu报错&#xff1a;There is no public key available for the following key IDs: 3B4FE6ACC0B21F32 解决办法&#xff1a;# apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3B4FE6ACC0B21F32# apt-get update 转载于:https://blog.51cto.com/yangzhiming/17…

微软工程师测试题——未来

一&#xff0c;选择题&#xff08;皆为单选&#xff09;&#xff1a; 1&#xff0c;以下谁是二进制思想的最早提出者&#xff1f; a&#xff0c;伏羲&#xff1b;b&#xff0c;姬昌&#xff1b;c&#xff0c;莱布尼茨&#xff1b;d&#xff0c;柏拉图。 答案&#xff1a;A 解释…

matlab利用霍夫,基于matlab的霍夫变换

霍夫变换(限量版)基于matlab的霍夫变换 一、简单介绍Hough变换是图像处理中从图像中识别几何形状的基本方法之一。Hough变换的基本原理在于利用点与线的对偶性&#xff0c;将原始图像空间的给定的曲线通过曲线表达形式变为参数空间的一个点。这样就把原始图像中给定曲线的检测问…

python网站用什么数据库_PyMySQL数据库的使用

前面我们学习了SQLite数据库的相关内容&#xff0c;我们也通过前面的内容学习到了数据库的相关操作&#xff0c;PyMySQL数据库的操作和前面的内容类似&#xff0c;但我们可以通过Navicat直接来查看数据库中的内容&#xff0c;实现数据可视化&#xff0c;前面我们已经完成了下载…

宏与内联(inline)的区别(转载)

先转载下人家总结的宏和普通函数调用的区别&#xff1a;(1)、宏只做简单的字符串替换&#xff0c;函数是参数传递&#xff0c;所以必然有参数类型检查(支持各种类型&#xff0c;而不是只有字符串)。(2)、宏不经计算而直接替换参数&#xff0c;函数调用则是将参数表达式求值再传…