ITPub博客

首页 > 数据库 > Oracle > 同一个服务器创建两个监听器的话,两个监听器的port和KEY都不能相同

同一个服务器创建两个监听器的话,两个监听器的port和KEY都不能相同

原创 Oracle 作者:lusklusklusk 时间:2017-07-04 15:45:54 0 删除 编辑
总结:同一个服务器创建两个监听器的话,两个监听器的port和KEY不能相同,否则启动第二个监听器时会报错
TNS-01106: Listener using listener name 第一个监听器名称 has already been started



两个监听器的KEY值一样,都是KEY = EXTPROC1521
[orahyprd@mesdg admin]$ cat /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = mesdg.huaqin.com)(PORT = 1521))
    )
  )
ADR_BASE_LISTENER = /u01/app/oracle

[orahyprd@mesdg admin]$ cat /u01/app/orahyprd/product/11.2.0/dbhome_1/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
HYPRD =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = mesdg.huaqin.com)(PORT = 1522))
    )
  )
SID_LIST_HYPRD =
  (SID_LIST =
    (SID_DESC =
      (ORACLE_HOME= /u01/app/orahyprd/product/11.2.0/dbhome_1)
      (SID_NAME = HYPRD)
    )
  )
ADR_BASE_HYPRD = /u01/app/orahyprd




lsnrctl status加不加监听器名称都默认显示第一个监听器的信息,端口都是1521的,并非第二个监听器的1522
[orahyprd@mesdg dbs]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 03-JUL-2017 11:32:02
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                14-FEB-2017 10:20:35
Uptime                    139 days 1 hr. 11 min. 26 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/mesdg/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mesdg.huaqin.com)(PORT=1521)))
Services Summary...
Service "MESDBXDB" has 1 instance(s).
  Instance "MESDB", status READY, has 1 handler(s) for this service...
Service "slave" has 1 instance(s).
  Instance "MESDB", status READY, has 1 handler(s) for this service...
The command completed successfully

[orahyprd@mesdg dbs]$ lsnrctl status HYPRD
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 03-JUL-2017 11:32:07
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                14-FEB-2017 10:20:35
Uptime                    139 days 1 hr. 11 min. 32 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/mesdg/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mesdg.huaqin.com)(PORT=1521)))
Services Summary...
Service "MESDBXDB" has 1 instance(s).
  Instance "MESDB", status READY, has 1 handler(s) for this service...
Service "slave" has 1 instance(s).
  Instance "MESDB", status READY, has 1 handler(s) for this service...
The command completed successfully





lsnrctl start 第二个监听器时报错,说已经存在第一个监听器
[orahyprd@mesdg dbs]$ lsnrctl start HYPRD
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 03-JUL-2017 11:32:23
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
TNS-01106: Listener using listener name LISTENER has already been started




解决方法,修改HYPRD的KEY=EXTPROC1522或干脆去掉这行
KEY=EXTPROC1522

[orahyprd@mesdg admin]$ cat /u01/app/orahyprd/product/11.2.0/dbhome_1/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
HYPRD =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
      (ADDRESS = (PROTOCOL = TCP)(HOST = mesdg.huaqin.com)(PORT = 1522))
    )
  )
SID_LIST_HYPRD =
  (SID_LIST =
    (SID_DESC =
      (ORACLE_HOME= /u01/app/orahyprd/product/11.2.0/dbhome_1)
      (SID_NAME = HYPRD)
    )
  )
ADR_BASE_HYPRD = /u01/app/orahyprd

[orahyprd@mesdg admin]$ lsnrctl start HYPRD
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 03-JUL-2017 11:48:02
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
Starting /u01/app/orahyprd/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/orahyprd/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/orahyprd/diag/tnslsnr/mesdg/hyprd/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mesdg.huaqin.com)(PORT=1522)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=mesdg.huaqin.com)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias                     HYPRD
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                03-JUL-2017 11:48:02
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/orahyprd/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/orahyprd/diag/tnslsnr/mesdg/hyprd/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mesdg.huaqin.com)(PORT=1522)))
Services Summary...
Service "HYPRD" has 1 instance(s).
  Instance "HYPRD", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

[orahyprd@mesdg admin]$ lsnrctl status HYPRD
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 03-JUL-2017 11:48:17
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=mesdg.huaqin.com)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias                     HYPRD
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                03-JUL-2017 11:48:02
Uptime                    0 days 0 hr. 0 min. 15 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/orahyprd/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/orahyprd/diag/tnslsnr/mesdg/hyprd/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mesdg.huaqin.com)(PORT=1522)))
Services Summary...
Service "HYPRD" has 1 instance(s).
  Instance "HYPRD", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully


去掉这行(ADDRESS = (PROTOCOL = IPC)(KEY = XX))
[orahyprd@mesdg admin]$ cat /u01/app/orahyprd/product/11.2.0/dbhome_1/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
HYPRD =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = mesdg.huaqin.com)(PORT = 1522))
    )
  )
SID_LIST_HYPRD =
  (SID_LIST =
    (SID_DESC =
      (ORACLE_HOME= /u01/app/orahyprd/product/11.2.0/dbhome_1)
      (SID_NAME = HYPRD)
    )
  )
ADR_BASE_HYPRD = /u01/app/orahyprd

[orahyprd@mesdg admin]$ lsnrctl start HYPRD
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 03-JUL-2017 11:46:33
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
Starting /u01/app/orahyprd/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/orahyprd/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/orahyprd/diag/tnslsnr/mesdg/hyprd/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mesdg.huaqin.com)(PORT=1522)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=mesdg.huaqin.com)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias                     HYPRD
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                03-JUL-2017 11:46:33
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/orahyprd/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/orahyprd/diag/tnslsnr/mesdg/hyprd/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mesdg.huaqin.com)(PORT=1522)))
Services Summary...
Service "HYPRD" has 1 instance(s).
  Instance "HYPRD", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30126024/viewspace-2141583/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Welcome to Lukes DB HOME。 Oracle OCM、Mysql OCP, 10年DBA工作经验,博客仅记录自己的一个学习过程,不代表完全准确,如有需要,欢迎转载。

注册时间:2015-02-02

  • 博文量
    348
  • 访问量
    1175009