listener start fail TNS-12555 利用trace找到問題

guocun09發表於2017-10-26

現象:

Red Hat Enterprise Linux Server release 5.4 (Tikanga)

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

開啟listener時報錯 TNS-12555,Linux Error

scmautosty<*scmauto*/home/oracle>$lsnrctl start

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 03-APR-2013 14:25:21

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Starting /u01/product/oracle/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.3.0 - Production

System parameter file is /u01/product/oracle/network/admin/listener.ora

Log messages written to /u01/product/diag/tnslsnr/scmautosty/listener/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.202.10.151)(PORT=1526)))

Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1526)))

TNS-12555: TNS:permission denied

 TNS-12560: TNS:protocol adapter error

  TNS-00525: Insufficient privilege for operation

   Linux Error: 1: Operation not permitted

Listener failed to start. See the error message(s) above...


診斷:

使用listener trace

可以參考[ID 219968.1]SQLNet & Oracle Net Services - Tracing and Logging at a Glance

加入$ORACLE_HOME/network/admin/listener.ora

trace_level_listener = 16

trace_file_listener = listener

trace_directory_listener = /u01/product/oracle/network/trace

trace_timestamp_listener = on

trace_filelen_listener = 100

trace_fileno_listener = 2

logging_listener = off

log_directory_listener = /u01/product/oracle/network/log

log_file_listener=listener

 

DIAG_ADR_ENABLED_LISTENER=OFF

再次開啟

$lsnrctl start

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 09-APR-2013 10:44:15

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Starting /u01/product/oracle/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.3.0 - Production

System parameter file is /u01/product/oracle/network/admin/listener.ora

Trace information written to /u01/product/oracle/network/trace/listener1.trc

Error listening on: (ADDRESS=(PROTOCOL=ipc)(PARTIAL=yes)(QUEUESIZE=1))

No longer listening on:

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ysdcsssty)(PORT=1526)))

TNS-12546: TNS:permission denied

 TNS-12560: TNS:protocol adapter error

  TNS-00516: Permission denied

   Linux Error: 13: Permission denied

 

$vi /u01/product/oracle/network/trace/listener1.trc

發現其中一條fail記錄

[000001 09-APR-2013 10:44:15:915] sntusgph: fail to search /var/tmp/.oracle

 

分析:

檢視網上一篇http://blog.163.com/ly_89/blog/static/186902299201210136255650/

修改/var/tmp/.oracle的使用者組到dba.oracle,問題解決,奇怪的是問題時使用者daemon. root

[root@scmautosty //]# cd /var/tmp/

[root@scmautosty tmp]# ls -la

total 24

drwxrwxrwt  4 root root 4096 Apr  2 15:04 .

drwxr-xr-x 26 root root 4096 Apr  2 15:27 ..

drwxrwxrwt  2 root root 4096 Apr  3 14:25 .oracle

drwxrwxrwx  9 root root 4096 Apr  2 15:27 vxif

[root@scmautosty tmp]# cd .oracle/

[root@scmautosty .oracle]# ls -la

total 12

drwxrwxrwt 2 root   root 4096 Apr  3 14:25 .

drwxrwxrwt 4 root   root 4096 Apr  2 15:04 ..

srwxrwxrwx 1 daemon root    0 Apr  2 17:01 s#14782.1

srwxrwxrwx 1 daemon root    0 Apr  2 17:01 s#14782.2

srwxrwxrwx 1 daemon root    0 Apr  2 17:01 sEXTPROC1526


[root@scmautosty tmp]# chown -R oracle.dba .oracle

[root@scmautosty tmp]# ls -la

total 24

drwxrwxrwt  4 root   root 4096 Apr  2 15:04 .

drwxr-xr-x 26 root   root 4096 Apr  2 15:27 ..

drwxrwxrwt  2 oracle dba  4096 Apr  3 14:25 .oracle

drwxrwxrwx  9 root   root 4096 Apr  2 15:27 vxif

 

另外關閉時也遇到這個問題可以ps –ef|grep LISTENER檢視並kill程式

 

 

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

相關文章