hosts文件权限导致监听无法启动

1.所属系统:
  1. ZHJS2#[/]uname -a
  2. HP-UX ZHJS2 B.11.31 U ia64 2866286647 unlimited-user license
2.问题描述:

修改主机名后,数据库监听无法启动,查看listener.ora文件如下:

  1. LISTENER =
  2. (DESCRIPTION_LIST =
  3. (DESCRIPTION =
  4. (ADDRESS = (PROTOCOL = TCP)(HOST = ZHJS2)(PORT = 1521))
  5. (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
  6. )
  7. )
  8. ADR_BASE_LISTENER = /Oracle
  9. SID_LIST_LISTENER =
  10. (SID_LIST=
  11. (SID_DESC=
  12. (SID_NAME=ZHJS2)
  13. (ORACLE_HOME=/Oracle/product/11.2.0.3/dbhome_1)
  14. )
  15. )

使用lsnrctl start启动的时候报无法识别主机名,但是在操作系统级别使用hostname查看确实是ZHJS2,和/etc/hosts文件也可以对应,为什么会报无法识别呢?
然后干脆不适用主机名,把HOST后面直接加IP地址,依然不行,如下:

  1. ZHJS2$[/Oracle]lsnrctl
  2. LSNRCTL for HPUX: Version 11.2.0.3.0 - Production on 09-MAR-2016 20:32:58
  3. Copyright (c) 1991, 2011, Oracle. All rights reserved.
  4. Welcome to LSNRCTL, type "help" for information.
  5. LSNRCTL> status
  6. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=132.32.24.7)(PORT=1521)))
  7. TNS-12541: TNS:no listener
  8. TNS-12560: TNS:protocol adapter error
  9. TNS-00511: No listener
  10. HPUX Error: 239: Connection refused
  11. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
  12. TNS-12541: TNS:no listener
  13. TNS-12560: TNS:protocol adapter error
  14. TNS-00511: No listener
  15. HPUX Error: 239: Connection refused
  16. LSNRCTL> start
  17. Starting /Oracle/product/11.2.0.3/dbhome_1/bin/tnslsnr: please wait...
  18. TNS-12537: TNS:connection closed
  19. TNS-12560: TNS:protocol adapter error
  20. TNS-00507: Connection closed
  21. HPUX Error: 29: Illegal seek

报:TNS-12537 TNS-00507

3.解决

经过一段时间的排查和尝试以及和其他机器相比,发现oracle用户无法读取hosts文件,查看hosts文件权限

  1. ZHJS2#[/]ls -l /etc/hosts
  2. -rw------- 1 root sys 1256 Mar 9 20:23 /etc/hosts
  3. **修改hosts文件权限**
  4. ZHJS2#[/]chmod 644 /etc/hosts

修改后再次启动监听,成功!!!

4.参考

My support oracle :ID 315720.1

Verify the user attempting to start the TNS Listener process has read permissions on the /etc/hosts file, and that the /etc/hosts file contains the localhost entry in the following form:

  1. 127.0.0.1 localhost.localdomain localhost
  2. 12.123.123.12 myhost.us.oracle.com myhost
???疑点:为什么修改主机名会使hosts文件权限发生改变




原文地址:https://www.cnblogs.com/haoxiaoyu/p/a3c36bb9c7c04fa63a0793d718b021e5.html