- 最后登录
- 2017-5-4
- 在线时间
- 81 小时
- 威望
- 999
- 金钱
- 2391
- 注册时间
- 2013-9-11
- 阅读权限
- 150
- 帖子
- 1124
- 精华
- 5
- 积分
- 999
- UID
- 1220
|
1#
发表于 2013-11-17 17:03:39
|
查看: 2564 |
回复: 1
如何 Relink 11.2 Grid Infrastructure(GI) 和 11.2 RAC?
对于Oracle Clusterware(CRS) 10g 和11.1, CRS 的binary 不能被 relink。CRS 中的client shared libraries可以被relink, 但是这个relink只有当OS升级或者给OS打补丁出现问题后才需要,大部分时候不需要relink CRS。
如果想对CRS中的client shared libraries做relink, 请参考MOS文档中的步骤:
Will an Operating System Upgrade Affect Oracle Clusterware? [ID 743649.1]
对于Oracle Grid Infrastructure(GI) 11.2 及之后的版本,在GRID HOME中有一些binary需要在OS升级或者打补丁后被relink。
对于数据库软件(RDBMS binary),在OS升级或者OS打补丁后推荐做relink, RAC 的binary也是一样的,需要relink。
下面是在11.2 集群环境中执行relink的过程,包括了对GI和RAC做relink的步骤:
1. 首先停止这个节点上的所有数据库实例,这是因为之后停止CRS时虽然会停止数据库实例,但是是以shutdown abort的方式,我们需要以shutdown immediate或者normal来停止数据库实例:
$su - oracle
$srvctl stop instance -d <db_name> -i <instance_name> -o immediate
2. 如果业务需要高可用性,确保这个实例上的service已经切换到了其它节点的实例上。
$ srvctl status service -d <db_name>
3. 用root用户执行<GRID_HOME>/crs/install/rootcrs.pl -unlock来修改相应目录权限并停止GI:
[root@rac1 ~]# cd /u01/app/11.2.0/grid/crs/install
[root@rac1 install]# perl rootcrs.pl -unlock
Using configuration parameter file: ./crsconfig_params
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1'
CRS-2673: Attempting to stop 'ora.crsd' on 'rac1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac1'
CRS-2673: Attempting to stop 'ora.rac2.vip' on 'rac1'
CRS-2673: Attempting to stop 'ora.oc4j' on 'rac1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'rac1'
CRS-2673: Attempting to stop 'ora.cvu' on 'rac1'
CRS-2677: Stop of 'ora.rac2.vip' on 'rac1' succeeded
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'rac1'
CRS-2677: Stop of 'ora.scan1.vip' on 'rac1' succeeded
CRS-2677: Stop of 'ora.oc4j' on 'rac1' succeeded
CRS-2677: Stop of 'ora.cvu' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac1'
CRS-2673: Attempting to stop 'ora.CRS.dg' on 'rac1'
CRS-2673: Attempting to stop 'ora.racdb.db' on 'rac1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.rac1.vip' on 'rac1'
CRS-2677: Stop of 'ora.rac1.vip' on 'rac1' succeeded
CRS-2677: Stop of 'ora.CRS.dg' on 'rac1' succeeded
CRS-2677: Stop of 'ora.racdb.db' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac1'
CRS-2673: Attempting to stop 'ora.RECO.dg' on 'rac1'
CRS-2677: Stop of 'ora.DATA.dg' on 'rac1' succeeded
CRS-2677: Stop of 'ora.RECO.dg' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac1'
CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'rac1'
CRS-2677: Stop of 'ora.ons' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'rac1'
CRS-2677: Stop of 'ora.net1.network' on 'rac1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac1' has completed
CRS-2677: Stop of 'ora.crsd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1'
CRS-2673: Attempting to stop 'ora.crf' on 'rac1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1'
CRS-2673: Attempting to stop 'ora.evmd' on 'rac1'
CRS-2673: Attempting to stop 'ora.asm' on 'rac1'
CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded
CRS-2677: Stop of 'ora.crf' on 'rac1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'rac1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded
CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac1'
CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1'
CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1'
CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
Successfully unlock /u01/app/11.2.0/grid
注意,如果在$GRID_HOME/rdbms/audit下面的audit文件很多,会导致rootcrs.pl执行很长时间,这样的话可以将$GRID_HOME/rdbms/audit/*.aud 文件备份到GRID_HOME之外,然后删除。
4. 禁止GI在OS重启后自动启动,这是因为升级OS或者打OS补丁后,可能需要重启主机,这样的话,需要在relink之前禁止GI启动。
用root用户:
[root@rac1 install]# crsctl disable crs
CRS-4621: Oracle High Availability Services autostart is disabled.
5. 备份GI和RDBMS的ORACLE_HOME。
6. 升级OS或者给OS打补丁,包括重启主机等(如果需要)。
7. 用GI的属主用户来对GI binary进行relink:
[root@rac1 audit]# su - grid
[grid@rac1 ~]$ export ORACLE_HOME=/u01/app/11.2.0/grid
确保GI是停止的,然后再执行relink:
[grid@rac1 ~]$ ps -ef|grep d.bin
grid 3408 3360 0 17:09 pts/0 00:00:00 grep d.bin
[grid@rac1 ~]$ crsctl stat res -t
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Status failed, or completed with errors.
[grid@rac1 ~]$ $ORACLE_HOME/bin/relink
writing relink log to: /u01/app/11.2.0/grid/install/relink.log
[grid@rac1 ~]$ <===relink结束后,并不会有任何信息提示,只是显示命令提示符。
需要检查/u01/app/11.2.0/grid/install/relink.log, 查看是否有错误。
下面截取了末尾的一些行,如下:
...
- Linking Oracle
rm -f /u01/app/11.2.0/grid/rdbms/lib/oracle
gcc -o /u01/app/11.2.0/grid/rdbms/lib/oracle -m64 -L/u01/app/11.2.0/grid/rdbms/lib/ -L/u01/app/11.2.0/grid/lib/ -
...
lsnls11 -lnls11 -lcore11 -lnls11 -lasmclnt11 -lcommon11 -lcore11 -laio `cat /u01/app/11.2.0/grid/lib/sysliblist` -Wl,-
rpath,/u01/app/11.2.0/grid/lib -lm `cat /u01/app/11.2.0/grid/lib/sysliblist` -ldl -lm -L/u01/app/11.2.0/grid/lib
test ! -f /u01/app/11.2.0/grid/bin/oracle ||\
mv -f /u01/app/11.2.0/grid/bin/oracle /u01/app/11.2.0/grid/bin/oracleO
mv /u01/app/11.2.0/grid/rdbms/lib/oracle /u01/app/11.2.0/grid/bin/oracle
chmod 6751 /u01/app/11.2.0/grid/bin/oracle
8. 用RDBMS的属主对数据库binary做relink:
su - oracle
确保$ORACLE_HOME设置为了数据库的ORACLE_HOME,然后执行:
[oracle@rac1 ~]$ $ORACLE_HOME/bin/relink all
writing relink log to: /u01/app/oracle/product/11.2.0/dbhome_1/install/relink.log
<===relink结束后,并不会有任何信息提示,只是显示命令提示符。
需要检查/u01/app/oracle/product/11.2.0/dbhome_1/install/relink.log, 查看是否有错误。
截取relink.log中部分内容:
Starting Oracle Universal Installer... <<<<<<开头
...
le/product/11.2.0/dbhome_1/lib/sysliblist` -ldl -lm -L/u01/app/oracle/product/11.2.0/dbhome_1/lib
test ! -f /u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle ||\
mv -f /u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle /u01/app/oracle/product/11.2.0/dbhome_1/bin/
oracleO
mv /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/oracle /u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle
chmod 6751 /u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle <<<<<<结尾
9. 用root用户执行<GRID_HOME>/crs/install/rootcrs.pl -patch来修改相应目录权限并启动GI:
[root@rac1 ~]# cd /u01/app/11.2.0/grid/crs/install
[root@rac1 install]# perl rootcrs.pl -patch
Using configuration parameter file: ./crsconfig_params
CRS-4123: Oracle High Availability Services has been started.
|
|