sqlplus"strace: exec: Exec format error"故障處理

super_sky發表於2014-01-06
系統:RHEL5.6 64位
安裝過程使用的是靜默方式。
現象:
今天把新安裝的資料庫從10.2.0.1 後升級到10.2.0.5後,執行sqlplus命令,沒有任何反應
[oracle@icsts ~]$ 
[oracle@icsts ~]$ sqlplus / as sysdba
[oracle@icsts ~]$ 
使用strace命令跟中了一下
[oracle@icsts ~]$ strace sqlplus / as sysdba
execve("/u01/app/oracle/product/10.2.0/db_1/bin/sqlplus", ["sqlplus", "/", "as", "sysdba"], [/* 24 vars */]) = -1 ENOEXEC (Exec format error)
dup(2)                                  = 3
fcntl(3, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b477c352000
lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
write(3, "strace: exec: Exec format error\n", 32strace: exec: Exec format error
) = 32
close(3)                                = 0
munmap(0x2b477c352000, 4096)            = 0
exit_group(1)                           = ?
[oracle@icsts ~]$ 
出現exec:Exec format error錯誤。
從安裝日誌中,可以看到大量如下錯誤,錯誤的格式基本是一直的,可以判斷這個問題基本出現在系統包上。
[oracle@icsts ~]$ more /u01/app/oracle/oraInventory/logs/silentInstall2014-01-06_05-23-47PM.log
silentInstall2014-01-06_05-23-47PM.log
Error in invoking target 'nnfgt.o' of makefile '/u01/app/oracle/product/10.2.0/db_1/network/lib/ins_net_client.mk'. See '/u01/app/oracle/oraInventory/logs/i
nstallActions2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'nnfgt.o' of makefile '/u01/app/oracle/product/10.2.0/db_1/network/lib/ins_net_client.mk'. See '/u01/app/oracle/oraInventory/logs/i
nstallActions2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'relink' of makefile '/u01/app/oracle/product/10.2.0/db_1/precomp/lib/ins_precomp.mk'. See '/u01/app/oracle/oraInventory/logs/insta
llActions2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'ioracle' of makefile '/u01/app/oracle/product/10.2.0/db_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oracle/oraInventory/logs/installA
ctions2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'agent oratclsh nmo nmb' of makefile '/u01/app/oracle/product/10.2.0/db_1/sysman/lib/ins_sysman.mk'. See '/u01/app/oracle/oraInvent
ory/logs/installActions2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'collector dbfetchlets' of makefile '/u01/app/oracle/product/10.2.0/db_1/sysman/lib/ins_emdb.mk'. See '/u01/app/oracle/oraInventory
/logs/installActions2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'utilities irman' of makefile '/u01/app/oracle/product/10.2.0/db_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oracle/oraInventory/logs/
installActions2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'install' of makefile '/u01/app/oracle/product/10.2.0/db_1/plsql/lib/ins_plsql.mk'. See '/u01/app/oracle/oraInventory/logs/installA
ctions2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'install' of makefile '/u01/app/oracle/product/10.2.0/db_1/ctx/lib/ins_ctx.mk'. See '/u01/app/oracle/oraInventory/logs/installActio
ns2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'nnfgt.o mkldflags' of makefile '/u01/app/oracle/product/10.2.0/db_1/network/lib/ins_net_client.mk'. See '/u01/app/oracle/oraInvent
ory/logs/installActions2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'install' of makefile '/u01/app/oracle/product/10.2.0/db_1/network/lib/ins_net_server.mk'. See '/u01/app/oracle/oraInventory/logs/i
nstallActions2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'install ntcontab.o nnfgt.o' of makefile '/u01/app/oracle/product/10.2.0/db_1/network/lib/ins_net_client.mk'. See '/u01/app/oracle/
oraInventory/logs/installActions2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'ioklist iokinit iokdstry' of makefile '/u01/app/oracle/product/10.2.0/db_1/network/lib/ins_nau.mk'. See '/u01/app/oracle/oraInvent
ory/logs/installActions2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'clientonlyinstall' of makefile '/u01/app/oracle/product/10.2.0/db_1/ldap/lib/ins_ldap.mk'. See '/u01/app/oracle/oraInventory/logs/
installActions2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'install' of makefile '/u01/app/oracle/product/10.2.0/db_1/srvm/lib/ins_srvm.mk'. See '/u01/app/oracle/oraInventory/logs/installAct
ions2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'racg_install' of makefile '/u01/app/oracle/product/10.2.0/db_1/racg/lib/ins_has.mk'. See '/u01/app/oracle/oraInventory/logs/instal
lActions2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'install' of makefile '/u01/app/oracle/product/10.2.0/db_1/sqlplus/lib/ins_sqlplus.mk'. See '/u01/app/oracle/oraInventory/logs/inst
allActions2014-01-06_05-23-47PM.log' for details.
Error in invoking target 'all_no_orcl ihsodbc32' of makefile '/u01/app/oracle/product/10.2.0/db_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oracle/oraInventory
/logs/installActions2014-01-06_05-23-47PM.log' for details.
WARNING: 
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root script to run
/u01/app/oracle/product/10.2.0/db_1/root.sh
To execute the configuration scripts:
    1. Open a terminal window
    2. Log in as "root"
    3. Run the scripts
The installation of Oracle Database 10g Release 2 Patch Set 4 was successful.
檢查下列系統包是否安裝,要是在64位作業系統中需要注意32位包的安裝問題。我檢查發現glibc-devel-2.5 (32 bit)包沒有安裝。
系統包的檢查可以使用rpm -q gcc來檢查,也可以使用rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}\n'|egrep 'glibc-devel' 來檢查。
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (32 bit)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-2.5-24 (32 bit)
glibc-common-2.5
glibc-devel-2.5
glibc-devel-2.5 (32 bit)
glibc-headers-2.5
ksh-20060214
libaio-0.3.106
libaio-0.3.106 (32 bit)
libaio-devel-0.3.106
libaio-devel-0.3.106 (32 bit)
libgcc-4.1.2
libgcc-4.1.2 (32 bit)
libstdc++-4.1.2
libstdc++-4.1.2 (32 bit)
libstdc++-devel 4.1.2
make-3.81
sysstat-7.0.2
使用下面命令安裝glibc-devel 32位包。
[oracle@icsts ~]$ rpm -ivh glibc-devel-2.5-58.i386.rpm
然後根據下列命令來修改資料庫軟體
Try to relink the oracle client
cd $ORACLE_HOME/network/lib
make -f ins_net_client.mk nnfgt.o
make -f ins_net_client.mk ntcontab.o
make -f ins_net_client.mk client_sharedlib
make -f ins_net_client.mk install
cd $ORACLE_HOME/sqlplus/lib
make -f ins_sqlplus.mk install
cd $ORACLE_HOME/bin
relink client
執行完後,sqlplus命令可以使用了
[oracle@icsts ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Mon Jan 6 21:42:27 2014
Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
ERROR:
ORA-12547: TNS:lost contact
Enter user-name: 
下面就是解決ORA-12547: TNS:lost contact的問題了。
檢查$ORACLE_HOME/bin/oracle許可權
[oracle@icsts ~]$ cd $ORACLE_HOME/bin
[oracle@icsts bin]$ ll oracle
-rwxr-x--- 1 oracle oinstall 0 Apr 20  2010 oracle
[oracle@icsts bin]$ chmod 6751 oracle
[oracle@icsts bin]$ ll oracle
-rwsr-s--x 1 oracle oinstall 0 Apr 20  2010 oracle
[oracle@icsts bin]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Mon Jan 6 21:44:15 2014
Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
ERROR:
ORA-12547: TNS:lost contact
Enter user-name: 
執行relink all 
執行後,該問題解決,可以使用sqlplus 登入資料庫了。
[oracle@icsts ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Mon Jan 6 21:58:14 2014
Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
Connected to an idle instance.
SQL> 

參考文件:
Install/Clone 32-bit 11GR2 Client On Linux x86_64 Fails With Error In Invoking Target 'Mkldflags ntcontab.o nnfgt.o' Of Makefile ins_net_client.mk (文件 ID 1473421.1)
Troubleshooting ORA-12547 TNS: Lost Contact (文件 ID 555565.1)
Error In Invoking Target Ntcontab.o Of Makefile Ins_net_client.Mk' (文件 ID 341621.1)


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/11590946/viewspace-1067685/,如需轉載,請註明出處,否則將追究法律責任。

相關文章