oracle ORA-12543: TNS:目标主机无法访问但 telnet 和 tnsping 工作正常
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23892218/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ORA-12543: TNS:destination host unreachable but telnet and tnsping works
提问by Martinus_
Last days i stay face to face with a strange oracle problem. I have defined database in tnsnames.ora. Oracle client is installed , client and client/bin have been added to PATH.
最后几天,我面对一个奇怪的 oracle 问题。我在 tnsnames.ora 中定义了数据库。安装了 Oracle 客户端,在 PATH 中添加了客户端和客户端/bin。
Ping
works, tnsping
works, I can connect to host by database port with telnet.
Ping
有效,tnsping
有效,我可以使用 telnet 通过数据库端口连接到主机。
When I try to run application that tries to connect to db I got
当我尝试运行尝试连接到数据库的应用程序时,我得到了
ORA-12543: TNS:destination host unreachable
ORA-12543: TNS:目标主机无法访问
It is the same situation when I try to connect by sqlplus
当我尝试通过 sqlplus 连接时也是同样的情况
sqlplus username/password@TNSNAME
sqlplus 用户名/密码@TNSNAME
Situation occurred only on one workstation, it's mean in common it should works.
情况只发生在一个工作站上,这意味着它应该可以正常工作。
WS is windows 7 64 bit.
Database :
WS 是 Windows 7 64 位。
数据库:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
Oracle 数据库 10g 企业版 10.2.0.5.0 版 - 64 位生产
回答by Estin Chin
I was having the same problem, I resolved it by changing my password and removing "@" character. It worked for me.
我遇到了同样的问题,我通过更改密码并删除“@”字符来解决它。它对我有用。
@ is to tell SQL plus which connection identifier (service name/sid) we want to connect. In short, avoid using this character in password.
@ 是告诉 SQL 加上我们要连接的连接标识符(服务名称/sid)。总之,避免在密码中使用这个字符。
回答by sudha mosalikanti
I also faced the same issue ORA-12543: TNS:destination host unreachable
我也遇到了同样的问题 ORA-12543: TNS:destination host unreachable
i resolved it in this way
我是这样解决的
open sqlplus
打开sqlplus
connect
连接
enter user-name :system enter password : HHHHH@2014
输入用户名:系统输入密码:HHHHH@2014
then the following error raised
然后出现以下错误
the problem is my password contains @ symbol
问题是我的密码包含@符号
resolved it by putting my password in "HHHHHH@2014"
通过将我的密码输入“HHHHHH@2014”来解决它
回答by Pravin P Patil
Recently, I installed Oracle 11g for testing purpose and after completion of installation Database 11g Express Editionstarted on the browser with the system and Pravin@01 password it is connected successfully. After I tried using SQL Developer tool it was also working fine but while I tried to connect using SQL PLUS command line toolit suddenly gave me an error as,
最近我为了测试目的安装了Oracle 11g,安装完成后在浏览器上启动了Database 11g Express Edition,系统密码为Pravin@01,连接成功。在我尝试使用 SQL Developer 工具后,它也工作正常,但是当我尝试使用SQL PLUS 命令行工具进行连接时,它突然给了我一个错误,
ORA-12543: TNS:destination host unreachable
ORA-12543: TNS:目标主机无法访问
Then after research for an hour, I got a solution that Oracle treats @ character in the password as a `
然后经过一个小时的研究,我得到了一个解决方案,即Oracle将密码中的@字符视为`
service name or sid
service name or sid
so the solution for this problem is to remove @ character from the password using
所以这个问题的解决方案是使用从密码中删除@字符
ALTER USER system IDENTIFIED BY ' here is your new password which should contain character and digits only try to eliminate special characters';
ALTER USER system IDENTIFIED BY '这里是你的新密码,它应该包含字符和数字,只尝试消除特殊字符';
I think this post may be helpful for you.
我认为这篇文章可能对你有帮助。
回答by Mohit Soni
I too got ORA-12543 :TNS :destination host unreachable. But for me the problem was in the password.
我也收到了 ORA-12543 :TNS :destination 主机无法访问。但对我来说,问题出在密码上。
Resolution : Need to remove "@" from the existing password as @ defines connection identifier being used to connect in sqlPlus.
解决方案:需要从现有密码中删除“@”,因为@ 定义了用于在 sqlPlus 中进行连接的连接标识符。
To update the password , follow below steps : Logon to window cmd then type "sqlplus /nolog" then "connect / as sysdba" . Once you are connected, change the SYS password to something without @: "ALTER USER sys IDENTIFIED BY new_password;"
要更新密码,请按照以下步骤操作: 登录到 cmd 窗口,然后键入“sqlplus /nolog”,然后键入“connect / as sysdba”。连接后,将 SYS 密码更改为不带 @ 的密码:“ALTER USER sys IDENTIFIED BY new_password;”
回答by smartexpert
I have tested this in Windows 2016 environment with Oracle 18c 64-bit
我已经在使用 Oracle 18c 64 位的 Windows 2016 环境中对此进行了测试
Use this following escape character sequence when attempting to logon with an "@" in the password.
尝试使用密码中的“@”登录时,请使用以下转义字符序列。
user: scott password: scott@test
用户:scott 密码:scott@test
sqlplus scott/\”scott@test\”@TEST_DB
In order avoid this annoyance, change password without an @ character using the following command once you have logged in to sqlplus.
为了避免这种烦恼,登录到 sqlplus 后,请使用以下命令更改不带 @ 字符的密码。
alter user scott identified by "newpassword"
回答by Sandeep kumar mishra
(log in as sys dba)
(以 sys dba 身份登录)
sql>conn / as sysdba
sql>conn / 作为 sysdba
(then alter the user)
(然后更改用户)
sql>alter user username identified by newuserName
sql>commit
sql>alter 由 newuserName 标识的用户名
sql>提交
(now again try to login with new user with the same password it will work) click on 1to see the screenshot -- ][1]