在侦听器启动期间不会读取Oracle数据库listener.ora配置

时间:2012-12-27 06:00:51

标签: oracle oracle11g

我已经配置了以下两个oracle数据库的配置文件。

/opt/oracle/11.2.0/network/admin/listener.ora有以下值

ADR_BASE_LISTENER = /opt/oracle



LISTENER_JIPDB =
  (DESCRIPTION_LIST =
          (DESCRIPTION =
                (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1530))
          )
  )

SID_LIST_LSNR_JIPDB =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = DWJP02T)
      (ORACLE_HOME = /opt/oracle/11.2.0)
      (SID_NAME = DWJP02T)
    )
  )

我配置了/opt/oracle/11.2.0/network/admin/tnsnames.ora 文件具有以下值

LISTENER_JIPDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain )(PORT = 1530))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = DWJP02T)
    )
  )

我的问题是当我尝试通过输入以下命令启动oracle listner时, 它在1521端口打开DWJP02T SID实例,我不知道它是如何获取此端口或从它读取此端口的位置,我已配置为在.ora文件上读取1530。

这是我启动列表器时得到的输出

[ora112@localhost ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 26-DEC-2012 22:48:16

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

Starting /opt/oracle/11.2.0/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /opt/oracle/11.2.0/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                26-DEC-2012 22:48:16
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/11.2.0/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
The listener supports no services
The command completed successfully

请帮助我理解为什么它在不同的端口上打开数据库,而不是我开始配置它。我重新启动了数据库和服务器,看它是否会读取listner.ora文件中的值,但仍然没有运气。

1 个答案:

答案 0 :(得分:5)

尝试以下步骤提供请求:

  • 使用以下命令停止Oracle侦听器:

    lsnrctl stop
    
  • 更改Oracle listener.ora文件中的端口号。例如,从默认端口1522到1521。

  • 更改tnsnames.ora文件中的端口号,如下例所示,其中host_name是您的主机名,server_name是您的服务器名称。

  • 使用以下命令重新启动Oracle侦听器:

    lsnrctl start
    
  • 更改数据库正在侦听的端口:

    sqlplus / as sysdba        
    > alter system set LOCAL_LISTENER="(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1522))";        
    > alter system register;