oinstall組使用者連線資料庫報錯error while loading shared libraries: libskgxp10.so

yangtingkun發表於2012-03-18

名稱很長,不過仍然不足以描述這個錯誤的背景。確切的描述應該是oracle使用者下的ORACLE_HOME,遷移到其他位置,並將oracle屬主改變為其他使用者,但是oinstall組未變。隨後其他oinstall組使用者,無法以/ as sysdba登入資料庫。

 

 

公司測試環境,ORACLE_HOME/u01/app/oracle/product/10.2.0/db_1,將ORACLE_HOME切換到/t0/orat0/app/oracle/product/10.2.0/db_1目錄下,並將ORACLE_HOME的屬主從oracle改為orat0

授權後,orat0使用者直接登入就出現這個錯誤:

[orat0@hpserver2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Sun Mar 18 16:12:03 2012

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

oracleorcl10g: error while loading shared libraries: libskgxp10.so: cannot open shared object file: No such file or directory
ERROR:
ORA-12547: TNS:lost contact

Enter user-name:
oracleorcl10g: error while loading shared libraries: libskgxp10.so: cannot open shared object file: No such file or directory
ERROR:
ORA-12547: TNS:lost contact

Enter user-name:
oracleorcl10g: error while loading shared libraries: libskgxp10.so: cannot open shared object file: No such file or directory
ERROR:
ORA-12547: TNS:lost contact

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[orat0@hpserver2 ~]$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib
[orat0@hpserver2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Sun Mar 18 16:12:18 2012

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

在設定了LD_LIBRARY_PATH後,問題得以解決。但是對於除了ORACLE_HOMEOWNER外的其他oinstall使用者,登入資料庫就會出現同樣的錯誤。即使設定LD_LIBRARY_PATH也不起作用。

檢查後發現ORACLE_HOME/bin/oracle許可權改變:

[tingkun.yang@hpserver2 bin]$ ls -l oracle
-rwxr-x--x 1 tingkun.yang oinstall 125153012 Feb 7 18:37 oracle
[tingkun.yang@hpserver2 bin]$ chmod 6751 oracle

修改檔案屬性後,問題依舊。

[tingkun.yang@hpserver2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Mon Mar 19 16:45:26 2012

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

oracleorcl10g: error while loading shared libraries: libskgxp10.so: cannot open shared object file: No such file or directory
ERROR:
ORA-12547: TNS:lost contact


Enter user-name:
oracleorcl10g: error while loading shared libraries: libskgxp10.so: cannot open shared object file: No such file or directory
ERROR:
ORA-12547: TNS:lost contact


Enter user-name:
oracleorcl10g: error while loading shared libraries: libskgxp10.so: cannot open shared object file: No such file or directory
ERROR:
ORA-12547: TNS:lost contact


SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

最終懷疑是ORACLE_HOME發生變化後,某些連結庫的位置改變,導致Oracle執行過程中找不到一些庫檔案,於是以owner身份對ORACLE_HOME進行了relink all的操作:

[orat0@hpserver2 lib]$ relink all
/t0/orat0/app/oracle/product/10.2.0/db_1/bin/genclntsh
/t0/orat0/app/oracle/product/10.2.0/db_1/bin/genagtsh /t0/orat0/app/oracle/product/10.2.0/db_1/lib/libagtsh.so 1.0
make -f /t0/orat0/app/oracle/product/10.2.0/db_1/precomp/lib/ins_precomp.mk relink EXENAME=proc
make[1]: Entering directory `/t0/orat0/app/oracle/product/10.2.0/db_1/lib32'
Linking /t0/orat0/app/oracle/product/10.2.0/db_1/precomp/lib/proc
rm -f /t0/orat0/app/oracle/product/10.2.0/db_1/bin/proc
mv /t0/orat0/app/oracle/product/10.2.0/db_1/precomp/lib/proc /t0/orat0/app/oracle/product/10.2.0/db_1/bin/
make[1]: Leaving directory `/t0/orat0/app/oracle/product/10.2.0/db_1/lib32'
rm -f ldapadd ldapbind ldapcompare ldapdelete ldapmodify ldapsearch ldapmoddn ldapaddmt ldapmodifymt dsml2ldif
gcc -o ldapadd -L/t0/orat0/app/oracle/product/10.2.0/db_1/ldap/lib/ -L/t0/orat0/app/oracle/product/10.2.0/db_1/lib/ -L/t0/orat0/app/oracle/product/10.2.0/db_1/lib/stubs/ -o ldapadd -L/t0/orat0/app/oracle/product/10.2.0/db_1/ldap/lib/ -L/t0/orat0/app/oracle/product/10.2.0/db_1/lib/ -L/t0/orat0/app/oracle/product/10.2.0/db_1/lib/stubs/ /t0/orat0/app/oracle/product/10.2.0/db_1/ldap/lib/s0gslmod.o /t0/orat0/app/oracle/product/10.2.0/db_1/ldap/lib/gslmcu.o -lncrypt10 /t0/orat0/app/oracle/product/10.2.0/db_1/lib/libldapclnt10.a -lldapclnt10 -lncrypt10 -lclntsh `cat /t0/orat0/app/oracle/product/10.2.0/db_1/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /t0/orat0/app/oracle/product/10.2.0/db_1/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /t0/orat0/app/oracle/product/10.2.0/db_1/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /t0/orat0/app/oracle/product/10.2.0/db_1/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /t0/orat0/app/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm -Wl,-rpath,/t0/orat0/app/oracle/product/10.2.0/db_1/lib
gcc -o ldapbind -L/t0/orat0/app/oracle/product/10.2.0/db_1/ldap/lib/ -L/t0/orat0/app/oracle/product/10.2.0/db_1/lib/ -L/t0/orat0/app/oracle/product/10.2.0/db_1/lib/stubs/ -o ldapbind -L/t0/orat0/app/oracle/product/10.2.0/db_1/ldap/lib/ -L/t0/orat0/app/oracle/product/10.2.0/db_1/lib/ -L/t0/orat0/app/oracle/product/10.2.0/db_1/lib/stubs/ /t0/orat0/app/oracle/product/10.2.0/db_1/ldap/lib/s0gslbind.o /t0/orat0/app/oracle/product/10.2.0/db_1/ldap/lib/gslmcu.o -lncrypt10 /t0/orat0/app/oracle/product/10.2.0/db_1/lib/libldapclnt10.a -lldapclnt10 -lncrypt10 -lclntsh `cat /t0/orat0/app/oracle/product/10.2.0/db_1/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /t0/orat0/app/oracle/product/10.2.0/db_1/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /t0/orat0/app/oracle/product/10.2.0/db_1/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /t0/orat0/app/oracle/product/10.2.0/db_1/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /t0/orat0/app/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm -Wl,-rpath,/t0/orat0/app/oracle/product/10.2.0/db_1/lib
.
.
.
- Linking OCR check utility tool
gcc -o ocrcheck -L/t0/orat0/app/oracle/product/10.2.0/db_1//lib/ -L/t0/orat0/app/oracle/product/10.2.0/db_1/lib/ -L/t0/orat0/app/oracle/product/10.2.0/db_1/lib/stubs/ /t0/orat0/app/oracle/product/10.2.0/db_1/srvm/lib/sprotch.o /t0/orat0/app/oracle/product/10.2.0/db_1/srvm/lib/protchek.o /t0/orat0/app/oracle/product/10.2.0/db_1/srvm/lib/prot.o -locr10 -locrb10 -locrutl10 -lhasgen10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclntsh -lskgxn2 -lcore10 `cat /t0/orat0/app/oracle/product/10.2.0/db_1/lib/sysliblist` -lclntsh `cat /t0/orat0/app/oracle/product/10.2.0/db_1/lib/sysliblist` -Wl,-rpath,/t0/orat0/app/oracle/product/10.2.0/db_1/lib -lm `cat /t0/orat0/app/oracle/product/10.2.0/db_1/lib/sysliblist` -lm -lm -L/t0/orat0/app/oracle/product/10.2.0/db_1/lib
mv -f /t0/orat0/app/oracle/product/10.2.0/db_1/bin/ocrcheck /t0/orat0/app/oracle/product/10.2.0/db_1/bin/ocrcheck0
mv ocrcheck /t0/orat0/app/oracle/product/10.2.0/db_1/bin/ocrcheck

- Linking OIFCFG tool
gcc -o oifcfg -L/t0/orat0/app/oracle/product/10.2.0/db_1//lib/ -L/t0/orat0/app/oracle/product/10.2.0/db_1/lib/ -L/t0/orat0/app/oracle/product/10.2.0/db_1/lib/stubs/ /t0/orat0/app/oracle/product/10.2.0/db_1/srvm/lib/prifcg.o /t0/orat0/app/oracle/product/10.2.0/db_1/srvm/lib/sprifcg.o /t0/orat0/app/oracle/product/10.2.0/db_1/srvm/lib/prifutl.o /t0/orat0/app/oracle/product/10.2.0/db_1/srvm/lib/prifcmn.o -lcore10 -lhasgen10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -locr10 -locrb10 -locrutl10 -lhasgen10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclntsh -lskgxn2 -lcore10 `cat /t0/orat0/app/oracle/product/10.2.0/db_1/lib/sysliblist` -lclntsh -lclntsh -lskgxn2 `cat /t0/orat0/app/oracle/product/10.2.0/db_1/lib/sysliblist` -lm `cat /t0/orat0/app/oracle/product/10.2.0/db_1/lib/sysliblist` -lm -lm -L/t0/orat0/app/oracle/product/10.2.0/db_1/lib
mv -f /t0/orat0/app/oracle/product/10.2.0/db_1/bin/oifcfg /t0/orat0/app/oracle/product/10.2.0/db_1/bin/oifcfg0
mv oifcfg /t0/orat0/app/oracle/product/10.2.0/db_1/bin/oifcfg
chmod 755 /t0/orat0/app/oracle/product/10.2.0/db_1/bin
make -f /t0/orat0/app/oracle/product/10.2.0/db_1/sysman/lib/ins_emdb.mk relink_exe EXENAME=nmccollector
make[1]: Entering directory `/t0/orat0/app/oracle/product/10.2.0/db_1/sysman/lib'
/usr/bin/gcc -trigraphs -fPIC -o /t0/orat0/app/oracle/product/10.2.0/db_1/sysman/lib/nmccollector -L/t0/orat0/app/oracle/product/10.2.0/db_1/sysman//lib -L/t0/orat0/app/oracle/product/10.2.0/db_1/lib -L/t0/orat0/app/oracle/product/10.2.0/db_1/lib/stubs -Wl,-export-dynamic /t0/orat0/app/oracle/product/10.2.0/db_1/sysman//lib/snmccolm.o /t0/orat0/app/oracle/product/10.2.0/db_1/sysman//lib/libnmccol.a /t0/orat0/app/oracle/product/10.2.0/db_1/sysman//lib/libnmcbuf.a /t0/orat0/app/oracle/product/10.2.0/db_1/sysman//lib/libnmadbg.a /t0/orat0/app/oracle/product/10.2.0/db_1/rdbms//lib/libdsga10.a /t0/orat0/app/oracle/product/10.2.0/db_1/lib/libserver10.a /t0/orat0/app/oracle/product/10.2.0/db_1/lib/libclntsh.so
mv -f /t0/orat0/app/oracle/product/10.2.0/db_1/bin/nmccollector /t0/orat0/app/oracle/product/10.2.0/db_1/bin/nmccollector0
mv /t0/orat0/app/oracle/product/10.2.0/db_1/sysman/lib/nmccollector /t0/orat0/app/oracle/product/10.2.0/db_1/bin/
make[1]: Leaving directory `/t0/orat0/app/oracle/product/10.2.0/db_1/sysman/lib'
Enterprise Manager Direct Memory Access Collector relinked

重新連結後問題解決:

[tingkun.yang@hpserver2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Mon Mar 19 18:25:09 2012

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

 

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

相關文章