Oracle 监听更改端口以进行远程连接

发布于 2024-08-31 17:27:38 字数 1375 浏览 10 评论 0原文

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

我的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 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

我无法使用端口1521获得远程连接,但上面列出的端口47616可以工作。我不介意使用 1521 以外的端口,但问题是该端口在每次重新启动时都会发生变化。

出了什么问题?

谢谢!

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

My listener.ora is still the default:

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

ADR_BASE_LISTENER = /media/oracle/app/oracle

./lsnrctl services returns this:

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.

What is going wrong?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光无声 2024-09-07 17:27:38

这不是编程问题,可能属于服务器故障。

但是,我会想到以下内容:

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

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

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.

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文