sqlplus命令無響應,cpu佔用率很高的問題處理
今天準備連線一臺測試伺服器的資料庫,但是遲遲未能連上。直接登入主機,用sqlplus連,一直沒反應。殺掉程式也無法連線sqlplus。
實在搞不清楚為什麼,抱著試試看的心情搜尋了一下,卻發現這是普遍現象。
下面是一篇文章:
根據文中所說的幾個條件,我查了一下本地的情況,伺服器啟動剛剛199天(uptime):
[oracle@DB ~]$ uptime
10:35:46 up 199 days, 53 min, 3 users, load average: 0.05, 0.05, 0.31
文中說從198天起剛好會出現該問題。
資料庫版本是10.2.0.1,又吻合。
然後用strace命令跟蹤了一下:
fcntl64(6, F_SETFD, FD_CLOEXEC) = 0
lseek(6, 0, SEEK_SET) = 0
read(6, "\25\23\"\1\23\3\t\t\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 256) = 256
lseek(6, 512, SEEK_SET) = 512
read(6, "\337y\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
lseek(6, 1024, SEEK_SET) = 1024
read(6, "\25\7'\0072\7>\7j\7\276\17$'\6K5S\24TfT\307T(VsV\222V\6W"..., 86) = 86
times(NULL) = 2148613639
times(NULL) = 2148613639
times(NULL) = 2148613639
times(NULL) = 2148613639
times(NULL) = 2148613639
times(NULL) = 2148613639
times(NULL) = 2148613639
基本確定是bug引起:
事實上只要 x86主機執行天數是是24.8的倍數都有可能引發該bug,因為time()函式值為null,造成無限死迴圈,從而耗盡cpu。
解決辦法有三種:
1、重啟伺服器(治標不治本);
2、資料庫版本升級(比較耗時);
3、打patch;
以下是patch過程:
[oracle@DB packages]$ unzip p4612267_10201_LINUX32bit_198days.zip
Archive: p4612267_10201_LINUX32bit_198days.zip
creating: 4612267/
creating: 4612267/files/
creating: 4612267/files/lib/
creating: 4612267/files/lib/libcore10.a/
inflating: 4612267/files/lib/libcore10.a/sltrg.o
creating: 4612267/etc/
creating: 4612267/etc/config/
inflating: 4612267/etc/config/inventory
inflating: 4612267/etc/config/actions
creating: 4612267/etc/xml/
inflating: 4612267/etc/xml/GenericActions.xml
inflating: 4612267/etc/xml/ShiphomeDirectoryStructure.xml
inflating: 4612267/README.txt
[oracle@DB packages]$ ls
4612267 bbed cx_Oracle-5.1.2 p4612267_10201_LINUX32bit_198days.zip p4612267_10201_Linux-x86-64.zip
[oracle@DB packages]$ cd 4612267/
[oracle@DB 4612267]$ ls
etc files README.txt
[oracle@DB 4612267]$ $ORACLE_HOME/OPatch/opatch apply
Invoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
Oracle Home : /home/oracle/db/product/10.2.0/db_1
Central Inventory : /home/oracle/oraInventory
from : /home/oracle/db/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location : /home/oracle/db/product/10.2.0/db_1/oui
Log file location : /home/oracle/db/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2017_Feb_16_10-52-33-CST_Thu.log
ApplySession applying interim patch '4612267' to OH '/home/oracle/db/product/10.2.0/db_1'
Invoking fuser to check for active processes.
Invoking fuser on "/home/oracle/db/product/10.2.0/db_1/bin/oracle"
OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/home/oracle/db/product/10.2.0/db_1')
Is the local system ready for patching?
Do you want to proceed? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '4612267' for restore. This might take a while...
Backing up files affected by the patch '4612267' for rollback. This might take a while...
Patching component oracle.oracore.rsf, 10.2.0.1.0...
Updating archive file "/home/oracle/db/product/10.2.0/db_1/lib/libcore10.a" with "lib/libcore10.a/sltrg.o"
Patching component oracle.rdbms, 10.2.0.1.0...
Updating archive file "/home/oracle/db/product/10.2.0/db_1/lib/libcore10.a" with "lib/libcore10.a/sltrg.o"
Running make for target client_sharedlib
Running make for target client_sharedlib
Running make for target ioracle
ApplySession adding interim patch '4612267' to inventory
The local system has been patched and can be restarted.
OPatch succeeded.
[oracle@DB 4612267]$
然後啟動sqlplus,正常啟動,問題解決。
實在搞不清楚為什麼,抱著試試看的心情搜尋了一下,卻發現這是普遍現象。
下面是一篇文章:
根據文中所說的幾個條件,我查了一下本地的情況,伺服器啟動剛剛199天(uptime):
[oracle@DB ~]$ uptime
10:35:46 up 199 days, 53 min, 3 users, load average: 0.05, 0.05, 0.31
文中說從198天起剛好會出現該問題。
資料庫版本是10.2.0.1,又吻合。
然後用strace命令跟蹤了一下:
fcntl64(6, F_SETFD, FD_CLOEXEC) = 0
lseek(6, 0, SEEK_SET) = 0
read(6, "\25\23\"\1\23\3\t\t\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 256) = 256
lseek(6, 512, SEEK_SET) = 512
read(6, "\337y\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
lseek(6, 1024, SEEK_SET) = 1024
read(6, "\25\7'\0072\7>\7j\7\276\17$'\6K5S\24TfT\307T(VsV\222V\6W"..., 86) = 86
times(NULL) = 2148613639
times(NULL) = 2148613639
times(NULL) = 2148613639
times(NULL) = 2148613639
times(NULL) = 2148613639
times(NULL) = 2148613639
times(NULL) = 2148613639
基本確定是bug引起:
事實上只要 x86主機執行天數是是24.8的倍數都有可能引發該bug,因為time()函式值為null,造成無限死迴圈,從而耗盡cpu。
解決辦法有三種:
1、重啟伺服器(治標不治本);
2、資料庫版本升級(比較耗時);
3、打patch;
以下是patch過程:
[oracle@DB packages]$ unzip p4612267_10201_LINUX32bit_198days.zip
Archive: p4612267_10201_LINUX32bit_198days.zip
creating: 4612267/
creating: 4612267/files/
creating: 4612267/files/lib/
creating: 4612267/files/lib/libcore10.a/
inflating: 4612267/files/lib/libcore10.a/sltrg.o
creating: 4612267/etc/
creating: 4612267/etc/config/
inflating: 4612267/etc/config/inventory
inflating: 4612267/etc/config/actions
creating: 4612267/etc/xml/
inflating: 4612267/etc/xml/GenericActions.xml
inflating: 4612267/etc/xml/ShiphomeDirectoryStructure.xml
inflating: 4612267/README.txt
[oracle@DB packages]$ ls
4612267 bbed cx_Oracle-5.1.2 p4612267_10201_LINUX32bit_198days.zip p4612267_10201_Linux-x86-64.zip
[oracle@DB packages]$ cd 4612267/
[oracle@DB 4612267]$ ls
etc files README.txt
[oracle@DB 4612267]$ $ORACLE_HOME/OPatch/opatch apply
Invoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
Oracle Home : /home/oracle/db/product/10.2.0/db_1
Central Inventory : /home/oracle/oraInventory
from : /home/oracle/db/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location : /home/oracle/db/product/10.2.0/db_1/oui
Log file location : /home/oracle/db/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2017_Feb_16_10-52-33-CST_Thu.log
ApplySession applying interim patch '4612267' to OH '/home/oracle/db/product/10.2.0/db_1'
Invoking fuser to check for active processes.
Invoking fuser on "/home/oracle/db/product/10.2.0/db_1/bin/oracle"
OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/home/oracle/db/product/10.2.0/db_1')
Is the local system ready for patching?
Do you want to proceed? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '4612267' for restore. This might take a while...
Backing up files affected by the patch '4612267' for rollback. This might take a while...
Patching component oracle.oracore.rsf, 10.2.0.1.0...
Updating archive file "/home/oracle/db/product/10.2.0/db_1/lib/libcore10.a" with "lib/libcore10.a/sltrg.o"
Patching component oracle.rdbms, 10.2.0.1.0...
Updating archive file "/home/oracle/db/product/10.2.0/db_1/lib/libcore10.a" with "lib/libcore10.a/sltrg.o"
Running make for target client_sharedlib
Running make for target client_sharedlib
Running make for target ioracle
ApplySession adding interim patch '4612267' to inventory
The local system has been patched and can be restarted.
OPatch succeeded.
[oracle@DB 4612267]$
然後啟動sqlplus,正常啟動,問題解決。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12932950/viewspace-2133633/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- sqlplus 無響應 hang處理SQL
- Oracle CPU使用率過高問題處理Oracle
- oracle_CPU佔用率高時的問題定位Oracle
- 【RAC】處理因ons導致CPU使用率過高的問題
- 資料庫無響應問題的緊急處理和分析資料庫
- 如何處理MySQL經常出現CPU佔用率達到99%MySql
- 解決WinXP中CPU佔用率過高的問題(MaxWorkitems)(轉)
- 解決Windows XP中CPU佔用率過高的問題(轉)Windows
- win10系統keyshot佔用率高cpu怎麼辦_win10 keyshot佔用率100%cpu處理方法Win10
- 記一次資料庫高CPU佔用率處理過程資料庫
- 資料庫響應慢問題處理資料庫
- 案例:系統的 CPU 使用率很高,但為啥卻找不到高 CPU 的應用?
- 小議 Thread.sleep(0) 造成 CPU佔用率高的問題thread
- mac的cpu某段時間佔用很高Mac
- cpu佔用率100%怎麼解決 cpu佔用率高怎麼辦
- 禁用software_reporter_tool.exe 解決CPU高佔用率的問題
- Node.js 應用高 CPU 佔用率的分析方法Node.js
- 查詢操作佔用cpu很高語句
- 【問題處理】“sqlplus / as sysdba”無法登陸——多餘的斜槓!SQL
- Oracle優化案例-緊急處理一條sql引起cpu使用率99%的問題(十六)Oracle優化SQL
- 問題:mybatis like 佔位符處理MyBatis
- win10系統中.NET Runtime Optimization Service佔用CPU使用率很高怎麼辦Win10
- cpu使用率過高問題(Java)Java
- SYSAUX表空間使用率高問題處理UX
- 關於vmstat,top,ps aux檢視的cpu佔用率不一致的問題UX
- Linux系統中CPU佔用率較高問題排查思路與解決方法Linux
- Oracle資料庫經常會遇到CPU利用率很高的情況Oracle資料庫
- .NET2003開發時DEVENV的CPU使用率很高dev
- 如何解決cpu使用率過高的問題
- crontab導致CPU異常的問題分析及處理
- Win10系統cpu佔有率很高的解決方法Win10
- javascript迴圈事件只響應最後一次的問題處理JavaScript事件
- CPU資源佔用100%怎麼辦?cpu佔用率高的解決辦法
- 診斷和解決CPU利用率高的問題(zt)
- 10g中佔用CPU很高異常oracle程式分析Oracle
- windows10cpu佔用率高怎麼辦Windows
- 檢視程式cpu和記憶體佔用率記憶體
- win10系統explorer佔用cpu很高的解決方法Win10