同一個伺服器建立兩個監聽器的話,兩個監聽器的port和KEY都不能相同

lusklusklusk發表於2017-07-04
總結:同一個伺服器建立兩個監聽器的話,兩個監聽器的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部落格 ” ,連結:http://blog.itpub.net/30126024/viewspace-2141583/,如需轉載,請註明出處,否則將追究法律責任。

相關文章