問題描述oracle
$ lsnrctl start
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 26-JUL-2017 09:53:42
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=mengqf)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
TNS-12560: TNS:protocol adapter error
TNS-00515: Connect failed because target host or object does not exist
Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
。。。。。。app
解決方案dom
主機名稱:/etc/sysconfig/network
因只修改了機器的主機名,但host和listener.ora文件並無修改,所以須要修改host和監聽listener.ora
修改host文件
$ vi /etc/hosts
#127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 localhost mwd
192.168.78.17 mengspa
修改listener.ora文件
$ vi /u01/app/oracle/product/12.1/db1/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/12.1/db1/network/admin/listener.ora
# Generated by Oracle configuration tools.get
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = meng)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
重啓機器便可
# rebootio
若是機器裏有tnsnames.ora這個文件的HOST也須要修改,可是這個文件建議使用IP地址。class