Oracle监听文件配置详情

合集下载
相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

有关ORACLE的Listener.ora文件一直只是配置了下简单的几个参数,前几天设置DG_BROKER的时候发现里面参数还是挺多的,所以找了个时间仔细看了下示例配置文件,将一些心得记录一下。


#
# This parameter specifies both the name of the listener, and
# it listening address(es). Other parameters for this listener
# us this name in place of . When not specified,
# the name for defaults to "LISTENER", with the default
# address value as shown below.


参数说明里的解释,用来表示监听对象,默认情况下监听名为LISTENER,通过
命令LSNRCTL START/STOP 启动和停止的就是LISTENER,如果服务器上有多个监听,
那么就需要加以区分,用到lsnr这个参数了,出去默认的监听LISTENER,其他的监听
通过其他名字来命名,启动和停止则通过 LSNRCTL START/STOP LISTENER_XXX来进行。


例如:
# LISTENER =
# (ADDRESS_LIST=
# (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
# (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))


# LISTENER_dg =
# (ADDRESS_LIST=
# (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522))
# (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))

这里主要是用来区分LISTENER是监视1521端口,而LISTENER_dg用来监视1522端口。


SID_LIST_

# List of services the listener knows about and can connect
# clients to. There is no default. See the Net8 Administrator's
# Guide for more information.

通过注释也可以得知,这个参数是用来告诉ORACLE所启动的数据库的详细信息,是一个老的
参数,因为8I之前的版本都是静态注册,一定要在监听配置文件里面详细记录数据库的各信息,
而9I之后ORACLE已经由静态注册转为动态注册,那么这个参数在正常情况下就暂时用不上了,但是
在一些特殊情况下,这个参数还是会用上,比如通过RMAN来创建DATA GUARD的备库,以及通过
DATA GUARD BROKER来管理数据库,因为默认情况下数据库在NOMOUNT下才会启动监听,也就是说
动态监听在NOMOUNT下才会启作用,但是在静态监听下,ORACLE可以通过特殊的通道连接指定的数据库,
然后执行相关的动作,这个以后再详细讨论,这里不做过多的研究。

SID_LIST的典型配置如下:


# SID_LIST_LISTENER=
# (SID_LIST=
# (SID_DESC=
# #BEQUEATH CONFIG
# (GLOBAL_DBNAME=salesdb.mycompany)
# (SID_NAME=sid1)
# (ORACLE_HOME=/private/app/oracle/product/8.0.3)
# #PRESPAWN CONFIG
# (PRESPAWN_MAX=20)
# (PRESPAWN_LIST=
# (PRESPAWN_DESC=(PROTOCOL=tcp)(POOL_SIZE=2)(TIMEOUT=1))
# )
# )
# )

SID_LIST列出了当前数据库服务器下的可用实例,SID_DESC则是示例的描述,依次如下:
GLOBAL_DBNAME ----------数据库

的全剧配置名,默认为db_name.domain_name
SID_NAME ----------数据库的服务名,参考SERVICE_NAME和ORACLE_SID
ORACLE_HOME ----------ORACLE的软件目录位置,在安装时会设置
PRESPAWN_MAX ----------
PRESPAWN_LIST ----------




PASSWORDS_lsnr
# PASSWORDS_
# Specifies a password to authenticate stopping the listener.
# Both encrypted and plain-text values can be set. Encrypted passwords
# can be set and stored using lsnrctl.
# LSNRCTL> change_password
# Will prompt for old and new passwords, and use encryption both
# to match the old password and to set the new one.
# LSNRCTL> set password
# Will prompt for the new password, for authentication with
# the listener. The password must be set before running the next
# command.
# LSNRCTL> save_config
# Will save the changed password to listener.ora. These last two
# steps are not necessary if SAVE_CONFIG_ON_STOP_ is ON.
# See below.
#
# Default: NONE
#
# PASSWORDS_LISTENER = 20A22647832FB454 # "foobar"



看帮助的注释是用来设置监听启动和停止的密码,以有用户意外停止了监听。




SAVE_CONFIG_ON_STOP_
# Tells the listener to save configuration changes to listener.ora when
# it shuts down. Changed parameter values will be written to the file,
# while preserving formatting and comments.
# Default: OFF
# Values: ON/OFF
#
# SAVE_CONFIG_ON_STOP_LISTENER = ON

此参数用去设置参数保存的策略,模型情况为为OFF,也就是在监听启动状态下对监听所做的
修改在监听停止后都不记录参数文件。



上面几个参数是监听文件里面最重要的参数了,列出了数据库的详细信息,以下的就是监听
日志相关的参数,用于在监听出现问题的时候查找相关的诊断资料。

# LOG_FILE_
# Sets the name of the listener's log file. The .log extension
# is added automatically.
# Default=
#
# LOG_FILE_LISTENER = lsnr

# LOG_DIRECTORY_
# Sets the directory for the listener's log file.
# Default: /network/log
66,1 69%
# PASSWORDS_LISTENER = 20A22647832FB454 # "foobar"

# SAVE_CONFIG_ON_STOP_
# Tells the listener to save configuration changes to listener.ora when
# it shuts down. Changed parameter values will be written to the file,
# while preserving formatting and comments.
# Default: OFF
# Values: ON/OFF
#
# SAVE_CONFIG_ON_STOP_LISTENER = ON

# USE_PLUG_AND_PLAY_
# Tells the listener to contact an Onames server and register itself
# and its services with Onames.
# Values: ON/OFF
# Default: OFF
#
# USE_PLUG_AND_PLAY_LISTENER = ON

# LOG_FILE_
# Sets the name of the listener's log file. The .log extension
# is added automatically.

# Default=
#
# LOG_FILE_LISTENER = lsnr

# LOG_DIRECTORY_
# Sets the directory for the listener's log file.
# Default: /network/log
#
# LOG_DIRECTORY_LISTENER = /private/app/oracle/product/8.0.3/network/log

# TRACE_LEVEL_
# Specifies desired tracing level.
# Default: OFF
# Values: OFF/USER/ADMIN/SUPPORT/0-16
#
# TRACE_LEVEL_LISTENER = SUPPORT

# TRACE_FILE_
# Sets the name of the listener's trace file. The .trc extension
# is added automatically.
# Default:
#
# TRACE_FILE_LISTENER = lsnr

# TRACE_DIRECTORY_
# Sets the directory for the listener's trace file.
# Default: /network/trace
#
# TRACE_DIRECTORY_LISTENER=/private/app/oracle/product/8.0.3/network/trace
# CONNECT_TIMEOUT_
# Sets the number of seconds that the listener waits to get a
# valid database query after it has been started.
# Default: 10


CONNECT_TIMEOUT_LISTENER

# CONNECT_TIMEOUT_LISTENER=10


此参数用于设置监听连接的持有时间,如果10分钟无动作则自动断开连接,此设定默认情况下
为OFF










相关文档
最新文档