[oracle@localhost ~]$ lsnrctl start LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 29-APR-2015 07:38:11 Starting /home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait... TNS-12537: TNS:connection closed TNS-12560: TNS:protocol adapter error Linux Error: 29: Illegal seek
/etc/hosts 檔案中存在兩個 localhost 主機名條目,導致監聽器解析衝突。
典型錯誤配置:
127.0.0.1 localhost ::1 localhost <-- IPv6 也指向 localhost,造成衝突
hostname oracle
[root@oracle etc]# cat /etc/hosts 127.0.0.1 localhost ::1 oracle <-- 將 IPv6 映射到新主機名
[root@oracle etc]# cat /etc/sysconfig/network NETWORKING=yes HOSTNAME=oracle
[oracle@oracle ~]$ lsnrctl start LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 29-APR-2015 07:46:27 Starting /home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 11.2.0.1.0 - Production System parameter file is /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))) The command completed successfully
/etc/hosts 中 IPv4 和 IPv6 同時指向 localhost,導致 getaddrinfo() 返回多個地址TNS-12560: protocol adapter error# IPv4 本地回環 127.0.0.1 localhost.localdomain localhost # IPv6 本地回環 ::1 localhost6.localdomain6 localhost6 # 實際主機名映射(需與 /etc/sysconfig/network 一致) 192.168.1.100 oracle-db01.oracle.com oracle-db01 # IPv6 實際地址(如有) fe80::1%eth0 oracle-db01-v6
hostname 輸出與 /etc/sysconfig/network 中 HOSTNAME 一致ping $(hostname) 解析到正確 IP/etc/hosts 無重複主機名映射lsnrctl status 顯示正確的 HOST/IP/PORT