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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle CPU使用率過高問題處理Oracle
- win10系統keyshot佔用率高cpu怎麼辦_win10 keyshot佔用率100%cpu處理方法Win10
- 如何處理MySQL經常出現CPU佔用率達到99%MySql
- 案例:系統的 CPU 使用率很高,但為啥卻找不到高 CPU 的應用?
- java應用CPU佔用率過高排查Java
- 禁用software_reporter_tool.exe 解決CPU高佔用率的問題
- cpu佔用率100%怎麼解決 cpu佔用率高怎麼辦
- mac的cpu某段時間佔用很高Mac
- Node.js 應用高 CPU 佔用率的分析方法Node.js
- Oracle優化案例-緊急處理一條sql引起cpu使用率99%的問題(十六)Oracle優化SQL
- win10系統中.NET Runtime Optimization Service佔用CPU使用率很高怎麼辦Win10
- python kubernetes 獲取 pod 的 cpu 佔用率Python
- cpu使用率過高問題(Java)Java
- 問題:mybatis like 佔位符處理MyBatis
- Linux系統中CPU佔用率較高問題排查思路與解決方法Linux
- sqlplus / as sysdba 提示許可權不足(ORA-01031)問題處理SQL
- win10系統explorer佔用cpu很高的解決方法Win10
- Win10系統cpu佔有率很高的解決方法Win10
- linux處理oracle問題常用命令LinuxOracle
- windows10cpu佔用率高怎麼辦Windows
- mysql資料庫Cpu利用率100%問題排查MySql資料庫
- 如何解決網頁無響應問題網頁
- 如何解決Finder持續無響應的問題
- grafana展示的CPU利用率與實際不符的問題探究Grafana
- 低效sql語句執行緩慢引起的大量佔用伺服器的CPU問題處理 (優化心得)SQL伺服器優化
- docker執行容器後agetty程式cpu佔用率100%Docker
- win10空閒cpu很多cpu佔滿怎麼辦 win10cpu佔用率高怎麼辦Win10
- 使用 Laravel Sail 時, sail 與容器互動的命令無響應的問題及解決辦法LaravelAI
- win10解決antimalware service executable cpu佔用率高的方法Win10
- mysql中CPU或記憶體利用率過高問題MySql記憶體
- MySQL查詢中Sending data佔用大量時間的問題處理MySql
- clover在win10下無響應如何處理_clover在win10下無響應怎麼修復Win10
- Ubuntu無法解析域名DNS指向127.0.0.53問題處理UbuntuDNS
- 應用使用JNDI,資料庫無法連線,導致的程序無法啟動問題處理資料庫
- win10記憶體佔用率高怎麼解決 win10記憶體佔用率突然爆滿處理方法Win10記憶體
- Kubernetes-應用部署問題定位和處理
- Java中的CPU佔用高和記憶體佔用高的問題排查Java記憶體
- 記一次 PHP artisan 命令無任何反應的問題PHP
- rundll32.exe程式佔用率CPU高的原因及解決方法