gpt4 book ai didi

ORA-12543: TNS:destination host unreachable but telnet and tnsping works(ORA-12543:tns:无法访问目标主机,但telnet和tnsping可用)

转载 作者:bug小助手 更新时间:2023-10-27 19:50:23 43 4
gpt4 key购买 nike



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.

最后几天,我面对着一个奇怪的先知问题。我已经在tnsnames.ora中定义了数据库。Oracle客户端已安装,已将客户端和客户端/bin添加到PATH。



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




It is the same situation when I try to connect by sqlplus

当我尝试通过Sqlplus连接时也是如此




sqlplus username/password@TNSNAME




Situation occurred only on one workstation, it's mean in common it should works.

这种情况只发生在一台工作站上,这意味着它应该可以正常工作。



WS is windows 7 64 bit.

Database :

WS是64位Windows 7。数据库:




Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production



更多回答

Is it possible that you have multiple oracle clients installed (so multiple TNS Names.ora), the application is using one and the command line another?

有没有可能您安装了多个Oracle客户端(即多个TNS Names.ora),应用程序正在使用一个而命令行使用另一个?

Do you have IPv6 enabled? That might be a problem with 10g.

您是否启用了IPv6?这可能是10G的问题。

Yes i have two oracle clients, tnsnames files are the same. To be sure in PATH i leave only one client reference.

是的,我有两个Oracle客户端,tnsname文件是相同的。为了确保在PATH中我只留下一个客户引用。

tnsping shows where it got the parameter sqlnet.ora from. Where did it find the parameter file? That should be next to the tnsnames.ora that is actually used.

Tnsping显示它从哪里获得参数sqlnet.ora。它在哪里找到参数文件的?它应该位于实际使用的tnsnames.ora旁边。

One of the reason is you have used @ character somewhere in password.

其中一个原因是您在密码中的某个地方使用了@字符。

优秀答案推荐

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 Plus我们要连接哪个连接标识符(服务名/sid)。简而言之,请避免在密码中使用此字符。



I also faced the same issue ORA-12543: TNS:destination host unreachable

我也遇到了同样的问题ORA-12543:TNS:目的地主机无法访问



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”中输入我的密码解决了这个问题



I too got ORA-12543 :TNS :destination host unreachable.
But for me the problem was in the password.

我也使ORA-12543:tns:目标主机无法访问。但对我来说,问题出在密码上。



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;"

要更新密码,请执行以下步骤:登录到Windows cmd,然后键入“sqlplus/nolog”,然后输入“Connect/as sysdba”。连接后,将系统密码更改为不带@的密码:“ALTER USER SYS IDENTIFIED BY NEW_PASSWORD;”



(log in as sys dba)

(以sys dba身份登录)




sql>conn / as sysdba




(then alter the user)

(然后更改用户)




sql>alter user username identified by newuserName



sql>commit




(now again try to login with new user with the same password it will work)
click on 1 to see the screenshot -- ][1]

(现在再次尝试使用相同密码的新用户登录)单击1查看屏幕截图--][1]



Recently, I installed Oracle 11g for testing purpose and after completion of installation Database 11g Express Edition started 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 tool it suddenly gave me an error as,

最近,我安装了Oracle 11g用于测试目的,安装完成后,数据库11g Express Edition在浏览器上启动,系统和Pravin@01密码成功连接。在我尝试使用SQL Developer工具后,它也工作正常,但当我尝试使用SQL PLUS命令行工具连接时,它突然给了我一个错误,







ORA-12543: TNS:destination host unreachable







Then after research for an hour, I got a solution that Oracle treats @ character in the password as a `

然后经过一个小时的研究,我得到了一个解决方案,即Oracle将密码中的@字符视为`




service name or sid




so the solution for this problem is to remove @ character from the password using

因此,此问题的解决方案是使用以下命令从密码中删除@Character




ALTER USER system IDENTIFIED BY ' here is your new password which should contain character
and digits only try to eliminate special characters';




I think this post may be helpful for you.

我想这篇文章可能会对你有所帮助。



I have tested this in Windows 2016 environment with Oracle 18c 64-bit

我已经在Windows 2016环境中使用Oracle 18c 64位进行了测试



Use this following escape character sequence when attempting to logon with an "@" in the password.

尝试使用密码中的“@”登录时,请使用以下转义字符序列。



user: scott
password: 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" 


Your current password must be containing "@" symbol and that's the problem.
So, just reset your password and dont use this symbol in your new password.

您当前的密码必须包含“@”符号,这就是问题所在。因此,只需重置您的密码,并且不要在您的新密码中使用此符号。



Adding to comments, if your current password contains "@" symbol then you need to reset password;
how to do step:
open sqlPlus
In enter username enter: / AS SYSDBA;
(connected to oracle)
reset in by:
ALTER USER sys IDENTIFIED BY new_password;

添加评论,如果您当前的密码包含“@”符号,则需要重置密码;操作步骤:在Enter Username Enter:/as SYSDBA;(连接到Oracle)Reset in:ALTER USER SYS BY NEW_PASSWORD中打开sqlPlus;



Use URL Encoding for special characters in your password instead of raw special characters while connecting through terminal.

在通过终端连接时,请对密码中的特殊字符使用URL编码,而不是原始的特殊字符。


Example :-

示例:-


if your connection string is :- sqlplus system/Password@12345@oracle as sysdba;

如果您的连接字符串是:-SQLPLUS SYSTEM/PASSWORD@12345@oracleas sysdba;


Then

然后


Acceptable connection url will be :- sqlplus system/Password%4012345@oracle as sysdba;. Here %40 is the URL Encoding for @, so replace all special characters with their respective URL Encoding and execute the connection command in terminal.

可接受的连接URL为:-SQLPLUS SYSTEM/PASSWORD%4012345@oracleas sysdba;。这里%40是@的URL编码,所以用它们各自的URL编码替换所有特殊字符,并在终端中执行连接命令。


更多回答

can you please tell me how you changed your Oracle System Password?

您能告诉我您是如何更改Oracle系统密码的吗?

@idiotduffer: You can refer to below blog on how to escape "@" character. Sample: sqlplus scott/\”scott@test\”@TEST_DB nadvi.blogspot.my/2011/02/oracle-password-with-or-special.html. Hope it helps.

@diotduffer:你可以参考下面的博客,关于如何转义“@”字符。示例:SQLPLUS SCOTT/\“SCOTT@TEST\”@TEST_DB nadvi.blogspot.my/2011/02/oracle-password-with-or-special.html.希望能有所帮助。

Thanks it help for me. Keep password in double quote:)

谢谢你帮了我的忙。将密码放在双引号中:)

its work for me too. Thanks. I have installed oracle server 11g XE.

这对我来说也很有用。谢谢。我已经安装了Oracle服务器11g XE。

It worked me as well for connecting to SQL*Plus: Release 18.0.0.0.0

我在连接到SQL*Plus:版本18.0.0.0.0时也是如此

you mean newusername or new password?

你是说新用户名还是新密码?

thanks you mate. you saved my day :thumpup !

谢谢你,伙计。你拯救了我的一天:拇指!

nadvi.blogspot.com/2011/02/oracle-password-with-or-special.html has more details

Nadvi.blogspot.com/2011/02/oracle-password-with-or-special.html报道更多细节。

43 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com