Oracle 侦听远程连接的更改端口

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2771800/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 20:33:57  来源:igfitidea点击:

Oracle listening on changing port for remote connections

oracleportlisteneroracle11g

提问by tsauerwein

I installed Oracle 11gR2 and I am now trying to access the database from a remote system.

我安装了 Oracle 11gR2,现在正在尝试从远程系统访问数据库。

My listener.ora is still the default:

我的 listener.ora 仍然是默认的:

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

ADR_BASE_LISTENER = /media/oracle/app/oracle

./lsnrctl servicesreturns this:

./lsnrctl services返回这个:

oracle@ubuntu:/media/oracle/app/oracle/product/11.2.0/dbhome_1/bin$ ./lsnrctl services

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 05-MAY-2010 05:00:49

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
Services Summary...
Service "gis.c2c" has 1 instance(s).
  Instance "gis", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
Service "gisXDB.c2c" has 1 instance(s).
  Instance "gis", status READY, has 1 handler(s) for this service...
    Handler(s):
      "D000" established:0 refused:0 current:0 max:972 state:ready
         DISPATCHER <machine: ubuntu, pid: 2916>
         (ADDRESS=(PROTOCOL=tcp)(HOST=ubuntu.localdomain)(PORT=47616))
The command completed successfully

I am not able to get a remote connection using port 1521, but the above listed port 47616 works. I wouldn't mind using a different port than 1521, but the problem is that this port changes on every reboot.

我无法使用端口 1521 获得远程连接,但上面列出的端口 47616 有效。我不介意使用与 1521 不同的端口,但问题是此端口在每次重新启动时都会更改。

What is going wrong?

出了什么问题?

Thanks!

谢谢!

回答by Juraj

This is not programming question, maybe it belongs to serverfault.

这不是编程问题,也许它属于服务器故障。

However, I would think of following:

但是,我会想到以下几点:

Is localhost defined in /etc/hosts ? And, if you want to access the listener from network, you should not be listening on localhost, but on external address.

localhost 是否在 /etc/hosts 中定义?而且,如果您想从网络访问侦听器,则不应在 localhost 上侦听,而应在外部地址上进行侦听。

Is the port 1521 available? Verify by running netstat -tlnp .

1521端口是否可用?通过运行 netstat -tlnp 进行验证。