TNS-12545: Connect failed because target host or object does not exist
问题描述
$ 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)))
。。。。。。
解决方案
主机名称:/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 meng
修改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.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = meng)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
重启机器即可
# reboot
如果机器里有tnsnames.ora这个文件的HOST也需要修改,但是这个文件建议使用IP地址。
相关文章
- centos7重启网卡报Job for network.service failed because...错误
- Tomcat启动报Error listenerStart错误 Context [] startup failed due to previous errors
- SYMBDSNAP_SDK[3943]: Failed to open device: /dev/symbdsnapctl, errno: 2
- Failed to create AppDomain 'xxx'. Exception has been Failed to create AppDomain
- Attempt to fetch logical page (...) in database 2 failed. It belongs to allocation unit xxxx not to xxx
- Python pip install报错SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED]
- ORA-12545: Connect failed because target host or object does not exist
- failed: Access denied for user 'root'@'localhost' (using password: YES) at /usr/bin/innobackupex lin
- spring boot 启动遇到报错:Failed to configure a DataSource
- 【网址收藏】k8s HPA自动伸缩异常:failed to get cpu utilization: missing request
- wsl centos7: Failed to get D-Bus connection: Operation not permitted
- Tomcat 启动或者发布项目时提示Publishing failed:Resource /xxxx does not exist
- SDWebImage/SDWebImage.h‘ file not found || failed to emit precompiled header XX for bridging header
- Failed to find Build Tools revision 24.0.2 Install Build Tools 24.0.2 and sync project
- 成功解决Fit Failed Warning: Estimator fit failed. The score on this train-test partition for these param
- 成功解决YOLOv3测试——could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZE作记录
- 成功解决Ubuntu下的make: gcc: Command not found Makefile:85: recipe for target 'obj/gemm.o' failed make: **
- 【异常】knife4j提示ApplicationContextException: Failed to start bean ‘documentationPluginsBootstrapper‘
- 【异常】Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource
- npm 报错 request to https://registry.cnpmjs.org/vue failed, reason: Hostname/IP does not match certificate‘
- 关于python使用eyed3查看音频信息时出现Lame tag CRC check failed
- 【错误记录】Android Studio 编译报错 ( AAPT: error: failed to read PNG signature: file does not start with PN )
- 【错误记录】Tinker 热修复示例运行报错 ( Execution failed for task ‘:app:tinkerProcessD‘ . tinkerId is not set!!! )
- HTTP Status 500 - Request processing failed; nested exception is org.springframework.jdbc.BadSqlGram
- 问题解决:Failed to XXX mysqld.service: Unit not found
- Maven deploy报错:Failed to deploy artifacts: Could not transfer artifact from/to snapshots 401 Unauthorized
- Failed to start mongod.service: Unit mongod.service not found