Oracle Dynamically Listener(动态监听)

在$ORACLE_HOME/network/admin目录下面没有listener.ora,tnsnames.ora,sqlnet.ora文件,只有一个sample的模版目录和一个shrept.lst的文件,这些都没有配置的情况下,lsnrctl start竟然能够正常的启动监听服务,lsnrctl开启了LISTENER进程,并且有相关的日志文件?


查询了下LISTENER相关官方定义:
    A listener is configured with one or more listening protocol addresses, information about supported services, and parameters that control its run-time behavior. The listener configuration is stored in a configuration file named  listener.ora .Because all of the configuration parameters have default values, it is possible to start and use a listener with no configuration. This default listener has a name of  LISTENER ,supports no services on startup, and listens on the following TCP/IP protocol address:(ADDRESS=(PROTOCOL=tcp)(HOST=host_name)(PORT=1521))
一个 监听被配置1个或者多个监听协议地址,关于支持的服务信息和控制运行行为的参数。这个配置信息存储在listener.ora配置文件中。因为所有的配置参数都有默认值,所以它可以在没有配置的情况下去启动和使用一个监听。LISTENER是默认监听名,可以支持没有services下基于tcp/ip启动并监听。 (ADDRESS=(PROTOCOL=tcp)(HOST=host_name)(PORT=1521))

    The listener forwards client requests to supported services. These services can be configured statically in the  listener.ora file or they can be dynamically registered with the listener. This dynamic registration feature is called service registration. The registration is performed by the PMON process, an instance background process of each database instance that is configured in the database initialization parameter file.Dynamic service registration does not require any manual configuration in the listener.ora file.
    监听转发客户端请求给支持的service.这些services 能被静态注册在listener.ora中,或者也可以动态注册。动态注册的功能被称之为 service registration.该注册是由pmon(每 一个被初始化参数配置过的数据库实例的后台进程)执行。动态注册不需要在listener.ora中做任何手动配置。


Setting Initialization Parameters for Service Registration(动态注册
To ensure service registration works properly, the initialization parameter file should
contain the following parameters:
■ SERVICE_NAMES for the database service name
■ INSTANCE_NAME for the instance name
■ LOCAL_LISTENER for the local listener
■ REMOTE_LISTENER for the remote listener, if any

监听程序是通过pmon进程来进行管理的,pmon进程会每隔一分钟将数据库服务进程注册
但是,pmon进程只向默认的1521端口进行监听的注册,当监听不再1521端口上时,需要以下的方法来实现:
1、直接在Oracle init Parameter中修改local_listener值,输入监听地址,pmon进程会根据此信息,进行相关的监听注册
alter system set local_listener='(address=(protocol=tcp)(port=5555)(host=localhost))';
2、在参数local_listener中只输入监听的名称,在tnsnames.ora中配置监听端口
alter system set local_listener='test';
在$ORACLE_HOME/network/admin/tnsnames.ora中包含监听地址,pmon进程会从此处获得监听信息,并进行注册
TEST = (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.200)(PORT=5555))
3、pmon进程每一分钟注册一次监听,当监听刚刚启动的时候,可能还没有进行相关的注册,这个时候的监听服务是不能够使用的
4、在修改local_listener参数时,pmon进程也会重新注册一次
5、如果数据库shutdown之后,pmon进程也会相应的终止,服务会从监听中删除,这时只能使用os认证的方式连接到数据库

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

转载于:http://blog.itpub.net/30264304/viewspace-1728668/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值