How to Create Multiple Oracle Listeners and Multiple Listener Addresses

文章摘自MOS文档: How to Create Multiple Oracle Listeners and Multiple Listener Addresses (文档 ID 232010.1)

APPLIES TO:

Oracle Net Services
Information in this document applies to any platform.
Checked for relevance on 08-OCT-2009.
***Checked for relevance on 27-nov-2012*** 

PURPOSE

Describes how to configure multiple listeners with multiple listener addresses.

SCOPE

Intended for anyone requiring multiple listeners or multiple listener endpoints.

DETAILS

 

Important items to note before you begin editing your listener.ora file:  

a. IPC KEY values cannot be duplicated across multiple listeners or in a single listener. 
b. TCP Port values cannot be duplicated across multiple listeners or in a single listener 
running on a single nic/ip address. 
(an exception to this is when multiple nics/IP addresses are used, Reference below) 
c. Unless the Intelligent agent is used or an External Procedure listener is required, 
SID_LIST_ is not necessary for Oracle version 8i 
and newer. 
d. Non default port specifications in the listener.ora file (1521 is default) require the 
init.ora file parameter LOCAL_LISTENER be set in order for dynamic registration to work. 
e. The version 9i database requires a version 9i or newer listener. 
f.  Never place parenthesis up against the far left margin in the actual listener.ora file.

I. Example of a single listener with multiple listening addresses 
LISTENER =  
    (DESCRIPTION=
       (ADDRESS = (PROTOCOL = IPC)(KEY = ORCL))  
       (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))  
       (ADDRESS = (PROTOCOL = TCP)(HOST = hostname.com)(PORT = 1521))  
       (ADDRESS = (PROTOCOL = TCP)(HOST = hostname.com)(PORT = 1526)))

 

Note the unique KEY values and PORT numbers.


The pfile parameter  LOCAL_LISTENER would be set for all instances serviced by this listener to 
LOCAL_LISTENER=LSNR_ALIAS.  Where LSNR_ALIAS would be defined in the tnsnames.ora file that is local to the database (make sure that if you use a NAMES.DEFAULT_DOMAIN parameter in the sqlnet.ora file, that you include the same domain value appended to the LSNR_ALIAS in the tnsnames.ora file). 

Example tnsnames.ora file entry for LOCAL_LISTENER:

LSNR_ALIAS.DOMAIN =  
       (DESCRIPTION=
         (ADDRESS = (PROTOCOL = TCP)(HOST = hostname.com)(PORT = 1521))  
         (ADDRESS = (PROTOCOL = TCP)(HOST = hostname.com)(PORT = 1526))) 
   

This will allow PMON to dynamically register the instance against the listener at both 
addresses. 
See  Note 76636.1   in Reference section for complete explanation
See also  BUG:9557294  for issue with using ADDRESS_LIST for LOCAL_LISTENER connect string.

II. Example of multiple listeners using non-default listener names 


The following example shows a single listener.ora file configured for 2 non-default listener names. 
LSNR817 and LSNR901. LSNR817 is servicing a pre-8i database installed in a separate 
ORACLE_HOME. Note the ORACLE_HOME value in the SID_DESC section. 

Listener.ora file
LSNR817 =  
   (ADDRESS_LIST =  
     (ADDRESS = (PROTOCOL = IPC)(KEY = V817))  
     (ADDRESS = (PROTOCOL = IPC)(KEY = extproc1))  
     (ADDRESS = (PROTOCOL = TCP)(HOST = hostname.com)(PORT = 1522))  
  )  
SID_LIST_LSNR817=  
    (SID_LIST =  
       (SID_DESC =  
       (SID_NAME = V817)  
       (ORACLE_HOME=c:\Oracle\ora81)  
       )  
       (SID_DESC =  
       (SID_NAME = ORCL806)  
       (ORACLE_HOME=c:\Orant)  
       )   
       (SID_DESC =  
       (SID_NAME = extproc)  
       (ORACLE_HOME=c:\Oracle\ora81)  
       (PROGRAM = extproc)  
      )  
   )  



LSNR901 =  
   (ADDRESS_LIST =  
      (ADDRESS = (PROTOCOL = IPC)(KEY = V901))  
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))  
      (ADDRESS = (PROTOCOL = TCP)(HOST = NT1)(PORT = 1521))  
   )  
SID_LIST_LSNR901=  
    (SID_LIST=  
       (SID_DESC=  
       (SID_NAME = extproc)  
       (ORACLE_HOME=c:\Oracle\ora81)  
       (PROGRAM = extproc)  
      )  
    ) 


Additional notes:


The same rules as section I apply here. No duplicate KEY values for IPC and no 
duplicate port numbers for TCP. 

LOCAL_LISTENER should be set for non-default (1521 is default) ports so that PMON can dynamically register the instance(s).


The LSNRCTL utility will require that you specify the non-default listener name 
when issuing commands: 

e.g. 
C:\> lsnrctl start LSNR901  
C:\> lsnrctl status LSNR901  

Alternatively,  

c:\>lsnrctl  
lsnrctl>set current_listener LSNR901  
lsnrctl>status 



When starting listeners for different versions of Oracle be sure to 
have the Windows Oracle 'Home Selector' or the UNIX env variable 
ORACLE_HOME set to point to the correct location. 

Troubleshooting 

If lsnrctl start yields any of the following errors: 

ORA-12542 TNS:address already in use. 
TNS-1106 Listener using listener name %s has already been started 

ORA-12542 occurs when the port specified in the listener.ora file is already in use by another process. 
Typically another listener process is already running. Check netstat -an |grep on . 

TNS-1106 occurs when a KEY value has been duplicated. e.g. A listener using KEY=EXTPROC 
is already running when you attempt to start a listener configured with KEY=EXTPROC. 


References


Note 76636.1   Service Registration in Net 8i 
Note 118999.1   ORA-12560: Starting the Listener on Windows-Troubleshooting 
Note 226880.1   Configuration of Load Balancing and Transparent Application Failover 
Note 161634.1  Configuring the Database Listener for External Procedures

REFERENCES

BUG:9557294 - DYNAMIC REGISTRATION DOESN'T WORK WITH LISTENERS HAVING MULTIPLE ENDPOINTS

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

转载于:http://blog.itpub.net/29953799/viewspace-1578304/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值