分类: Oracle
2010-11-12 15:26:44
三.安装clusterware软件
上次crs软件到node1中,解压
1>检测安装环境是否满足要求
./runcluvfy.sh stage -pre crsinst -n node1,node2 -verbose
内存,
gcc3.2
compat-gcc-7.3-2.96.128 down
compat-gcc-c++-7.3-2.96.128down
compat-libstdc++-7.3-2.96.128 down
compat-libstdc++-devel-7.3-2.96.128
rpm -Uvh gcc-4.1.2-42.el5.i386.rpm --nodeps --force
rpm -Uvh compat-gcc-34-* --nodeps --force
rpm -Uvh compat-libstdc++* --nodeps --force
找到包rpm 加上--nodeps --force 参数强制安装
rpm -Uvh
$su – oracle
$cd clusterware
$./runInstaller –ignoreSysPrereqs
注意:指定 eth0 的类型时public
2>指定oct,votingdisk
存储本身redundancy,或Oralce提供的normal Redundancy
Normal redundancy
Oct,提供一个冗余备份
Voting 提供两个备份
3>在每个节点上运行第一个脚本
sh orainstRoot.sh
4>每个节点上运行
Root.sh
在执行最后一个脚本的时候,自动调用vipca
在执行第二个脚本之前修改以下参数
A:#vi /u01/app/oracle/product/在node2节点上:
10.2.0/crs/bin/vipca 添加红色内容
If [ "$arch" = "i686" -o "$arch" = "ia64" ]
then
LD_ASSUME_KERNEL=2.4.19
export LD_ASSUME_KERNEL
fi
#End workaround
unset LD_ASSUME_KERNEL
B: # vi /u01/app/oracle/product/10.2.0/crs/bin/srvctl 添加红色内容
#Remove this workaround when the bug 3937317 is fixed
LD_ASSUME_KERNEL=2.4.19
export LD_ASSUME_KERNEL
unset LD_ASSUME_KERNEL
注意:vipca命令也是用root用户来运行的,只需要在一个节点运行就可以
可能遇到的问题
问题1: vipca报错,是redhat的bug
Running vipca(silent) for configuring nodeapps
/home/oracle/crs/oracle/product/10/crs/jdk/jre//bin/java: error while loading
shared libraries: libpthread.so.0: cannot open shared object file:
No such file or directory
解决方法:
Remember to re-edit these files on all nodes:
after applying the 10.2.0.2 or 10.2.0.3 patchsets, as these patchset will still include those settings unnecessary for OEL5 or RHEL5 or SLES10. This issue was raised with development and is fixed in the 10.2.0.4 patchsets.
Note that we are explicitly unsetting LD_ASSUME_KERNEL and not merely commenting out its setting to handle a case where the user has it set in their environment (login shell).
$ vi vipca
... ...
Linux) LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:$ORACLE_HOME/srvm/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
echo $LD_LIBRARY_PATH
echo $CLASSPATH
#Remove this workaround when the bug 3937317 is fixed
arch=`uname -m`
if [ "$arch" = "i686" -o "$arch" = "ia64" ]
then
# LD_ASSUME_KERNEL=2.4.19
# export LD_ASSUME_KERNEL
echo -- 这里一定要加上,不然返回会报错
fi
#End workaround
问题2: 如果遇到这个错误:
# vipca
Error 0(Native: listNetInterfaces:[3])
[Error 0(Native: listNetInterfaces:[3])]
解决方法:
在CRS_HOME下 运行 oifcfg 命令:
Node1
# ./oifcfg setif -global eth0/192.168.19.129:public
# ./oifcfg setif -global eth1/192.168.86.135:cluster_interconnect
# ./oifcfg getif
eth0 192.168.19.129 global public
eth1 192.168.86.135 global cluster_interconnect
在node2
/bin # ./oifcfg setif -global eth0/192.168.19.130:public
/bin # ./oifcfg setif -global eth1/192.168.1.201:cluster_interconnect
/bin # ./oifcfg getif
eth0 192.168.19.129 global public
eth0 192.168.19.130 global public
eth1 192.168.86.135 global cluster_interconnect
eth1 192.168.86.136 global cluster_interconnect
这时候没有必要在返回重新执行root.sh,需要手工执行vipca命令为两个
节点添加一些必要的进程,哪个节点,无所谓,在此选择node2上
然后在手工运行vipca添加nodeapps resource
即,以root图形用户登录node2,运行#./vipca
配置虚拟vip,创建
6个步骤
Create vip application resource on 2 nodes
Create gsd application resource on 2 nodes
Starting ons application resource on 2 nodes
Starting vip application....
...
问题3:An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0xB7503E29
Function=__libc_free+0x49
Library=/lib/tls/libc.so.6
修改主机名不正确导致的。
RHEL
/etc/sysconfig/network 主机名,如果在/etc/hosts中解析不了。就报这个错误!
在执行第二个节点上执行root.sh,
Expecting the CRS daemons to be up within 600 seconds.
Failure at final check of Oracle CRS stack.
解决办法
在虚拟机node,node2的配置文件中加入
scsi1:1.shared = "true"
scsi1:2.shared = "true"
scsi1:3.shared = "true"
scsi1:4.shared = "true"
scsi1:5.shared = "true"
5>Clusterware 安装结束
确认安装
Node1,node2
[oracle@node1 scripts]$ /u01/app/oracle/product/10.2.0/crs/bin/olsnodes -n
node1 1
node2 2
[oracle@node1 ~]$ ls -l /etc/init.d/init.*
-r-xr-xr-x 1 root root 1951 Oct 14 05:35 /etc/init.d/init.crs
-r-xr-xr-x 1 root root 4721 Oct 14 05:35 /etc/init.d/init.crsd
-r-xr-xr-x 1 root root 35401 Oct 14 05:35 /etc/init.d/init.cssd
-r-xr-xr-x 1 root root 3197 Oct 14 05:35 /etc/init.d/init.evmd
6>检查CRS安装启动情况,用root用户执行
[oracle@node1 scripts]$ crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
如果安装失败,再次运行安装程序,里面可以把之前的安装
[oracle@node2 ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.node1.gsd application 0/5 0/0 ONLINE ONLINE node1
ora.node1.ons application 0/3 0/0 ONLINE ONLINE node1
ora.node1.vip application 0/0 0/0 ONLINE ONLINE node2
ora.node2.gsd application 0/5 0/0 ONLINE ONLINE node2
ora.node2.ons application 0/3 0/0 ONLINE ONLINE node2
ora.node2.vip application 0/0 0/0 ONLINE ONLINE node2
对node1-vip进行双向测试
Ssh node1-vip date
Ssh node1-vip date
....
四.安装Oracle 10gR2 datebase
1检查相关包
binutils-2.15.92.0.2-10.EL4
compat-db-4.1.25-9
control-center-2.8.0-12
gcc-3.4.3-9.EL4
gcc-c++-3.4.3-9.EL4
glibc-2.3.4-2
glibc-common-2.3.4-2
gnome-libs-1.4.1.2.90-44.1
libstdc++-3.4.3-9.EL4
libstdc++-devel-3.4.3-9.EL4
make-3.80-5
pdksh-5.2.14-30
sysstat-5.0.5-1
xscreensaver-4.18-5.rhel4.2
libaio-0.3.96
上传安装包,解压10201_database_linux32.zip
2. 在Xmanager 中用oracle用户,运行database的runInstaller -ignoreSysPrereqs
由于从WIN将包传到Linux,解压,遇到
[root@node2 bin]# chmod
chmod: missing operand
Try `chmod --help' for more information
解决办法:
两个方法
for file in `ls ./`; do chmod 644 $file; done
find ./* -type f -exec chmod 644 {} \;
find . -type f -exec chmod 644 {} \;
3. ORACLE安装目录指定到 /u01/app/oracle/product/10.2.0/db
4. 把2个node选择上
5. 选择 Install database Software only
6. 会要求你用完全的root权限运行 root.sh ,分别在2个node上一一运行
7. 安装完毕
五.创建监听netca
创建数据库过程应该,先配置监听,asm,数据库实例
1. oracle 用户在一个node上运行 netca
2. 选择所有node
3. 选择 Listener configuration
4. 添加一个LISTENER, 1521 port ,然后结束配置
监听配置成功后, 2个结点上的Listener 都会坐位Application Resource 注册到CRS中, 这样CRS就可以监控Listener 的运行状态。 我们可以通过 crs_stat -t -v 查看Listener 状态
[oracle@node2 init.d]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora....E1.lsnr application 0/5 0/0 ONLINE ONLINE node1
ora.node1.gsd application 0/5 0/0 ONLINE ONLINE node1
ora.node1.ons application 0/3 0/0 ONLINE ONLINE node1
ora.node1.vip application 0/0 0/0 ONLINE ONLINE node1
ora....E2.lsnr application 0/5 0/0 ONLINE ONLINE node2
ora.node2.gsd application 0/5 0/0 ONLINE ONLINE node2
ora.node2.ons application 0/3 0/0 ONLINE ONLINE node2
ora.node2.vip application 0/0 0/0 ONLINE ONLINE node2
六.创建ASM实例
1. 运行DBCA 命令
2. 选择 configure Automatic Storage Management, 来创建ASM 实例
3. 选择所有结点
4. 输入密码。RAC 的spfile 必须放在共享目录下。 参数文件我们选择第一个initialization parameter。 也可以放在我们建的裸设备上。
5. 修改asm 参数: asm_diskstring = ORCL:VOL*, 这样能让Oracle自动发现这些硬盘
6. ASM 实例创建完后,用Create New 来创建ASM 磁盘组。 我们用VOL1来创建一个DATA 组, VOL2 创建FLASH_RECOVERY_AREA组。
注:
Redundancy 一般选external 就是也就是不考虑冗余,
假如选normal 则是mirror, 至少要一个FailGroup.
选High 就是triple mirror,3倍镜像,需要三个FailGroup
创建完成后,能看到组的状态是Mount, ASM 组必须mount之后才能使用。
[oracle@node2 init.d]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE node1
ora....E1.lsnr application 0/5 0/0 ONLINE ONLINE node1
ora.node1.gsd application 0/5 0/0 ONLINE ONLINE node1
ora.node1.ons application 0/3 0/0 ONLINE ONLINE node1
ora.node1.vip application 0/0 0/0 ONLINE ONLINE node1
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE node2
ora....E2.lsnr application 0/5 0/0 ONLINE ONLINE node2
ora.node2.gsd application 0/5 0/0 ONLINE ONLINE node2
ora.node2.ons application 0/3 0/0 ONLINE ONLINE node2
ora.node2.vip application 0/0 0/0 ONLINE ONLINE node2
七.配置dbca创建数据库
1. 用oracle用户运行 dbca
2. 选择custom database
3. 输入数据库的全局名,比如NODe
SID:实例名的前缀
4. 输入系统的角色建立密码
5. 选择ASM 来存储, 分别选择我们刚创建的DATA 和FLASH_RECOVERY_AREA 组
6. Database Services 这里,你选择Add你一个新的service, 随便叫名字,比如oltp。然后选择 TAF Policy,是Basic。 这个服务在RAC 的Failover中会用到,如果在这里没有配置,也可以通过dbca命令, 选择 Services Management 来进行配置
7开始创建数据库
[oracle@node1 ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora....E1.inst application 0/5 0/0 ONLINE ONLINE node1
ora....E2.inst application 0/5 0/0 ONLINE ONLINE node2
ora.NODE.db application 0/1 0/1 ONLINE ONLINE node2
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE node1
ora....E1.lsnr application 0/5 0/0 ONLINE ONLINE node1
ora.node1.gsd application 0/5 0/0 ONLINE ONLINE node1
ora.node1.ons application 0/3 0/0 ONLINE ONLINE node1
ora.node1.vip application 0/0 0/0 ONLINE ONLINE node1
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE node2
ora....E2.lsnr application 0/5 0/0 ONLINE ONLINE node2
ora.node2.gsd application 0/5 0/0 ONLINE ONLINE node2
ora.node2.ons application 0/3 0/0 ONLINE ONLINE node2
ora.node2.vip application 0/0 0/0 ONLINE ONLINE node2
八.检测RAC运行状态
[root@node2 bin]# ./srvctl status database -d node
Instance NODE1 is running on node node1
Instance NODE2 is running on node node2
[root@node2 bin]# ./crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora....E1.inst application 0/5 0/0 ONLINE ONLINE node1
ora....E2.inst application 0/5 0/0 ONLINE ONLINE node2
ora.NODE.db application 0/1 0/1 ONLINE ONLINE node2
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE node1
ora....E1.lsnr application 0/5 0/0 ONLINE ONLINE node1
ora.node1.gsd application 0/5 0/0 ONLINE ONLINE node1
ora.node1.ons application 0/3 0/0 ONLINE ONLINE node1
ora.node1.vip application 0/0 0/0 ONLINE ONLINE node1
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE node2
ora....E2.lsnr application 0/5 0/0 ONLINE ONLINE node2
ora.node2.gsd application 0/5 0/0 ONLINE ONLINE node2
ora.node2.ons application 0/3 0/0 ONLINE ONLINE node2
ora.node2.vip application 0/0 0/0 ONLINE ONLINE node2
后续:
Node1 Node2 Service_names NODE NODE Instance_name NODE1 NODE2 Db_name NODE NODE Db_unique_name NODE NODE Oracle_SID NODE1 NODE2 Hostname NODE1 NODE2
文档
chinaunix网友2011-06-05 02:08:12
大连法律咨询在线 http://www.fabowang.com 大连律师在线咨询 http://www.fabowang.com 大连法律顾问网 http://www.fabowang.com 大连律师咨询 http://www.fabowang.com
chinaunix网友2010-11-15 15:13:33
很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com