su cannot set user id Resource temporarily unavailable故障解決
su到Oracle使用者報資源不足
[root@snaqi-test3 bin]# su - oracle
su: cannot set user id: Resource temporarily unavailable
檢查如下引數,均未發現問題
[root@snaqi-test3 ~]# cat /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft memlock 33554432
oracle hard memlock 33554432
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
[root@snaqi-test3 ~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 62749
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 1024
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
看是否有類似問題
執行 su - oracle
報錯:su: cannot set user id: Resource temporarily unavailable
執行以下命令檢視
ps -U oracle | wc -l
lsof | grep oracle | wc -l
多數情況是超過限制
解決辦法
1。刪掉無用的程式
2。修改 /etc/security/limits.conf
修改oracle的相關設定
根據上述命令,查詢自己伺服器
[root@snaqi-test3 ~]# ps -ef | grep oracle | wc -l
89
[root@snaqi-test3 ~]# lsof | grep oracle | wc -l
49998
開啟檔案居然有這麼多,太恐怖了
檢視開啟檔案的具體資訊
非常大的檔案
[root@snaqi-test3 ~]# lsof | grep oracle > oracle.txt
[root@snaqi-test3 ~]# more oracle.txt
oracle 927 oracle mem REG 0,16 16777216 28080570 /dev/shm/ora_lottery_393218_52
為什麼Oracle會開啟這麼多檔案?
Oracle是透過session連線到資料庫,難道是session數超了?用plsql dev 登入Oracle,成功了
select count(*) from v$session
查詢當前session是69
分析結果和session無關
[root@snaqi-test3 log]# netstat -anp | wc -l
12178
檢視具體內容
[root@snaqi-test3 log]# netstat -anp
tcp 1 0 192.168.3.21:3938 192.168.3.21:34272 CLOSE_WAIT 18490/emagent
發現大量類似的連線,趕快檢視emagent的個數
[root@snaqi-test3 log]# netstat -anp|grep emagent| wc -l
11608
12178-11608 如此接近,這時肯定有問題的,在等待關閉,處於沒人管狀態
解決問題
因為這臺機器安裝了grid control 12c agent,而oms服務已經停止,根據這些推斷,大致可以確定問題所在
root沒有許可權停止agent
[root@snaqi-test3 bin]# ./emctl status agent
Cannot execute /home/oracle/agent12c//core/12.1.0.1.0/bin/emctl.pl since its userid does not match yours.
[root@snaqi-test3 bin]# ps -ef|grep java
.........
oracle 5541 2512 0 Oct24 ? 00:23:38 /home/oracle/agent12c//core/12.1.0.1.0/jdk/bin/java -Xmx128M -server -Djava.security.egd=file:///dev/./urandom -Dsun.lang.ClassLoader.allowArraySyntax=true -XX:+UseLinuxPosixThreadCPUClocks -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -Dwatchdog.pid=2512 -cp /home/oracle/agent12c//core/12.1.0.1.0/jdbc/lib/ojdbc5.jar:/home/oracle/agent12c//core/12.1.0.1.0/ucp/lib/ucp.jar:/home/oracle/agent12c//core/12.1.0.1.0/modules/oracle.http_client_11.1.1.jar:/home/oracle/agent12c//core/12.1.0.1.0/lib/xmlparserv2.jar:/home/oracle/agent12c//core/12.1.0.1.0/lib/jsch.jar:/home/oracle/agent12c//core/12.1.0.1.0/lib/optic.jar:/home/oracle/agent12c//core/12.1.0.1.0/modules/oracle.dms_11.1.1/dms.jar:/home/oracle/agent12c//core/12.1.0.1.0/modules/oracle.odl_11.1.1/ojdl.jar:/home/oracle/agent12c//core/12.1.0.1.0/modules/oracle.odl_11.1.1/ojdl2.jar:/home/oracle/agent12c//core/12.1.0.1.0/sysman/jlib/log4j-core.jar:/home/oracle/agent12c//core/12.1.0.1.0/jlib/gcagent_core.jar:/home/oracle/agent12c//core/12.1.0.1.0/sysman/jlib/emagentSDK-intg.jar:/home/oracle/agent12c//core/12.1.0.1.0/sysman/jlib/emagentSDK.jar oracle.sysman.gcagent.tmmain.TMMain
..........
[root@snaqi-test3 bin]# kill -9 5541
[root@snaqi-test3 bin]# kill -9 5541
-bash: kill: (5541) - No such process
[root@snaqi-test3 bin]# su - oracle
su: cannot set user id: Resource temporarily unavailable
大家還記得前面我們抓取的lsof 執行結果嗎?檢視那裡到底是開啟的哪些檔案
more Oracle.txt
大量的mem資訊
oracle 1093 oracle mem REG 0,16 16777216 28080414 /dev/shm/ora_lottery_360449_154
oracle 1093 oracle mem REG 0,16 16777216 28080415 /dev/shm/ora_lottery_360449_155
oracle 1093 oracle mem REG 0,16 16777216 28080416 /dev/shm/ora_lottery_360449_156
oracle 1093 oracle mem REG 0,16 16777216 28080417 /dev/shm/ora_lottery_360449_157
除了這些還有
emagent 18490 oracle 5713u IPv4 78422180 0t0 TCP snaqi-test3:dbcontrol_agent->snaqi-test3:26944 (CLOSE_WAIT)
emagent 18490 oracle 5714u IPv4 78424155 0t0 TCP snaqi-test3:dbcontrol_agent->snaqi-test3:27136 (CLOSE_WAIT)
emagent 18490 oracle 5715u IPv4 78425077 0t0 TCP snaqi-test3:dbcontrol_agent->snaqi-test3:27272 (CLOSE_WAIT)
emagent 18490 oracle 5716u IPv4 78427040 0t0 TCP snaqi-test3:dbcontrol_agent->snaqi-test3:27464 (CLOSE_WAIT)
emagent 18490 oracle 5717u IPv4 78427952 0t0 TCP snaqi-test3:dbcontrol_agent->snaqi-test3:27600 (CLOSE_WAIT)
emagent 18490 oracle 5718u IPv4 78429917 0t0 TCP snaqi-test3:dbcontrol_agent->snaqi-test3:27792 (CLOSE_WAIT)
emagent 18490 oracle 5719u IPv4 78430804 0t0 TCP snaqi-test3:dbcontrol_agent->snaqi-test3:27930 (CLOSE_WAIT)
emagent 18490 oracle 5720u IPv4 78432780 0t0 TCP snaqi-test3:dbcontrol_agent->snaqi-test3:28122 (CLOSE_WAIT)
emagent 18490 oracle 5721u IPv4 78433663 0t0 TCP snaqi-test3:dbcontrol_agent->snaqi-test3:28258 (CLOSE_WAIT)
emagent 18490 oracle 5722u IPv4 78435657 0t0 TCP snaqi-test3:dbcontrol_agent->snaqi-test3:28446 (CLOSE_WAIT)
emagent 18490 oracle 5723u IPv4 78436596 0t0 TCP snaqi-test3:dbcontrol_agent->snaqi-test3:28577 (CLOSE_WAIT)
發現大量的emagent,和我們netstat的結果一樣
果斷kill掉
[root@snaqi-test3 log]# ps -ef|grep 18490
root 9214 7039 0 00:52 pts/2 00:00:00 grep 18490
oracle 18490 8679 0 Sep19 ? 00:04:12 /home/oracle/product/11.2.0.3/db_1/bin/emagent
[root@snaqi-test3 log]# kill -9 18490
[root@snaqi-test3 log]# ps -ef|grep 18490
root 9216 7039 0 00:52 pts/2 00:00:00 grep 18490
oracle 18490 8679 0 Sep19 ? 00:11:08 /home/oracle/product/11.2.0.3/db_1/bin/emagent
[root@snaqi-test3 log]# ps -ef|grep 18490
root 9224 7039 0 00:52 pts/2 00:00:00 grep 18490
oracle 18490 8679 0 Sep19 ? 00:11:09 [emagent]
[root@snaqi-test3 log]# ps -A -o stat,ppid,pid,cmd | grep -e '^[Zz]'
[root@snaqi-test3 log]# ps -A -o stat,ppid,pid,cmd | grep -e '^[Zz]'
[root@snaqi-test3 log]# ps -ef|grep 18490
root 9259 7039 0 00:53 pts/2 00:00:00 grep 18490
[root@snaqi-test3 ~]# lsof | grep oracle | wc -l
31451
[root@snaqi-test3 log]# netstat -anp | wc -l
532
這次恢復正常
[root@snaqi-test3 bin]# su - oracle
[oracle@snaqi-test3 ~]$
[oracle@snaqi-test3 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Sat Nov 10 01:54:48 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning and Data Mining options
SQL>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15797451/viewspace-1353795/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- su - oracle報錯su: cannot set user id: Resource temporarily unavailableOracleAI
- cannot set user id: Resource temporarily unavailableAI
- Resource temporarily unavailableAI
- 錯誤:bash: fork: Resource temporarily unavailableAI
- Linux Error: 11: Resource temporarily unavailableLinuxErrorAI
- ogg報錯error 11, Resource temporarily unavailableErrorAI
- 關於Linux主機報錯(Resource temporarily unavailable)的解決辦法LinuxAI
- linux 切換使用者報Resource temporarily unavailableLinuxAI
- ssh登入報錯-bash fork retry Resource temporarily unavailableAI
- VNC登陸灰屏 - fatal IO error 11 (Resource temporarily unavailable) on X serverVNCErrorAIServer
- 解決“su: cannot open session: Permission denied”Session
- Ubuntu Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)UbuntuAPTAI
- jdon網站老是Service Temporarily Unavailable ???網站AI
- Cannot find SS.INI file for user *** 解決方法
- (問題解決)Cannot set LC_CTYPE to default locale: No such file or directory
- TiDB故障處理之讓人迷惑的Region is UnavailableTiDBAI
- 解決cannot find module providing package或cannot find main modulePackageAI
- Cannot set property 'innerHTML' of nullHTMLNull
- 【故障-ORACLE】‘ALTER SYSTEM SET service_names='' SCOPE=MEMORY SID=’解釋Oracle
- CRS: Resource in UNKNOWN state and srvctl Cannot Start/Stop Resource_845709.1
- 【RAC安裝故障】multiple user has uid 0UI
- Cannot set property ‘type‘ of null(vue)NullVue
- 解決 Cannot find OpenSSL's
- NFS故障解決NFS
- VSFTPD錯誤的解決 500 OOPS: vsftpd: cannot locate user specified in ftp_usernaFTPOOP
- AUTHID DEFINER\authid current_user與alter session set current_schemaSession
- 解決 CRS-2640: Required resourceUI
- ORA-25507: resource 解決方法
- 故障解決法(摘抄)
- BUG——AngularJS:Cannot set property ‘pic‘ of undefinedAngularJSUndefined
- 【ERROR】su user報'This account is currently not available'錯誤 for linuxErrorAILinux
- oracle 10.2.0.3對USER收回CONNECT及RESOURCEOracle
- Android Studio 出現“Cannot resolve symbol” 解決辦法AndroidSymbol
- 關於Cannot resolve scoped service from root provider解決方案IDE
- 解決Android中No resource found that matches android:TextAppearance.Material.Widget.Button.Inverse問題AndroidAPP
- Linux 出現 su: Authentication failure 解決辦法LinuxAI
- Access restriction: The type 'Resource' is not API 解決辦法RESTAPI
- 普通raid常見故障解和決方案彙總AI