欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Oracle 11g2的监听器配置教程

程序员文章站 2023-10-22 22:38:34
oracle的监听器服务注册方式有两种,分别为动态和静态。通过动态注册的服务在lsnrctl status时显示的状态为ready,静态的服务为unknown。 11g2以...
oracle的监听器服务注册方式有两种,分别为动态和静态。通过动态注册的服务在lsnrctl status时显示的状态为ready,静态的服务为unknown。
11g2以前的版本,监听器通过listener.ora文件进行配置。在11g2版本中,监听器的配置方式发生了变化,增加了一个新的配置文件endpoints_listener.ora,并且此文件和原来的listener.ora文件都转移到$grid_home/network/admin目录下了。

11g2的监听器的配置信息保存在$grid_home/network/admin/listener.ora和endpoints_listener.ora两个文件中。
文件endpoints_listener.ora的内容如下:
.ora代码
复制代码 代码如下:

listener_serv2=
(description=
(
address_list=
(address=(protocol=tcp)(host=xxdb2-vip)(port=1551))
(address=(protocol=tcp)(host=10.10.10.100)(port=1551)(ip=first))
)
)

文件listener.ora的内容如下:
.ora代码
复制代码 代码如下:

listener=(description=(address_list=(address=(protocol=ipc)(key=listener)))) # line added by agent
listener_scan1=(description=(address_list=(address=(protocol=ipc)(key=listener_scan1)))) # line added by agent
enable_global_dynamic_endpoint_listener_scan1=on # line added by agent
enable_global_dynamic_endpoint_listener=on # line added by agent
enable_global_dynamic_endpoint_listener_wfg=on # line added by agent

.ora代码
##静态服务注册添加条目
复制代码 代码如下:

sid_list_listener =
(sid_list =
(sid_desc =
(global_dbname = servdb)
(oracle_home = /u01/oracle/app/oracle/product/10.2.0/db)
(sid_name = servdb1)
)
)

如果需要添加静态注册的服务,和以前版本一样是在listener.ora文件中添加相应的条目。
使用lsnrctl status listener检查监听器状态,如下:
log代码
复制代码 代码如下:

lsnrctl for linux: version 11.2.0.3.0 - production on 29-nov-2012 14:18:34
copyright (c) 1991, 2011, oracle. all rights reserved.
connecting to (description=(address=(protocol=ipc)(key=listener)))
status of the listener
------------------------
alias listener
version tnslsnr for linux: version 11.2.0.3.0 - production
start date 29-nov-2012 14:11:17
uptime 0 days 0 hr. 7 min. 17 sec
trace level off
security on: local os authentication
snmp off
listener parameter file /u01/app/11.2.0.3/grid/network/admin/listener.ora
listener log file /u01/app/grid/diag/tnslsnr/serv2/listener/alert/log.xml
listening endpoints summary...
(description=(address=(protocol=ipc)(key=listener)))
(description=(address=(protocol=tcp)(host=10.10.10.100)(port=1521)))
(description=(address=(protocol=tcp)(host=10.10.10.101)(port=1521)))
services summary...
service "+asm" has 1 instance(s).
instance "+asm2", status ready, has 1 handler(s) for this service...
service "servdg2" has 1 instance(s).
instance "servdb1", status ready, has 1 handler(s) for this service...
service "servdg2_xpt" has 1 instance(s).
instance "servdb1", status ready, has 1 handler(s) for this service...
service "elvdb" has 2 instance(s).
instance "elvdb1", status unknown, has 1 handler(s) for this service...
instance "elvdb2", status ready, has 1 handler(s) for this service...
service "elvdbxdb" has 1 instance(s).
instance "elvdb2", status ready, has 1 handler(s) for this service...
the command completed successfully

在11g2的grid infrastructure上安装oracle 10g,10g的监听器配置文件也要采用$grid_home/network/admin下的文件。
但需要做一个折中操作,将10g的$oracle_home/network/admin下listener.ora文件设置为$grid_home/network/admin下endpoints_listener.ora的文件链接。