Oracle 默认和非默认监听(一)

2014-11-24 18:59:48 · 作者: · 浏览: 69

一、如果使用默认的1521端口,让实例自动注册到该监听上,那么local_listener无需设置,listener.ora文件按照正常方式配置即可。


二、如果使用非默认1521端口,让实例自动注册到该监听上,那么需要设置local_listerner参数,local_listener = 'lsnr2' (可以动态修改)

三、编辑listener.ora文件,该监听为两个,一个为动态注册使用默认端口,一个为静态注册使用了非默认端口:
LISTENER1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oms)(PORT = 1526))
)


SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /oracle/product/10201)
(PROGRAM = extproc)
)
)


LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oms)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)


三、数据库监听两个启动后的情况,此时数据库未启动,默认的的现在还没有,非默认的现在有了一个静态的:
[oracle@oms admin]$ lsnrctl status


LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-APR-2010 00:12:37


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


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oms)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias listener
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 14-APR-2010 00:07:35
Uptime 0 days 0 hr. 5 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/product/10201/network/admin/listener.ora
Listener Log File /oracle/product/10201/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oms)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
======================
[oracle@oms admin]$ lsnrctl status listener1


LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-APR-2010 00:12:40


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


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oms)(PORT=1526)))
STATUS of the LISTENER
------------------------
Alias listener1
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 14-APR-2010 00:06:56
Uptime 0 days 0 hr. 5 min. 43 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/product/10201/network/admin/listener.ora
Listener Log File /oracle/product/10201/network/log/listener1.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oms)(PORT=1526)))
Services Summary...
Service "guuc" has 1 instance(s).
Instance "cuug", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully


四、启动数据库,观察监听的变化,默认的注册了一个实例,非默认的不变:
[oracle@oms admin]$ lsnrctl status


LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-APR-2010 00:18:40


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


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oms)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias listener
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 14-APR-2010 00: