SQL Developer不与tnsnames.ora中定义的SID连接(SQL Developer does not connect with SID as defined in tnsnames.

编程入门 行业动态 更新时间:2024-10-27 00:26:22
SQL Developer不与tnsnames.ora中定义的SID连接(SQL Developer does not connect with SID as defined in tnsnames.ora)

我的tnsnames.ora看起来像这样:

ORACLR_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) (CONNECT_DATA = (SID = CLRExtProc) (PRESENTATION = RO) ) ) ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )**

但是,当我尝试使用SQL Developer进行如下连接时,我得到错误:无法从套接字读取更多数据。

作用:SYSDBA ConnectionType:Basic

HostName:localhost端口:1521 SID:CLRExtProc

你能告诉我我做错了什么吗? 我可以使用service_name连接,或者在SID中使用服务名称时,但是当我使用tnsnames.ora中定义的SID时,为什么它不起作用。

根据我的理解,SID对应于数据库的实例名称。 是不是可以用它连接?

最诚挚的问候,Harshit

My tnsnames.ora looks like this:

ORACLR_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) (CONNECT_DATA = (SID = CLRExtProc) (PRESENTATION = RO) ) ) ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )**

But when I try connecting using SQL Developer as follows I get the error: No more data to read from socket.

Role: SYSDBA ConnectionType: Basic

HostName: localhost Port: 1521 SID: CLRExtProc

Can you please let me know what I am doing wrong? I can connect using the service_name, or when using service name in SID, but why does it not work when I use the SID defined in tnsnames.ora.

As per my understanding, the SID corresponds to the instance name for the database. Is it not possible to connect using it?

Best Regards, Harshit

最满意答案

tnsnames.ora中的CLRExtProc条目用于外部进程 。 这不是您用于普通客户端连接的数据库SID。

ORCL条目定义为使用servicename orcl 。 服务名称和SID可能相同也可能不同。 数据库实例具有单个SID,而它可以具有多个服务名称,其可以包括域。

在您的情况下,似乎没有域,并且SID和服务名称是相同的。 如果要从SQL Developer与SID连接,请使用orcl 。 我不确定为什么你会想要使用它而不是服务名称。 阅读有关访问数据库的更多信息

您也连接AS SYSDBA,可能是SYS,这不是您应该常规做的事情。 希望您不是在内置架构下创建对象; 创建自己的用户/架构,并在其下执行所有操作。

The CLRExtProc entry in the tnsnames.ora is for external processes. That is not the database SID you use for normal client connections.

The ORCL entry is defined to use servicename orcl. The service name and SID may or may not be the same. The database instance has a single SID, while it can have multiple service names, which may include a domain.

In your case it seems there is no domain, and the SID and service name are the same. If you want to connect from SQL Developer with the SID then use orcl. I'm not sure why you would want use that instead of the service name though. Read more about accessing the database.

You are also connecting AS SYSDBA, possibly as SYS, which isn't something you should do routinely. Hopefully you are not creating objects under a built-in schema; create your own user/schema and do everything under that instead.

更多推荐

本文发布于:2023-08-03 15:41:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1393519.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不与   定义   tnsnames   Developer   SQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!