最近遇到一个奇怪的问题:
做了操作:
更改了linux的主机名,由原来的localhost改为了mesqas,然后考虑到lsnrctl问题可能会无法注册成功,重新修改回了localhost。
然后出现了如下的问题:
1、问题现象:
(1)启动监听:
[oracle@localhost:/home/oracle]$lsnrctl start LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 26-NOV-2021 10:46:02 Copyright (c) 1991, 2013, Oracle. All rights reserved. Starting /oracle/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait... TNS-12537: TNS:connection closed TNS-12560: TNS:protocol adapter error TNS-00507: Connection closed Linux Error: 29: Illegal seek
(2)考虑重新创建netca监听
出现如下问题:
[oracle@localhost ~]$ netca
Oracle Net Services Configuration: # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00007ff835c8541a, pid=24494, tid=140704722671424 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_51-b10 mixed mode) # Problematic frame: # C [libclntsh.so.11.1+0x6ed41a] snlinGetAddrInfo+0x92e # # An error report file with more information is saved as hs_err_pid24494.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # /oracle/app/oracle/product/11.2.0/db_1/bin/netca: line 181: 24494 Aborted (core dumped) $JRE $JRE_OPTIONS -classpath $CLASSPATH oracle.net.ca.NetCA $*
2、解决:
(1)关闭selinux
(2)更改主机名mesqas
(3)修改/etc/hosts文件,配置
172.18.1.108 mesqas
(4)修改listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = mesqas)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
3、再启动便成功了
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 26-NOV-2021 10:57:47
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=mesqas)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 26-NOV-2021 10:48:55 Uptime 0 days 0 hr. 8 min. 51 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /oracle/app/oracle/product/11.2.0/db_1/network/admin/listener.ora Listener Log File /oracle/app/oracle/diag/tnslsnr/mesqas/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mesqas)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Services Summary... Service "mesorcl" has 1 instance(s). Instance "mesorcl", status READY, has 1 handler(s) for this service... Service "mesorclXDB" has 1 instance(s). Instance "mesorcl", status READY, has 1 handler(s) for this service... The command completed successfully
4、分析原因:
很诡异,不知道什么情况。但是在最初切入oracle的时候,oracle的主机名是localhost.localdomain。和root下的主机名localhost明显不一样
后来测试了几个主机名,改为mesqas,mesqass,localhost2都可以正常使用。
唯独无法使用localhost这个主机名,为什么呢?搞不懂
启动lsnrctl start时,查看/var/log/message
Nov 26 11:19:35 localhost kernel: tnslsnr[12092]: segfault at 0 ip 00007efc579b550a sp 00007ffeb6ddc760 error 4 in libclntsh.so.11.1[7efc57280000+267c000] Nov 26 11:19:35 localhost abrt-hook-ccpp: Process 12092 (tnslsnr) of user 51001 killed by SIGSEGV - dumping core Nov 26 11:19:35 localhost abrt-server: Executable '/oracle/app/oracle/product/11.2.0/db_1/bin/tnslsnr' doesn't belong to any package and ProcessUnpackaged is set to 'no' Nov 26 11:19:35 localhost abrt-server: 'post-create' on '/var/spool/abrt/ccpp-2021-11-26-11:19:35-12092' exited with 1 Nov 26 11:19:35 localhost abrt-server: Deleting problem directory '/var/spool/abrt/ccpp-2021-11-26-11:19:35-12092' Nov 26 11:20:01 localhost systemd: Started Session 214 of user root. Nov 26 11:21:23 localhost systemd-logind: Removed session 193. Nov 26 11:22:26 localhost systemd: Stopped target Login Prompts (Pre). Nov 26 11:22:26 localhost systemd: Stopping Availability of block devices... Nov 26 11:22:26 localhost systemd: Stopping Location Lookup Service...