且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

【Oracle】安装完oracle 9i,执行sqlplus 遇到Segmentation Fault

更新时间:2022-08-19 22:00:36

安装完成oracle 9.2.0.4之后,执行sqlplus 命令时遇到Segmentation Fault 错误,查询 Metalink 是一个bug:Segmentation Fault When Execute Sqlplus, Oracle, Lsnrctl After New/Patchset Install [ID 316746.1]
对于新安装的软件或者打过补丁的oracle数据库(9.2.0.1 to 10.1.0.2,for Linux x86,Linux x86-64)都可能遇到此bug
原因是:
The gcc/g++ compilers in /usr/bin are a script. (with additional parameters)which caused an incorrect compilation.
make.log shows this incorrect compilation:
/tpp/oracle/920/bin/genclntsh
/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/crtbeginS.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/crtendS.o' is incompatible with i386:x86-64 output.
解决办法:
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
我的步骤如下:
以root用户做如下操作:
root@rac1:/opt/oracle/products/9.2.0#cd /usr/bin
root@rac1:/usr/bin#mv gcc gcc.sript
root@rac1:/usr/bin#mv gcc.sript gcc.script
root@rac1:/usr/bin#mv g++ g++.script
root@rac1:/usr/bin#ln -s gcc32 gcc
root@rac1:/usr/bin#ln -s g++32 g++
以oracle用户
oracle@rac1:/home/oracle>cd $ORACLE_HOME/bin
oracle@rac1:/opt/oracle/products/9.2.0/bin>relink all
cp: cannot stat `/DISCARD/': No such file or directory
ar: creating /opt/oracle/products/9.2.0/lib/libclntst9.a
Created /opt/oracle/products/9.2.0/lib/libclntst9.a
cp: cannot stat `/DISCARD/': No such file or directory
ar: creating /opt/oracle/products/9.2.0/lib32/libclntst9.a
Created /opt/oracle/products/9.2.0/lib32/libclntst9.a
/opt/oracle/products/9.2.0/bin/genagtsh /opt/oracle/products/9.2.0/lib/libagtsh.so 1.0
Linking /opt/oracle/products/9.2.0/precomp/lib/proc
rm -f /opt/oracle/products/9.2.0/bin/proc
mv /opt/oracle/products/9.2.0/precomp/lib/proc /opt/oracle/products/9.2.0/bin/
- Linking Import utility (imp)
- Linking Export utility (exp)
- Linking SQL*Loader utility (sqlldr)
- Linking performance trace utility (tkprof)
- Linking recovery manager (rman)
- Linking PSP Loader utility (loadpsp)
- Linking otrcfmt
- Linking otrcrep
- Linking otrccol 
- Linking otrccref
- Linking sqlplus
- Linking wrap
- Linking /opt/oracle/products/9.2.0/bin/tnslsnr   
- Linking Oracle 
- Linking database file size utility (dbfsize)
 ....省略...
- Linking SGA Dump Utility (mapsga)
- Linking cursor size utility (cursize)
 ....省略...
 
oracle@rac1:/opt/oracle/products/9.2.0/bin>sqlplus "/as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Fri Nov 25 19:49:30 2011
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
Connected to an idle instance.
SQL> exit