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用户执行/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.
10. Enable CRS来保证主机重启后可以自动启动GI:
[root@rac1 install]# crsctl enable
crs
CRS-4622: Oracle High Availability Services autostart is
enabled.
11. 确认所有的应启动的资源都已启动:
[root@rac1
install]# crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local
Resources
--------------------------------------------------------------------------------
ora.CRS.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.DATA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.RECO.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE
OFFLINE rac1
OFFLINE
OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
--------------------------------------------------------------------------------
Cluster
Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac2
ora.cvu
1 ONLINE ONLINE rac2
ora.oc4j
1 ONLINE ONLINE rac2
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.racdb.db
1 ONLINE ONLINE rac2 Open
2 OFFLINE
OFFLINE Instance
Shutdown
ora.scan1.vip
1 ONLINE ONLINE rac2
如果发现实例没有启动,可以手工启动:
$srvctl start instance -d
-i
12. 可以用下面的MOS文档中的方法来确认oracle 的binary是RAC的:
How to Check Whether Oracle Binary/Instance is RAC Enabled and
Relink Oracle Binary in RAC [ID 284785.1]
方法1:如果下面的命令能查出kcsm.o ,说明binary是RAC的:
su - oracle
$ar -t $ORACLE_HOME/rdbms/lib/libknlopt.a|grep kcsm.o
kcsm.o
在AIX上命令是不同的:
ar -X32_64 -t
$ORACLE_HOME/rdbms/lib/libknlopt.a|grep kcsm.o
方法2:查看RAC特有的后台进程是否存在,比如:
[grid@rac1 ~]$ ps -ef|grep lmon
grid 7732 1 0 17:59
? 00:00:17 asm_lmon_+ASM1
oracle 18605 1 0 20:49
? 00:00:00 ora_lmon_RACDB1 <===========
grid 20992 10160 0 21:10
pts/2 00:00:00 grep lmon
上面的所有步骤需要在集群的各个节点上依次执行。