TNS-12555報錯的解決方案

Hoegh發表於2017-09-13

同事在使用指令碼啟動資料庫時,發現監聽器無法正常啟動。透過lsnrctl start命令很容易復現了這個問題。


問題復現

點選(此處)摺疊或開啟

  1. [oracle@localhost ~]$ lsnrctl start
  2. LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 06-AUG-2014 19:40:52
  3. Copyright (c) 1991, 2009, Oracle. All rights reserved.
  4. Starting /opt/oracle/11g/bin/tnslsnr: please wait...
  5. TNSLSNR for Linux: Version 11.2.0.1.0 - Production
  6. System parameter file is /opt/oracle/11g/network/admin/listener.ora
  7. Log messages written to /opt/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
  8. Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
  9. TNS-12555: TNS:permission denied
  10. TNS-12560: TNS:protocol adapter error
  11. TNS-00525: Insufficient privilege for operation
  12. Linux Error: 1: Operation not permitted
  13. Listener failed to start. See the error message(s) above...
透過報錯提示,發現是許可權問題。

解決方案


檢視.oracle檔案


點選(此處)摺疊或開啟

  1. [root@localhost ~]# ls -lrtd /var/tmp/.oracle
  2.  drwxrwxrwt. 2 root root 4096 8\u6708 5 21:48 /var/tmp/.oracle
  3. [root@localhost ~]# ls -lrtd /tmp/.oracle
  4.  drwxrwxrwt. 2 root root 4096 8\u6708 5 20:33 /tmp/.oracle

發現許可權雖然是777,但是使用者組和所有者不對,應該把使用者組和所有者改為改成oracle:dba

修改.oracle檔案許可權


點選(此處)摺疊或開啟

  1. [root@localhost ~]# chown -R oracle:dba /var/tmp/.oracle
  2. [root@localhost ~]# chown -R oracle:dba /tmp/.oracle
  3. [root@localhost ~]# ls -lrtd /tmp/.oracle
  4. drwxrwxrwt. 2 oracle dba 4096 8\u6708 5 20:33 /tmp/.oracle
  5. [root@localhost ~]# ls -lrtd /var/tmp/.oracle
  6. drwxrwxrwt. 2 oracle dba 4096 8\u6708 5 21:48 /var/tmp/.oracle


再次啟動監聽,成功!


~~~~~~~ the end~~~~~~~~~
hoegh
2017.09.13


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

相關文章