redhat5.5安装oracle10g rac的时候,当作第一个执行root.sh是没能成功执行。

[root@RAC1 raw]# /opt/ora10g/product/10.2.0/crs_1/root.sh
WARNING: directory '/opt/ora10g/product/10.2.0' is not owned by root
WARNING: directory '/opt/ora10g/product' is not owned by root
WARNING: directory '/opt/ora10g' is not owned by root
Checking to see if Oracle CRS stack is already configured
/etc/oracle does not exist. Creating it now.

Setting the permissions on OCR backup directory
Setting up NS directories
Failed to upgrade Oracle Cluster Registry configuration

日志内容也比较简单没有太多的信息:

[root@RAC1 client]# more ocrconfig_12625.log
Oracle Database 10g CRS Release 10.2.0.1.0 Production Copyright 1996, 2005 Oracle. All rights reserved.
2012-06-07 15:03:09.341: [ OCRCONF][3275664256]ocrconfig starts...
2012-06-07 15:03:09.342: [ OCRCONF][3275664256]Upgrading OCR data
2012-06-07 15:03:09.378: [ OCRCONF][3275664256]OCR already in current version.
2012-06-07 15:03:09.388: [ OCRCONF][3275664256]Failed to call clsssinit (21)
2012-06-07 15:03:09.388: [ OCRCONF][3275664256]Failed to make a backup copy of OCR
2012-06-07 15:03:09.388: [ OCRCONF][3275664256]Exiting [status=failed]...

因为之前安装过一次rac,后来因为系统不符合客户的要求,重新安装过操作系统,但是共享的磁盘没有重新初始化过。

[root@RAC1 bin]# ./clsfmt.bin ocr /dev/raw/raw1
clsfmt: Failure trying to resize OCR file from 501179904 bytes to 501182464 bytes
clsfmt: successfully initialized file /dev/raw/raw1

这个返回是说ocr使用的裸设备已经被使用过了。
这只有使用dd命令把裸设备初始化一下。

[root@RAC1 client]# dd if=/dev/zero of=/dev/raw/raw1 bs=1M count=512
dd: writing `/dev/raw/raw1': No space left on device
478+0 records in
477+0 records out
501179904 bytes (501 MB) copied, 2.20439 seconds, 227 MB/s

然后再执行root.sh脚本,顺利完成。

[root@RAC1 raw]# /opt/ora10g/product/10.2.0/crs_1/root.sh
WARNING: directory '/opt/ora10g/product/10.2.0' is not owned by root
WARNING: directory '/opt/ora10g/product' is not owned by root
WARNING: directory '/opt/ora10g' is not owned by root
Checking to see if Oracle CRS stack is already configured

Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/opt/ora10g/product/10.2.0' is not owned by root
WARNING: directory '/opt/ora10g/product' is not owned by root
WARNING: directory '/opt/ora10g' is not owned by root
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: rac1 rac1-priv rac1
node 2: rac2 rac2-priv rac2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting device: /dev/raw/raw2
Format of 1 voting devices complete.
Startup will be queued to init within 90 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
rac1
CSS is inactive on these nodes.
rac2
Local node checking complete.
Run root.sh on remaining nodes to start CRS daemons.