日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

解决sqlplus的segmentation fault或hang问题

發(fā)布時間:2025/7/14 编程问答 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 解决sqlplus的segmentation fault或hang问题 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
sqlplus應(yīng)當是DBA 1.0時代使用最為頻繁的管理工具,經(jīng)常有經(jīng)驗豐富的老DBA會提到自己敲過幾萬次的sqlplus:),但有的時候這個吃飯家伙也會不好用,偶爾還會出現(xiàn)Segmentation fault錯誤,亦或者徹底hang住。在這里我介紹幾種應(yīng)對sqlplus無法正常使用的應(yīng)對方法: 1.出現(xiàn)Segmentation fault,這種情況下一般是sqlplus 2進制文件被損壞了,可以通過重新build一個sqlplus來解決問題 [oracle@rh2 bin]$ sqlplus Segmentation fault/* 使用$ORACLE_HOME/sqlplus/lib目錄下的make文件,編譯一個新的sqlplus */[oracle@rh2 ~]$ make -f $ORACLE_HOME/sqlplus/lib/ins_sqlplus.mk newsqlplusLinking /s01/oracle/product/11.2.0/dbhome_1/sqlplus/bin/sqlplus rm -f /s01/oracle/product/11.2.0/dbhome_1/sqlplus/bin/sqlplus gcc -o /s01/oracle/product/11.2.0/dbhome_1/sqlplus/bin/sqlplus -m64 -L/s01/oracle/product/11.2.0/dbhome_1/sqlplus/lib/ -L/s01/oracle/product/11.2.0/dbhome_1/lib/ -L/s01/oracle/product/11.2.0/dbhome_1/lib/stubs/ /s01/oracle/product/11.2.0/dbhome_1/sqlplus/lib/s0afimai.o -lsqlplus -lclntsh `cat /s01/oracle/product/11.2.0/dbhome_1/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnro11 `cat /s01/oracle/product/11.2.0/dbhome_1/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnnz11 -lzt11 -lztkg11 -lztkg11 -lclient11 -lnnetd11 -lvsn11 -lcommon11 -lgeneric11 -lmm -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11 `cat /s01/oracle/product/11.2.0/dbhome_1/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lnro11 `cat /s01/oracle/product/11.2.0/dbhome_1/lib/ldflags` -lncrypt11 -lnsgr11 -lnzjs11 -ln11 -lnl11 -lclient11 -lnnetd11 -lvsn11 -lcommon11 -lgeneric11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11 -lclient11 -lnnetd11 -lvsn11 -lcommon11 -lgeneric11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11 `cat /s01/oracle/product/11.2.0/dbhome_1/lib/sysliblist` -Wl,-rpath,/s01/oracle/product/11.2.0/dbhome_1/lib -lm -lpthread `cat /s01/oracle/product/11.2.0/dbhome_1/lib/sysliblist` -ldl -lm -lpthread -L/s01/oracle/product/11.2.0/dbhome_1/lib /bin/chmod 755 /s01/oracle/product/11.2.0/dbhome_1/sqlplus/bin/sqlplus rm -f /s01/oracle/product/11.2.0/dbhome_1/bin/sqlplus mv -f /s01/oracle/product/11.2.0/dbhome_1/sqlplus/bin/sqlplus /s01/oracle/product/11.2.0/dbhome_1/bin/sqlplus /bin/chmod 751 /s01/oracle/product/11.2.0/dbhome_1/bin/sqlplus rm -f /s01/oracle/product/11.2.0/dbhome_1/sqlplus/lib/libsqlplus.so rm -rf /s01/oracle/product/11.2.0/dbhome_1/sqlplus/bin/sqlplus[oracle@rh2 ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.2.0 Production on Wed May 11 21:38:21 2011Copyright (c) 1982, 2010, Oracle. All rights reserved.Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options 2.出現(xiàn)sqlplus之后hang住的現(xiàn)象,hang的原因存在多種可能: 1)instance hanging數(shù)據(jù)庫實例hang住,這種情況下sqlplus無法正常登陸到正hang的實例,而登陸到其他實例是可以的;若在10g以后版本中可以使用-prelim選項登陸實例,使用該選項登陸后無法執(zhí)行普通的SQL語句,但可以使用oradebug內(nèi)部調(diào)試工具,通過oradebug收集必要的hanganalyze信息后,可以進一步判斷hang住的原因并決定下一步的操作。 [oracle@rh2 ~]$ sqlplus / as sysdba .............................we suspend here!!![oracle@rh2 ~]$ sqlplus -prelim / as sysdbaSQL*Plus: Release 11.2.0.2.0 Production on Wed May 11 21:46:27 2011Copyright (c) 1982, 2010, Oracle. All rights reserved.SQL> oradebug setmypid; Statement processed.SQL> oradebug dump hanganalyze 4; Statement processed.SQL> oradebug dump systemstate 266; Statement processed.SQL> oradebug tracefile_name/s01/orabase/diag/rdbms/prod/PROD1/trace/PROD1_ora_23436.trc -- where dump resides 將以上trc文件提交給Oracle Support或者資深的Oracle技術(shù)人員,以便他們分析出實例hang住的原因,通過調(diào)整參數(shù)或者修復bug可以避免再次出現(xiàn)類似的狀況。 2)一執(zhí)行sqlplus就出現(xiàn)掛起現(xiàn)象,甚至沒有登陸任何數(shù)據(jù)庫。一般這種情況是在讀取sqlplus 2進制文件或其相關(guān)的共享庫文件(.so文件)時遇到了問題,或者是在實際system call系統(tǒng)調(diào)用execve("sqlplus")時遇到了錯誤,一般我們可以使用系統(tǒng)跟蹤工具strace(Linux)或truss(Unix)工具來分析這種掛起現(xiàn)象: /* Unix */truss -o sqlplus_hang.log sqlplus/* Linux */strace -o sqlplus_hang.log sqlplushead -10 sqlplus_hang.logexecve("/s01/db_1/bin/sqlplus", ["sqlplus"], [/* 28 vars */]) = -1 ENOEXEC (Exec format error) 可以看到以上strace記錄中發(fā)現(xiàn)了調(diào)用execve函數(shù)(execve() executes the program pointed to by filename)運行sqlplus程序時出現(xiàn)了ENOEXEC錯誤,該ENOEXEC錯誤代碼說明我們正在執(zhí)行一個格式無效的可執(zhí)行文件,具體的解釋如下: This error indicates that a request has been made to execute a file which, although it has the appropriate permissions, does not start with a valid magic number. A magic number is the first two bytes in a file, used to determine what type of file it is.You tried to execute a file that is not in a valid executable format. The most common format for binary programs under linux is called ELF. Note that your shell will run ascii files that have the executable bit set as a shell script (ie run it as shell commands).You can reproduce this by doing$ dd if=/dev/random of=myfile bs=1k count=1 $ chmod +x myfile $ ./myfile zsh: exec format error: ./myfileNote that there is a very slight possibility that you could create a valid program that does something bad to your system!! Note, you can have user defined ways of running programs using Linux's binfmt_misc. See/usr/src/linux/Documentation/binfmt_misc.txt to be continued ............

轉(zhuǎn)載于:https://www.cnblogs.com/macleanoracle/archive/2013/03/19/2967767.html

《新程序員》:云原生和全面數(shù)字化實踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀

總結(jié)

以上是生活随笔為你收集整理的解决sqlplus的segmentation fault或hang问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。