今天在linux 64位(Linux machine_name 2.4.21-47.ELsmp #1 SMP Wed Jul 5 20:38:41 EDT 2006 i686 i686 i386 GNU/Linux)的机器上安装了oracle客户端后,输入sqlplus命令后报错segmentation fault(段错误)。
查找$ORACLE_HOME/install/make.log中发现有如下报错信息:
1 2 3 4 5 6 7 8 |
/usr/bin/ld: skipping incompatible /usr/lib/gcc-lib/i386-redhat-linux/2.96/libgcc.a when searching for -lgcc /usr/bin/ld: skipping incompatible /usr/lib/gcc-lib/i386-redhat-linux/2.96/libgcc.a when searching for -lgcc /usr/bin/ld: warning: i386 architecture of input file `/usr/lib/gcc-lib/i386-redhat-linux/2.96/crtbegin.o' is incompatible with i386:x86-64 output /usr/bin/ld: warning: i386 architecture of input file `/usr/lib/gcc-lib/i386-redhat-linux/2.96/crtend.o' is incompatible with i386:x86-64 output mv -f /oracle/product/9.2.0/bin/sqlplus /oracle/product/9.2.0/bin/sqlplusO mv -f /oracle/product/9.2.0/sqlplus/lib/sqlplus /oracle/product/9.2.0/bin/sqlplus /bin/chmod 751 /oracle/product/9.2.0/bin/sqlplus /usr/bin/make -f ins_plsql.mk install ORACLE_HOME=/oracle/product/9.2.0/chmod 755 /oracle/product/9.2.0/bin |
该报错信息是因为在/usr/bin目录下的gcc/g++ compilers是一个文件,引起了在link的时候错误编译。我们可以采用如下的方式解决:
1 2 3 4 5 6 7 8 |
1. cd /usr/bin (as root) 2. mv gcc gcc.script 3. mv g++ g++.script 4. ln -s gcc32 gcc 5. ln -s g++32 g++ 6. login as oracle software owner (make sure environment is correct) 7. cd $ORACLE_HOME/bin 8. relink all |
参考:
Segmentation Fault When Execute Sqlplus, Oracle, Lsnrctl After New/Patchset Install (Doc ID 316746.1)