您好,登錄后才能下訂單哦!
小編給大家分享一下OEL5.5如何安裝Oracle 11g R2 RAC,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
1.安裝前的準(zhǔn)備:
操作系統(tǒng):oracle linux 5.5 64bit
集群軟件:GI 11.2.0.1
數(shù)據(jù)庫:database rdbms 11.2.0.1
2.資源準(zhǔn)備:
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.操作系統(tǒng)安裝:
DNS server:domain name
db server:rac1 rac2
storage server:openfiler
4.IP地址規(guī)劃:
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的概念,就是在客戶端和數(shù)據(jù)庫之間增加一層虛擬網(wǎng)絡(luò)服務(wù)層,即是SCAN IP和SCAP IP Listener。在客戶端的tnsnames.ora配置文件中,只需要配置SCAN IP的配置信息即可,客戶端通過SCAN IP、SCAN IP Listener來訪問數(shù)據(jù)庫。同之前各版本的RAC相比,使用SCAN IP的好處就是,當(dāng)后臺RAC數(shù)據(jù)庫添加、刪除節(jié)點時,客戶端配置信息無需修改??梢酝ㄟ^配置DNS服務(wù)器或GNS來配置SCAN,我們這里以DNS為例來進(jìn)行配置。
6.安裝DNS服務(wù)器
# 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
配置主區(qū)域
//
// 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服務(wù)
[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的兩個節(jié)點分別修改/etc/resolv.conf
search localdomain
nameserver 192.168.192.168
我們完成DNS的配置了?。。。?br/>
7.配置hosts文件在兩個節(jié)點上配置
[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所需要的環(huán)境包
這個看你自己怎么裝了,有的人選擇全包安裝(在裝操作系統(tǒng)的時候),有的喜歡手動安裝oracle 需要的包,這個就無所謂了,我這里用YUM源,哈哈。。。。
此操作在兩個節(jié)點上進(jìn)行
[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.參數(shù)配置
以下操作需在兩個節(jié)點上進(jìn)行配置
[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
使內(nèi)核參數(shù)生效,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的對等性
以下操作需要兩個節(jié)點同樣進(jìn)行
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
設(shè)置互信關(guān)系,這里記住oracle和grid用戶都要設(shè)置互信
su - grid
mkdir ~/.ssh
ssh-keygen -t rsa
ssh-keygen -t dsa
以下操作在一個節(jié)點上執(zhí)行即可
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 --第二個節(jié)點的公鑰寫到本機
ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys secdb2:~/.ssh/authorized_keys
兩個節(jié)點上分別驗證
ssh rac1 date
ssh rac2 date
ssh rac1-priv date
ssh rac2-priv date
11.創(chuàng)建目錄和授權(quán)
以下操作需要在兩個節(jié)點同樣進(jìn)行
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.環(huán)境變量
如下操作也需要在兩個節(jié)點上同樣進(jìn)行,這里需要注意的是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環(huán)境下安裝,其實就是個linux系統(tǒng),我們創(chuàng)建vmdisk就行了。配置登陸一個網(wǎng)頁https://ip:446
我這里已經(jīng)劃分好了,看圖就行了,至于openfiler的配置大家應(yīng)該可以自學(xué)一下,非常簡單屬于看圖點鼠標(biāo)的那種,英文稍微好點的同學(xué)能搞定
14.分別在兩個rac節(jié)點上配置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其中一個節(jié)點進(jìn)行:
[root@rac1 ~]# fdisk /dev/sdb 以此類推我這里需要格式化3個磁盤!?。?br/>完成后我們查看一下,通過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
到另一個節(jié)點上
輸入partprobe即可,查看fdisk -l和其它節(jié)點的一致?。?br/>
15.創(chuàng)建ASM磁盤
以下操作在兩個及節(jié)點上分別進(jìn)行:
[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其中一個節(jié)點上進(jìn)行,我在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
以下操作在另一個節(jié)點上進(jìn)行,RAC2上操作
[root@rac1 ~]# oracleasm scandisks
我這里用到的是asmlib來做磁盤設(shè)備管理的,這里大家也可以使用UDEV來管理,在RHEL6中asmlib已經(jīng)被廢棄了,以后就是UDEV的天下
16,禁用NTP server
此操作同樣在兩個節(jié)點上進(jìn)行
[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,對應(yīng)我們的dns里寫的名字,不選擇GNS,點擊“next”
點擊add,添加第二個節(jié)點,完成后,點擊“next”
這里只需要確認(rèn)一下網(wǎng)絡(luò)接口,安裝向?qū)б呀?jīng)把我們填寫,其實這里和oracle 10g差不多??!
選擇ASM存儲方式,點擊"Next"
這里讓我們創(chuàng)建asm disk group,給一個名字“OCRVOTI” ,選擇Redundancy External。不鏡像ASM中的數(shù)據(jù),使用外部
存儲陣列提供冗余。點擊“next”
選擇給ASM的SYS、ASMSNMP用戶配置為相同的口令,并輸入口令,Next:這里需要注意的是密碼為強度密碼喔!!
這里選擇第二項不使用IPMI
給ASM指定不同的組,這里沒什么好說的,繼續(xù)next
這里安裝向?qū)湍闾顚懠很浖陌惭b路徑,我們繼續(xù)next,這里我們需要注意的是oracle_Home不能是oracle_base的子目錄
選擇默認(rèn)的Inventory,Next:
這里瞬間會檢查通過的,我們來到這個界面,繼續(xù)“finish”
等待一小會,可以去休息一下
完成后,需要手動在root用戶下執(zhí)行兩個腳本,按照順序執(zhí)行即可?。。?!在執(zhí)行第二個腳本root.sh的時候會比較慢
我們會看到這個報錯,其實這個問題我查看了mos知識庫,說的比較含糊,可以忽略這個錯誤,不影響我們的安裝和未來的使用
我們直接finish了,這里我們集群軟件安裝完成。
19.安裝oracle 11.2.0.1軟件
我們su - oracle
還是在解壓/install/oracle/database運行安裝腳本,我們還是用OUI模式安裝,這里和安裝grid一樣,啟動安裝向?qū)?br/>我們不填寫mos賬號,又不聯(lián)網(wǎng)沒意義,點擊next,這里我們還是在rac1節(jié)點上安裝
我們這里只安裝數(shù)據(jù)庫軟件,點擊next
這里選擇集群安裝方式,選擇“select All”,點擊next
還是選擇語言為”English“,點擊next
選擇”Enterprise Edition“ 點擊”next“
這里是oracle_base和oracle_home,點擊next
這個對應(yīng)到組就可以了,繼續(xù)next
這一步會check你的安裝環(huán)境,我們只要配置參數(shù)正確就沒問題,這里基本上都是succeeded,點擊next
summary一下,我們就可以finish了
這里安裝會比較快,可以去尿個尿,回來就好了。。。。
完成后同樣也要執(zhí)行一個腳本,也是要在root用戶下去執(zhí)行,分別兩個節(jié)點上
完成。
20.創(chuàng)建ASM磁盤組
在安裝GI集群軟件的時候我們就配置過asm磁盤,現(xiàn)在我們還有一個disk分區(qū)沒有加入到asm磁盤組中,我們通過asmca來實現(xiàn)
su - grid
運行命令asmca,我們看到下面配置向?qū)?。這里可以看到我們之前配置過的disk group,我們點擊create后
來到這里,我們給disk group起個名字,選擇redundancy External,勾選VOL3,我們ok一下
會有一個10秒的等待創(chuàng)建磁盤組,完成后提示成功。
這里我們就能看到有兩個disk group了!??!退出即可。。
21.配置oracle database
我們直接su - oracle,運行dbca命令來配置數(shù)據(jù)庫
來到如下界面后,我們選擇第一項集群模式,然后next
這個就不用考慮了,直接選擇create a database,繼續(xù)next
這個也是選擇general purpose,繼續(xù)next
配置類型選擇admin-managed,Global database name和sid相同為test,最下面我們選擇”select all“,然后next
這里我們還是選擇默認(rèn)推薦的配置,EM和amt都選擇配置,繼續(xù)next
把sys、system、dbsnmp都給一個相同的密碼,這里你自己給吧??!然后next
這里我們選擇用存儲類型為asm,使用omf管理數(shù)據(jù)文件。
我們這里不選擇閃回恢復(fù)區(qū),我這里就不配置了,以后手動改spfile吧??!
裝上sample schemas,以后就有數(shù)據(jù)可以測試玩一把了?。?繼續(xù)next
這里我們字符集會有所設(shè)置,ZHS16GBK-GBK,國際字符集默認(rèn)的就行。其它的選項卡沒有特殊配置,在以后都可以去改spfile,我們繼續(xù)next
這個是數(shù)據(jù)庫的存儲配置頁面,我們看一下控制文件等等都要開始安裝了,next
繼續(xù)finish
等待吧,這個也是比較久的,我的SSD和cpu比較給力,速度基本上10分鐘吧??!
安裝完后,點擊exit
我們就退出安裝配置向?qū)Я耍。。?br/>22.檢查
檢查crs資源狀態(tài)
[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狀態(tài),其實兩個進(jìn)程對我們的數(shù)據(jù)庫是沒有任何影響的,我們把他們打開就行了
[grid@rac2 ~]$ srvctl status nodeapps -n rac2
-n <node_name> option has been deprecated.
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
這里還要強調(diào)一下11.2.0.1版本的一個bug,就是客戶端無法通過scan連接到數(shù)據(jù)庫解決方法如下:
[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”有了一定的了解,如果想了解更多相關(guān)知識,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。