重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
小编给大家分享一下OEL5.5如何安装Oracle 11g R2 RAC,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!
你所需要的网站建设服务,我们均能行业靠前的水平为你提供.标准是产品质量的保证,主要从事做网站、网站建设、企业网站建设、手机网站开发、网页设计、品牌网站制作、网页制作、做网站、建网站。创新互联拥有实力坚强的技术研发团队及素养的视觉设计专才。
1.安装前的准备:
操作系统:oracle linux 5.5 64bit
集群软件:GI 11.2.0.1
数据库:database rdbms 11.2.0.1
2.资源准备:
oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm
oracleasm-support-2.1.7-1.el5.x86_64.rpm
openfiler
3.操作系统安装:
DNS server:domain name
db server:rac1 rac2
storage server:openfiler
4.IP地址规划:
DNS server:192.168.192.168
db node1:192.168.192.169 public
192.168.192.171 VIP
10.0.0.1 private
db node2:192.168.192.170 public
192.168.192.172 VIP
10.0.0.2 private
scan: 192.168.192.173
192.168.192.174
192.168.192.175
5.我们先配置DNS,DNS是什么我就不多说了,这里主要的作用在于引入一个新的特性,11g R2后引入SCAN IP的概念,就是在客户端和数据库之间增加一层虚拟网络服务层,即是SCAN IP和SCAP IP Listener。在客户端的tnsnames.ora配置文件中,只需要配置SCAN IP的配置信息即可,客户端通过SCAN IP、SCAN IP Listener来访问数据库。同之前各版本的RAC相比,使用SCAN IP的好处就是,当后台RAC数据库添加、删除节点时,客户端配置信息无需修改。可以通过配置DNS服务器或GNS来配置SCAN,我们这里以DNS为例来进行配置。
6.安装DNS服务器
# rpm -ivh bind-9.3.6-4.P1.el5_4.2.x86_64.rpm
# rpm -ivh bind-chroot-9.3.6-4.P1.el5_4.2.x86_64.rpm
# rpm -ivh caching-nameserver-9.3.6-4.P1.el5_4.2.x86_64.rpm
配置主区域
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; };
allow-query-cache { any; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { any; };
match-destinations { any; };
recursion yes;
include "/etc/named.zones";
};
配置Zone文件,修改/var/named/chroot/etc/named.rfc1912.zones文件
添加如下:
zone "192.168.192.in-addr.arpa" IN {
type master;
file "192.168.192.in-addr.arpa";
allow-update { none; };
};
再配置DNS正反向解析文件
/var/named/chroot/var/named 目录下
vi localdomain.zone ,配置为
$TTL 86400
@ IN SOA localhost root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS localhost
localhost IN A 127.0.0.1
scan-cluster IN A 192.168.192.173(这里是配置scan-ip)
vi 192.168.168.in-addr-arpa(这个自己生成一个就行)
$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
1 IN PTR localhost.
173 IN PTR scan-cluster.localdomain.(这里配置san IP)
启动DNS服务
[root@dns named]# /etc/init.d/named status
number of zones: 1
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/1000
tcp clients: 0/100
server is up and running
named (pid 18907) is running..
再对rac的两个节点分别修改/etc/resolv.conf
search localdomain
nameserver 192.168.192.168
我们完成DNS的配置了!!!!
7.配置hosts文件在两个节点上配置
[root@rac1 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.192.169 rac1.xupeng.com rac1
192.168.192.170 rac2.xupeng.com rac2
10.0.0.1 rac1-priv.xupeng.com rac1-priv
10.0.0.2 rac2-priv.xupeng.com rac2-priv
192.168.192.171 rac1-vip.xupeng.com rac1-vip
192.168.192.172 rac2-vip.xupeng.com rac2-vip
8.安装oracle 11g所需要的环境包
这个看你自己怎么装了,有的人选择全包安装(在装操作系统的时候),有的喜欢手动安装oracle 需要的包,这个就无所谓了,我这里用YUM源,哈哈。。。。
此操作在两个节点上进行
[root@rac1 ~]# vi /etc/yum.repos.d/my.repo
[Oracle]
name=OEL-$releasever - Media
baseurl=file:///mnt/Server
gpgcheck=0
enable=1
[root@rac1 ~]# yum -y install compat-libstdc++-33 elfutils-libelf-devel gcc gcc-c++ glibc-devel glibc-headers libaio-devel libstdc++-devel sysstat unixODBC unixODBC-devel
9.参数配置
以下操作需在两个节点上进行配置
[root@rac1 ~]# vi /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = 4294967295
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
使内核参数生效,sysctl -p 这些配置都和安装单实例是一样的
[root@rac1 ~]# vi /etc/security/limits.conf
grid soft nofile 1024
grid hard nofile 65536
grid soft nproc 2047
grid hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
[root@rac1 ~]# vi /etc/pam.d/login
session required /lib64/security/pam_limits.so
10.添加用户和组以及oracle、grid用户ssh的对等性
以下操作需要两个节点同样进行
groupadd -g 1000 oinstall
groupadd -g 1300 dba
groupadd -g 1301 oper
groupadd -g 1201 asmdba
groupadd -g 1200 asmadmin
groupadd -g 1202 asmoper
useradd -m -u 1100 -g oinstall -G asmadmin,asmdba,asmoper -d /home/grid -s /bin/bash -c "Grid Infrastructure Owner" grid
passwd grid
useradd -m -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle
passwd oracle
设置互信关系,这里记住oracle和grid用户都要设置互信
su - grid
mkdir ~/.ssh
ssh-keygen -t rsa
ssh-keygen -t dsa
以下操作在一个节点上执行即可
cat ~/.ssh/id_rsa.pub>>./.ssh/authorized_keys --公钥存在authorized_keys文件中,写到本机
cat ~/.ssh/id_dsa.pub>>./.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys --第二个节点的公钥写到本机
ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys secdb2:~/.ssh/authorized_keys
两个节点上分别验证
ssh rac1 date
ssh rac2 date
ssh rac1-priv date
ssh rac2-priv date
11.创建目录和授权
以下操作需要在两个节点同样进行
mkdir -p /u01/app/grid
mkdir -p /u01/app/11.2.0/grid
chown -R grid:oinstall /u01
mkdir -p /u01/app/oracle
chown oracle:oinstall /u01/app/oracle
chmod -R 775 /u01
12.环境变量
如下操作也需要在两个节点上同样进行,这里需要注意的是grid用户的SID和oracle用户的SID,是不一样的,这里大家明白原理的话就不会出错
[root@rac1 ~]# su - grid
[grid@rac1 ~]$ less .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
ORACLE_SID=+ASM1; export ORACLE_SID
JAVA_HOME=/usr/local/java;export JAVA_HOME
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME
ORACLE_PATH=/u01/app/oracle/common/oracle/sql; export ORACLE_PATH
ORACLE_TERM=xterm;export ORACLE_TERM
NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS";export NLS_DATE_FORMAT
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=${PATH}:/u01/app/common/oracle/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
export NLS_LANG=american_america.ZHS16GBK
alias sqlplus="rlwrap sqlplus"
umask 022
[grid@rac1 ~]$ su - oracle
Password:
[oracle@rac1 ~]$ less .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
ORACLE_SID=test1; export ORACLE_SID
ORACLE_UNQNAME=test; export ORACLE_UNQNAME
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_PATH=/u01/app/common/oracle/sql; export ORACLE_PATH
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=${PATH}:/u01/app/common/oracle/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
umask 022
13.openfiler来划分存储空间
这个软件挺好用的,在vmware环境下安装,其实就是个linux系统,我们创建vmdisk就行了。配置登陆一个网页https://ip:446
我这里已经划分好了,看图就行了,至于openfiler的配置大家应该可以自学一下,非常简单属于看图点鼠标的那种,英文稍微好点的同学能搞定
14.分别在两个rac节点上配置ISCSI
[root@rac1 ~]# yum -y install iscsi-initiator-utils
[root@rac1 ~]# service iscsid start
[root@rac1 ~]# chkconfig iscsid on
[root@rac1 ~]# iscsiadm -m discovery -t sendtargets -p 192.168.192.111
添加iscsi磁盘:
[root@rac1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.4849d1d582bc -p 192.168.192.111 –l
以下操作rac其中一个节点进行:
[root@rac1 ~]# fdisk /dev/sdb 以此类推我这里需要格式化3个磁盘!!!
完成后我们查看一下,通过fdisk -l
[root@rac1 ~]# fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 83 Linux
/dev/sda2 26 547 4192965 82 Linux swap / Solaris
/dev/sda3 548 3916 27061492+ 83 Linux
Disk /dev/sdb: 2113 MB, 2113929216 bytes
66 heads, 62 sectors/track, 1008 cylinders
Units = cylinders of 4092 * 512 = 2095104 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 10 1008 2043954 83 Linux
Disk /dev/sdc: 2113 MB, 2113929216 bytes
66 heads, 62 sectors/track, 1008 cylinders
Units = cylinders of 4092 * 512 = 2095104 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 10 1008 2043954 83 Linux
Disk /dev/sdd: 8556 MB, 8556380160 bytes
64 heads, 32 sectors/track, 8160 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 10 8160 8346624 83 Linux
到另一个节点上
输入partprobe即可,查看fdisk -l和其它节点的一致!!
15.创建ASM磁盘
以下操作在两个及节点上分别进行:
[root@rac1 ~]# rpm -ivh Oracleasm*
[root@rac1 ~]# /etc/init.d/oracleasm configure
Default user to own the driver interface []: grid
Default group to own the driver interface []: asmadmin
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
以下操作在rac其中一个节点上进行,我在rac1上操作
[root@rac1 ~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
[root@rac1 ~]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdc1
[root@rac1 ~]# /etc/init.d/oracleasm createdisk VOL3 /dev/sdd1
以下操作在另一个节点上进行,RAC2上操作
[root@rac1 ~]# oracleasm scandisks
我这里用到的是asmlib来做磁盘设备管理的,这里大家也可以使用UDEV来管理,在RHEL6中asmlib已经被废弃了,以后就是UDEV的天下
16,禁用NTP server
此操作同样在两个节点上进行
[root@rac1 ~]# service ntpd stop
[root@rac1 ~]# chkconfig ntpd off
[root@rac1 ~]# mv /etc/ntp.conf /etc/ntp.conf.bak
17.上传所有的安装软件
# chown -R grid.oinstall /install/
# su – grid
$ unzip linux.x64_11gR2_grid.zip
# chmod 775 /install
# chown oracle.oinstall /install/linux.x64_11gR2_database_[1,2]of2.zip
# su – oracle
$ unzip linux.x64_11gR2_database_1of2.zip
$ unzip linux.x64_11gR2_database_2of2.zip
18.安装GI集群软件
[grid@rac1 grid]$ ./runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 6888 MB Passed
Checking swap space: must be greater than 150 MB. Actual 2295 MB Passed
我们选择第一项“安装并配置集群” 点击“next”
我们这里选择“高级安装”,点击“next”
选择“English”,点击“Next”
这里要填写scan name,对应我们的dns里写的名字,不选择GNS,点击“next”
点击add,添加第二个节点,完成后,点击“next”
这里只需要确认一下网络接口,安装向导已经把我们填写,其实这里和oracle 10g差不多!!
选择ASM存储方式,点击"Next"
这里让我们创建asm disk group,给一个名字“OCRVOTI” ,选择Redundancy External。不镜像ASM中的数据,使用外部
存储阵列提供冗余。点击“next”
选择给ASM的SYS、ASMSNMP用户配置为相同的口令,并输入口令,Next:这里需要注意的是密码为强度密码喔!!
这里选择第二项不使用IPMI
给ASM指定不同的组,这里没什么好说的,继续next
这里安装向导会帮你填写集群软件的安装路径,我们继续next,这里我们需要注意的是oracle_Home不能是oracle_base的子目录
选择默认的Inventory,Next:
这里瞬间会检查通过的,我们来到这个界面,继续“finish”
等待一小会,可以去休息一下
完成后,需要手动在root用户下执行两个脚本,按照顺序执行即可!!!!在执行第二个脚本root.sh的时候会比较慢
我们会看到这个报错,其实这个问题我查看了mos知识库,说的比较含糊,可以忽略这个错误,不影响我们的安装和未来的使用
我们直接finish了,这里我们集群软件安装完成。
19.安装oracle 11.2.0.1软件
我们su - oracle
还是在解压/install/oracle/database运行安装脚本,我们还是用OUI模式安装,这里和安装grid一样,启动安装向导
我们不填写mos账号,又不联网没意义,点击next,这里我们还是在rac1节点上安装
我们这里只安装数据库软件,点击next
这里选择集群安装方式,选择“select All”,点击next
还是选择语言为”English“,点击next
选择”Enterprise Edition“ 点击”next“
这里是oracle_base和oracle_home,点击next
这个对应到组就可以了,继续next
这一步会check你的安装环境,我们只要配置参数正确就没问题,这里基本上都是succeeded,点击next
summary一下,我们就可以finish了
这里安装会比较快,可以去尿个尿,回来就好了。。。。
完成后同样也要执行一个脚本,也是要在root用户下去执行,分别两个节点上
完成。
20.创建ASM磁盘组
在安装GI集群软件的时候我们就配置过asm磁盘,现在我们还有一个disk分区没有加入到asm磁盘组中,我们通过asmca来实现
su - grid
运行命令asmca,我们看到下面配置向导。这里可以看到我们之前配置过的disk group,我们点击create后
来到这里,我们给disk group起个名字,选择redundancy External,勾选VOL3,我们ok一下
会有一个10秒的等待创建磁盘组,完成后提示成功。
这里我们就能看到有两个disk group了!!!退出即可。。
21.配置oracle database
我们直接su - oracle,运行dbca命令来配置数据库
来到如下界面后,我们选择第一项集群模式,然后next
这个就不用考虑了,直接选择create a database,继续next
这个也是选择general purpose,继续next
配置类型选择admin-managed,Global database name和sid相同为test,最下面我们选择”select all“,然后next
这里我们还是选择默认推荐的配置,EM和amt都选择配置,继续next
把sys、system、dbsnmp都给一个相同的密码,这里你自己给吧!!然后next
这里我们选择用存储类型为asm,使用omf管理数据文件。
我们这里不选择闪回恢复区,我这里就不配置了,以后手动改spfile吧!!
装上sample schemas,以后就有数据可以测试玩一把了!! 继续next
这里我们字符集会有所设置,ZHS16GBK-GBK,国际字符集默认的就行。其它的选项卡没有特殊配置,在以后都可以去改spfile,我们继续next
这个是数据库的存储配置页面,我们看一下控制文件等等都要开始安装了,next
继续finish
等待吧,这个也是比较久的,我的SSD和cpu比较给力,速度基本上10分钟吧!!
安装完后,点击exit
我们就退出安装配置向导了!!!
22.检查
检查crs资源状态
[grid@rac2 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.DATA.dg ora....up.type ONLINE ONLINE rac1
ora....ER.lsnr ora....er.type ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type ONLINE ONLINE rac2
ora.OCRVOTI.dg ora....up.type ONLINE ONLINE rac1
ora.asm ora.asm.type ONLINE ONLINE rac1
ora.eons ora.eons.type ONLINE ONLINE rac1
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE rac1
ora.oc4j ora.oc4j.type ONLINE ONLINE rac1
ora.ons ora.ons.type ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
ora....ry.acfs ora....fs.type ONLINE ONLINE rac1
ora.scan1.vip ora....ip.type ONLINE ONLINE rac2
ora.test.db ora....se.type ONLINE ONLINE rac1
我们看到ora.gsd、ora.RAC2.gsd是offline状态,其实两个进程对我们的数据库是没有任何影响的,我们把他们打开就行了
[grid@rac2 ~]$ srvctl status nodeapps -n rac2
-n
VIP rac2-vip is enabled
VIP rac2-vip is running on node: rac2
Network is enabled
Network is running on node: rac2
GSD is disabled
GSD is not running on node: rac2
ONS is enabled
ONS daemon is running on node: rac2
eONS is enabled
eONS daemon is running on node: rac2
[grid@rac2 ~]$ srvctl enable nodeapps
PRKO-2415 : VIP is already enabled on node(s): rac1,rac2
PRKO-2416 : Network resource is already enabled.
PRKO-2417 : ONS is already enabled on node(s): rac1,rac2
PRKO-2418 : eONS is already enabled on node(s): rac1,rac2
[grid@rac2 ~]$ srvctl status nodeapps
VIP rac1-vip is enabled
VIP rac1-vip is running on node: rac1
VIP rac2-vip is enabled
VIP rac2-vip is running on node: rac2
Network is enabled
Network is running on node: rac1
Network is running on node: rac2
GSD is enabled
GSD is not running on node: rac1
GSD is not running on node: rac2
ONS is enabled
ONS daemon is running on node: rac1
ONS daemon is running on node: rac2
eONS is enabled
eONS daemon is running on node: rac1
eONS daemon is running on node: rac2
[grid@rac2 ~]$ srvctl start nodeapps
PRKO-2421 : Network resource is already started on node(s): rac1,rac2
PRKO-2420 : VIP is already started on node(s): rac1,rac2
PRKO-2420 : VIP is already started on node(s): rac1,rac2
PRKO-2422 : ONS is already started on node(s): rac1,rac2
PRKO-2423 : eONS is already started on node(s): rac1,rac2
我们在来查看一下所有的组件是否online
[grid@rac2 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.DATA.dg ora....up.type ONLINE ONLINE rac1
ora....ER.lsnr ora....er.type ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type ONLINE ONLINE rac2
ora.OCRVOTI.dg ora....up.type ONLINE ONLINE rac1
ora.asm ora.asm.type ONLINE ONLINE rac1
ora.eons ora.eons.type ONLINE ONLINE rac1
ora.gsd ora.gsd.type ONLINE ONLINE rac1
ora....network ora....rk.type ONLINE ONLINE rac1
ora.oc4j ora.oc4j.type ONLINE ONLINE rac1
ora.ons ora.ons.type ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
ora....ry.acfs ora....fs.type ONLINE ONLINE rac1
ora.scan1.vip ora....ip.type ONLINE ONLINE rac2
ora.test.db ora....se.type ONLINE ONLINE rac1
这里还要强调一下11.2.0.1版本的一个bug,就是客户端无法通过scan连接到数据库解决方法如下:
[oracle@rac2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 19 11:29:58 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> show parameter local_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST=rac2
-vip)(PORT=1521))))
SQL> show parameter remot_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_dependencies_mode string TIMESTAMP
remote_listener string scan-cluster.localdomain:1521
remote_login_passwordfile string EXCLUSIVE
remote_os_authent boolean FALSE
remote_os_roles boolean FALSE
result_cache_remote_expiration integer 0
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.192.173)(PORT = 1521))))' sid='test2';
System altered.
SQL> alter system set remote_listener='scan-cluster.localdomain:1521';
System altered.
SQL> alter system register;
System altered.
最后配置客户端tnsname.ora文件指向scan listener
# tnsnames.ora.rac2 Network Configuration File: /u01/app/11.2.0/grid/network/admin/tnsnames.ora.rac2
# Generated by Oracle configuration tools.
TEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.192.173)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = test)
)
)
看完了这篇文章,相信你对“OEL5.5如何安装Oracle 11g R2 RAC”有了一定的了解,如果想了解更多相关知识,欢迎关注创新互联行业资讯频道,感谢各位的阅读!