Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

39

积分

0

好友

1

主题
1#
发表于 2012-5-2 13:24:12 | 查看: 8394| 回复: 24
RHEL 5.6安装oracle10g rac执行root.sh时报错!求大侠帮忙啊!!

安装环境  RHEL 5.6 ,在安装clusterware到./root.sh一步时报错。


[root@rac1 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
WARNING: directory '/opt' 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
/opt/ora10g/product/10.2.0/crs_1/install/rootconfig: line 815: 4495 Segmentation fault      $CH/bin/ocrconfig -upgrade $CRS_ORACLE_OWNER $CRS_DBA_GROUP
Failed to upgrade Oracle Cluster Registry configuration.




其中:
crwxrwxr-x 1 oracle oinstall 162, 1 04-28 16:44 raw1
crwxrwxr-x 1 oracle oinstall 162, 2 04-28 16:45 raw2
crwxrwxr-x 1 oracle oinstall 162, 3 04-28 16:44 raw3
crwxrwxr-x 1 oracle oinstall 162, 4 04-28 16:44 raw4



[root@rac1 crs_1]#/clsfmt ocr /dev/raw/raw2
clsfmt: Failure trying to resize OCR file from 1073537536 bytes to 1073541120 bytes
clsfmt: successfully initialized file /dev/raw/raw2。


然后我 dd if=/dev/zero of=/dev/raw/raw2 bs=1M count=100 也正常。


但是再次执行./root.sh时,
还是报错......,
而且/dev/raw下的文件属性也变了。
crw-r-----   1 oracle oinstall 162, 1 04-28 16:44 raw1
crw-r-----   1 root    oinstall 162, 2 04-28 16:45 raw2
crwxrwxr-x 1 oracle oinstall 162, 3 04-28 16:44 raw3
crwxrwxr-x 1 oracle oinstall 162, 4 04-28 16:44 raw4


那位大侠能帮帮忙啊?
2#
发表于 2012-5-2 18:17:25
action plan:

贴出以下命令的输出

uname  -a
arch
cat /etc/issue
which gcc
which g++
ls -ltra /usr/bin/gcc*
ls -ltra /usr/bin/g+*

回复 只看该作者 道具 举报

3#
发表于 2012-5-2 18:25:51
uname
Linux

arch
x86_64


which gcc
/usr/bin/gcc

which g++
/usr/bin/g++



ls -ltra /usr/bin/gcc*
-rwxr-xr-x 1 root root   2018 2006-07-18 /usr/bin/gccmakedep
-rwxr-xr-x 1 root root    914 2008-05-23 /usr/bin/gcc
-rwxr-xr-x 2 root root 102408 2010-09-22 /usr/bin/gcc34
-rwxr-xr-x 2 root root 221920 2010-10-07 /usr/bin/gcc.orig

ls -ltra /usr/bin/g+*
-rwxr-xr-x 1 root root    914 2008-05-23 /usr/bin/g++
-rwxr-xr-x 3 root root 103344 2010-09-22 /usr/bin/g++34
-rwxr-xr-x 4 root root 221736 2010-10-07 /usr/bin/g++.orig

回复 只看该作者 道具 举报

4#
发表于 2012-5-2 18:27:25
uname -aLinux rac1 2.6.18-238.el5 #1 SMP Sun Dec 19 14:22:44 EST 2010 x86_64 x86_64 x86_64 GNU/Linux

回复 只看该作者 道具 举报

5#
发表于 2012-5-2 18:43:30
Segmentation fault ==> 这说明 ocrconfig编译存在问题

究其根本是 10.2.0.1 CRS 比 RHEL 5 早发行, 所以 10.2.0.1 CRS 本身在RHEL  5上是没有认证的, 在RHEL 4上安装则不会出现这类问题。

RHEL 5上默认的gcc是 4.1.2 , 你可以尝试:

确认安装了正确的 rpm

rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}  (%{ARCH})\n' binutils compat-db control-center gcc gcc-c++ glibc glibc-common glibc-devel gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio


使用 gcc34 替换 gcc412


1. cd /usr/bin
2. mv gcc gcc.script
3. mv g++ g++.script
4. ln -s gcc34 gcc
5. ln -s g++34 g++


卸载 crs

重新安装 cluterware


建议 使用经过认证的RHEL 4.7/4.8 安装 10.2.0.1 clusterware 并升级到 10.2.0.5

回复 只看该作者 道具 举报

6#
发表于 2012-5-2 20:42:03
非常感谢maclean!问题解决了,拜谢!!同时我想问问,为什么这么改就可以了

回复 只看该作者 道具 举报

7#
发表于 2012-5-2 21:37:33
Oracle 开发部门在10.2.0.1 在Linux 上 开发和编译 使用较早的gcc296 或者 gcc32 编译器,当时只考虑 兼容 rhel3 或者 rhel4 ,rhel5 是在10.2.0.1 之后才发行的,10.2.0.1 官方没有在rhel5 上认证,rhel 5默认使用gcc412 编译器, 现在看来 gcc412 link出来的ocrconfig 存在segment fault 的问题 导致  root.sh 运行失败。

通过更换默认的gcc 为 gcc34 来绕过该编译器兼容问题。

回复 只看该作者 道具 举报

8#
发表于 2012-5-3 12:08:06
我在升级10.2.0.5的时候在第二个节点上执行root102.sh的时候,
提示

/opt/ora10g/product/10.2.0/crs_1/install/root102.sh: line 1113:3413段错误     $ch/bin/ocrcheck/ > /dev/null 2>&1   

ocrcheck failed.


这个也是编辑器的问题么?我在网上看了 有些说是BUG,但有些是ocr权限问题,我试着改了,再次执行还是有问题!


在线等待!!

回复 只看该作者 道具 举报

9#
发表于 2012-5-3 15:06:04
action plan:



which ocrcheck
ocrcheck
file ocrcheck

strace -o  ocr.log   ocrcheck


贴出以上命令的输出 并上传ocr.log

回复 只看该作者 道具 举报

10#
发表于 2012-5-3 15:12:05
[root@shzckdb01 /]# which ocrcheck/usr/bin/which: no ocrcheck in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

[root@shzckdb01 /]# ocrcheck
-bash: ocrcheck: command not found

[root@shzckdb01 /]# file ocrcheck
ocrcheck: ERROR: cannot open `ocrcheck' (No such file or directory)

[root@shzckdb01 /]# strace -o ocr.log ocrcheck
strace: ocrcheck: command not found[root@shzckdb01 /]

#我把ocecheck log上传吧!

[ 本帖最后由 deepblueluo 于 2012-5-3 16:44 编辑 ]

ocrcheck_4337.txt

371 Bytes, 下载次数: 1037

ocrcheck_32646.txt

372 Bytes, 下载次数: 999

ocrconfig_11388.txt

2.07 KB, 下载次数: 1019

crsd.txt

50.97 KB, 下载次数: 1083

回复 只看该作者 道具 举报

11#
发表于 2012-5-3 15:12:45
ocrcheck 一般存放在$ORA_CRS_HOME/bin 目录下 确保你的PATH 变量正确

回复 只看该作者 道具 举报

12#
发表于 2012-5-3 18:49:42
我在执行ocrcheck 的时候它也提示Segmentation fault 。

[root@shzckdb01 bin]# pwd
/opt/ora10g/product/10.2.0/crs_1/bin

[root@shzckdb01 bin]# ./ocrcheck
Segmentation fault

[root@shzckdb01 bin]#

[ 本帖最后由 deepblueluo 于 2012-5-3 18:51 编辑 ]

回复 只看该作者 道具 举报

13#
发表于 2012-5-3 18:54:10
[oracle@shzckdb01 ~]$ which ocrcheck
/opt/ora10g/product/10.2.0/db_1/bin/ocrcheck
[oracle@shzckdb01 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :    1048288
         Used space (kbytes)      :       3036
         Available space (kbytes) :    1045252
         ID                       :  128324911
         Device/File Name         : /dev/raw/raw2
                                    Device/File integrity check succeeded

                                    Device/File not configured

         Cluster registry integrity check succeeded

[oracle@shzckdb01 ~]$ file ocrcheck
ocrcheck: ERROR: cannot open `ocrcheck' (No such file or directory)
[oracle@shzckdb01 ~]$ strace -o ocr.log ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :    1048288
         Used space (kbytes)      :       3036
         Available space (kbytes) :    1045252
         ID                       :  128324911
         Device/File Name         : /dev/raw/raw2
                                    Device/File integrity check succeeded

                                    Device/File not configured

         Cluster registry integrity check succeeded

[ 本帖最后由 deepblueluo 于 2012-5-3 19:11 编辑 ]

ocr.txt

116.04 KB, 下载次数: 736

回复 只看该作者 道具 举报

14#
发表于 2012-5-3 19:09:26
root102.sh  失败的原因是 ocrcheck 执行存在问题 这可能和编译有关

需要调整后 重新编译ocrcheck 相关的对象

回复 只看该作者 道具 举报

15#
发表于 2012-5-3 19:30:24
你在 12楼的描述 是

./ocrcheck
Segmentation fault


为什么到了 13楼 ocrcheck 又可以正常运行了?


请保持 帖子内容的逻辑性

回复 只看该作者 道具 举报

16#
发表于 2012-5-3 19:32:40
12楼是用root用户执行的,
13楼是oracle 用户执行的!!
sorry!!

回复 只看该作者 道具 举报

17#
发表于 2012-5-3 19:59:15
继续等待ing....

回复 只看该作者 道具 举报

18#
发表于 2012-5-3 20:16:07
尝试修改 root.sh

cp root102.sh  root102_mod.sh

修改 root102_mod.sh

找到 $CH/bin/ocrcheck > /dev/null 2>&1  的语句   在前面加入 #  注释掉这一行


重新运行

su - root
./root102_mod.sh

回复 只看该作者 道具 举报

19#
发表于 2012-5-3 20:42:00
[root@shzckdb01 install]# ./root102_mod.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
Preparing to recopy patched init and RC scripts.
Recopying init and RC scripts.
Startup will be queued to init within 30 seconds.
-bash: line 1: 12340 段错误               /opt/ora10g/product/10.2.0/crs_1/bin/crsctl check boot > /tmp/crsctl.12161
-bash: line 1: 12375 段错误               /opt/ora10g/product/10.2.0/crs_1/bin/crsctl check boot > /tmp/crsctl.12161
-bash: line 1: 12409 段错误               /opt/ora10g/product/10.2.0/crs_1/bin/crsctl check boot > /tmp/crsctl.12161
-bash: line 1: 12444 段错误               /opt/ora10g/product/10.2.0/crs_1/bin/crsctl check boot > /tmp/crsctl.12161
-bash: line 1: 12479 段错误               /opt/ora10g/product/10.2.0/crs_1/bin/crsctl check boot > /tmp/crsctl.12161
-bash: line 1: 12513 段错误               /opt/ora10g/product/10.2.0/crs_1/bin/crsctl check boot > /tmp/crsctl.12161
-bash: line 1: 12548 段错误               /opt/ora10g/product/10.2.0/crs_1/bin/crsctl check boot > /tmp/crsctl.12161
-bash: line 1: 12615 段错误               /opt/ora10g/product/10.2.0/crs_1/bin/crsctl check boot > /tmp/crsctl.12161

回复 只看该作者 道具 举报

20#
发表于 2012-5-3 21:09:31
实际测试发现 在Oracle Enterprise Linux  5.7 上使用 gcc 4.1.2 ,未作任何修改 ,也能正确安装 10.2.0.1 CRS



[root@vrh3 rootpre]# cat /etc/issue
Oracle Linux Server release 5.7
Kernel \r on an \m

[root@vrh3 rootpre]# gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-51)



[root@vrh3 rootpre]# /home/oracle/oraInventory/orainstRoot.sh









Changing permissions of /home/oracle/oraInventory to 770.
Changing groupname of /home/oracle/oraInventory to oinstall.
The execution of the script is complete



[root@vrh3 rootpre]# /s01/crs/root.sh
WARNING: directory '/s01' 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
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/s01' is not owned by root
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node <nodenumber>: <nodename> <private interconnect name> <hostname>
node 1: vrh3 vrh3-priv vrh3
node 2: vrh4 vrh4-priv vrh4
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.
        vrh3
CSS is inactive on these nodes.
        vrh4
Local node checking complete.
Run root.sh on remaining nodes to start CRS daemons.

[root@vrh4 ~]# /s01/crs/root.sh
WARNING: directory '/s01' 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
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/s01' is not owned by root
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node <nodenumber>: <nodename> <private interconnect name> <hostname>
node 1: vrh3 vrh3-priv vrh3
node 2: vrh4 vrh4-priv vrh4
clscfg: Arguments check out successfully.

NO KEYS WERE WRITTEN. Supply -force parameter to override.
-force is destructive and will destroy any previous cluster
configuration.
Oracle Cluster Registry for cluster has already been initialized
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.
        vrh3
        vrh4
CSS is active on all nodes.
Waiting for the Oracle CRSD and EVMD to start
Oracle CRS stack installed and running under init(1M)
Running vipca(silent) for configuring nodeapps
/s01/crs/jdk/jre//bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory


root.sh 正常运行

稍后2天会上传 安装视频 , 建议你之后按照 视频步骤 重现安装 , 或者 直接使用 RHEL 或 OEL 4 避免 不兼容造成的安装问题。

回复 只看该作者 道具 举报

21#
发表于 2012-5-3 21:16:26
我在实际环境中和你安装的效果一样,即10.2.0.1 CRS在这个版本上是能安装的。现在就是在升级CRS到10.2.0.5的时候出来这个错误!难道我这么衰,就是不兼容的问题!还是什么bug之类的,真是郁闷到家了!!

回复 只看该作者 道具 举报

22#
发表于 2012-5-3 21:20:22
还有昨天改了gcc了!

[root@shzckdb01 install]# gcc -v
从 /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs 读取 specs
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,f77 --disable-libgcj --host=x86_64-redhat-linux
线程模型:posix
gcc 版本 3.4.6 20060404 (Red Hat 3.4.6-4.1)

回复 只看该作者 道具 举报

23#
发表于 2012-5-3 21:30:13
OEL 5.7 上 CRS 从 10.2.0.1 升级到 10.2.0.5

[root@vrh4 ~]# cat /etc/issue
Oracle Linux Server release 5.7
Kernel \r on an \m


[root@vrh3 ~]# /s01/crs/install/root102.sh
Creating pre-patch directory for saving pre-patch clusterware files
Completed patching clusterware files to /s01/crs
Relinking some shared libraries.
Relinking of patched files is complete.
WARNING: directory '/s01' is not owned by root
Preparing to recopy patched init and RC scripts.
Recopying init and RC scripts.
Startup will be queued to init within 30 seconds.
Starting up the CRS daemons.
Waiting for the patched CRS daemons to start.
  This may take a while on some systems.
.
10205 patch successfully applied.
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Successfully deleted 1 values from OCR.
Successfully deleted 1 keys from OCR.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node <nodenumber>: <nodename> <private interconnect name> <hostname>
node 1: vrh3 vrh3-priv vrh3
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
clscfg -upgrade completed successfully
Creating '/s01/crs/install/paramfile.crs' with data used for CRS configuration
Setting CRS configuration values in /s01/crs/install/paramfile.cr











[root@vrh4 ~]# /s01/crs/install/root102.sh
Creating pre-patch directory for saving pre-patch clusterware files
Completed patching clusterware files to /s01/crs
Relinking some shared libraries.
Relinking of patched files is complete.
WARNING: directory '/s01' is not owned by root
Preparing to recopy patched init and RC scripts.
Recopying init and RC scripts.
Startup will be queued to init within 30 seconds.
Starting up the CRS daemons.
Waiting for the patched CRS daemons to start.
  This may take a while on some systems.
.
10205 patch successfully applied.
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Successfully deleted 1 values from OCR.
Successfully deleted 1 keys from OCR.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node <nodenumber>: <nodename> <private interconnect name> <hostname>
node 2: vrh4 vrh4-priv vrh4
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
clscfg -upgrade completed successfully
Creating '/s01/crs/install/paramfile.crs' with data used for CRS configuration
Setting CRS configuration values in /s01/crs/install/paramfile.crs/install/paramfile



[root@vrh4 ~]# /s01/crs/bin/crsctl query crs activeversion
CRS active version on the cluster is [10.2.0.5.0]


顺利执行root102.sh

这和 bug 或 运气应当没有关系,建议你 参照文档 规范安装 CRS  可以参考 资料版的

Step By Step guide for installing Oracle RAC 10gR2 On Linux 文档
http://t.askmaclean.com/thread-889-1-1.html

回复 只看该作者 道具 举报

24#
发表于 2012-5-4 14:39:03
已更新
【视频教学】Maclean手把手教你用Vbox在Enterprise Linux 5上安装Oracle 10gR2 RAC数据库
http://t.askmaclean.com/thread-891-1-1.html

回复 只看该作者 道具 举报

25#
发表于 2012-5-4 15:18:56
我的问题,我今天突然想了一个笨办法解决了!!嘿嘿。
就是我把第一个节点上的$CRS_HOME/bin 和lib 两个目录 拷贝到第二个节点 上,然后在第二个节点上重新运行root102.sh,奇迹出现了,竟然通过了!!O(∩_∩)O哈哈~。

不过还是要感谢maclean,谢谢你耐心的指导!

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-12-25 12:44 , Processed in 0.060489 second(s), 24 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569