简体   繁体   English

使用Oracle Sql开发人员(远程)连接到oracle 12c

[英]Connecting to oracle 12c using Oracle Sql developer (remote)

I have been trying to connect to Oracle 12c remotely by using Oracle SQL developer. 我一直在尝试使用Oracle SQL开发人员远程连接到Oracle 12c。 It shows the below error during connecting to the server : 它在连接到服务器时显示以下错误:

 Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection 

I do can connect to oracle database on the server, but the problem is regarding to connect to this server (database) remotely 我可以连接到服务器上的oracle数据库,但问题是远程连接到这个服务器(数据库)

The content of my listener.ora is : 我的listener.ora的内容是:

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
  (SID_NAME = CLRExtProc)
  (ORACLE_HOME = D:\app\ORCLNEWUSER\product\12.1.0\dbhome_1)
  (PROGRAM = extproc)
  (ENVS =  "EXTPROC_DLLS=ONLY:d:\app\ORCLNEWUSER\product\12.1.0\dbhome_1\bin\oraclr12.dll")
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =      
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))     
)
)

Your listener.ora says that is only listening on localhost (127.0.0.1), so nothing will be able to connect from anywhere except the server; 你的listener.ora说它只是在localhost (127.0.0.1)上监听,所以除了服务器之外什么也都无法连接; there is nothing listening on port 1521 on the server's external IP address. 在服务器的外部IP地址上没有侦听端口1521。 You can verify that with lsnrctl status and netstat -ano | find "1521" 您可以使用lsnrctl statusnetstat -ano | find "1521"来验证 netstat -ano | find "1521" . netstat -ano | find "1521"

You need to modify the listener.ora to listen on your server's hostname, or if that isn't resolvable to the correct IP, the external IP address itself - the 'valid IP address' you're trying to connect to from SQL Developer: 您需要修改listener.ora以侦听服务器的主机名,或者如果无法解析到正确的IP,那么外部IP地址本身 - 您尝试从SQL Developer连接的“有效IP地址”:

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =      
  (ADDRESS = (PROTOCOL = TCP)(HOST = my_hostname_or_ip)(PORT = 1521))     
)
)

You may also need to check that your database is able to register successfully. 您可能还需要检查数据库是否能够成功注册。 I'd verify if it is included in lsnctrl services before and after you make that change and restart the listener. 在进行更改并重新启动侦听器之前和之后,我将验证它是否包含在lsnctrl services If it doesn't appear after the restart, and alter system register doesn't make it appear, then you might need to change the local_listener database parameter to tell it the address and port it should register against. 如果在重新启动后没有出现,并且alter system register没有显示,那么您可能需要更改local_listener数据库参数以告诉它应该注册的地址和端口。 That's a separate issue really but could follow on from this change; 这是一个单独的问题,但可以从这个变化中继续下去; there's an example here which might help if it does. 这里有一个例子可能会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM