关于local_listener、remote_listener、current_listener

本文详细介绍了Oracle数据库中local_listener参数的作用及配置方法,并解释了如何通过设置local_listener参数实现pmon动态注册监听器。此外,还介绍了remote_listener和current_listener的概念及应用场景。

--整理以前的学习笔记

1、local_listener
local_listener参数的作用!
pmon只会动态注册port等于1521的监听,否则pmon不能动态注册listener,要想让pmon动态注册listener,需要设置

local_listener参数。

配置了两个listener(listener.ora)
LISTENER2 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = mylinux)(PORT = 1522))
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = mylinux)(PORT = 1521))
    )
  )
 
alter system set local_listener=listener2;
alter system set local_listener=listener2
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER2'

需要在tnsnames.ora中配置过才行(tnsnames.ora)
LISTENER2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = mylinux)(PORT = 1522))
  )
(这里的"listener2"的名字不一定要与监听器(listener2)的名字相同,但是要与local_listener的参数值相同)

alter system set local_listener=listener2;--现在就可以成功执行了,此处local_listener由名称指定,
只有将此名称解析为地址,实例才能找到侦听器并执行注册

当然也可以在参数中硬编码侦听器的地址
alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = mylinux)(PORT = 1522))';

此时如果把两个监听器都打开
lsnrctl start listener
lsnrctl start listener2

再启动实例startup

可以看到实例注册的是listener2这个监听

2、remote_listener用在RAC环境中,监听器与实例不在同一台机器上
待以后补上

3、current_listener当前监听器
先使用lsnrctl命令来进入监听器,再设置当前监听器
LSNRCTL> set current_listener listener2
Current Listener is listener2
那么接下来的stop start status等命令都是针对当前监听器listener2

如果不设置的话那么进入监听器之后默认的监听器是listener

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

转载于:http://blog.itpub.net/26524307/viewspace-1061151/

C:\Users\24012\.jdks\ms-17.0.16\bin\java.exe -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:59714,suspend=y,server=n -agentpath:C:\Users\24012\AppData\Local\Temp\idea_libasyncProfiler_dll_temp_folder9\libasyncProfiler.dll=version,jfr,event=wall,interval=10ms,cstack=no,file=C:\Users\24012\IdeaSnapshots\JiuyunUcServiceApplication_2025_10_10_161701.jfr,dbghelppath=C:\Users\24012\AppData\Local\Temp\idea_dbghelp_dll_temp_folder9\dbghelp.dll,log=C:\Users\24012\AppData\Local\Temp\JiuyunUcServiceApplication_2025_10_10_161701.jfr.log.txt,logLevel=DEBUG -XX:TieredStopAtLevel=1 -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-Dmanagement.endpoints.jmx.exposure.include=*" -javaagent:C:\Users\24012\AppData\Local\JetBrains\IntelliJIdea2024.3\captureAgent\debugger-agent.jar -Dkotlinx.coroutines.debug.enable.creation.stack.trace=false -Ddebugger.agent.enable.coroutines=true -Dkotlinx.coroutines.debug.enable.flows.stack.trace=true -Dkotlinx.coroutines.debug.enable.mutable.state.flows.stack.trace=true -Dfile.encoding=UTF-8 @C:\Users\24012\AppData\Local\Temp\idea_arg_file1472514120 com.jiuyun.JiuyunUcServiceApplication 已连接到地址为 ''127.0.0.1:59714',传输: '套接字'' 的目标虚拟机 2025-10-10T16:17:06.616+08:00 INFO 21360 --- [ main] c.alibaba.nacos.client.utils.ParamUtil : [settings] [req-serv] nacos-server port:8848 2025-10-10T16:17:06.633+08:00 INFO 21360 --- [ main] c.alibaba.nacos.client.utils.ParamUtil : [settings] [http-client] connect timeout:1000 2025-10-10T16:17:06.634+08:00 INFO 21360 --- [ Thread-1] c.a.n.c.a.r.identify.CredentialWatcher : null No credential found 2025-10-10T16:17:06.636+08:00 INFO 21360 --- [ main] c.alibaba.nacos.client.utils.ParamUtil : PER_TASK_CONFIG_SIZE: 3000.0 2025-10-10T16:17:06.695+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.labels : DefaultLabelsCollectorManager get labels..... 2025-10-10T16:17:06.696+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.labels : Process LabelsCollector with [name:defaultNacosLabelsCollector] 2025-10-10T16:17:06.696+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.labels : default nacos collect properties raw labels: null 2025-10-10T16:17:06.698+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.labels : default nacos collect properties labels: {} 2025-10-10T16:17:06.699+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.labels : default nacos collect jvm raw labels: null 2025-10-10T16:17:06.699+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.labels : default nacos collect jvm labels: {} 2025-10-10T16:17:06.699+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.labels : default nacos collect env raw labels: null 2025-10-10T16:17:06.699+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.labels : default nacos collect env labels: {} 2025-10-10T16:17:06.700+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.labels : DefaultLabelsCollectorManager get labels finished,labels :{} 2025-10-10T16:17:06.719+08:00 INFO 21360 --- [ main] c.a.n.p.a.s.c.ClientAuthPluginManager : [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success. 2025-10-10T16:17:06.720+08:00 INFO 21360 --- [ main] c.a.n.p.a.s.c.ClientAuthPluginManager : [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success. . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v3.4.2) 2025-10-10T16:17:07.725+08:00 INFO 21360 --- [ main] c.a.n.c.c.impl.LocalConfigInfoProcessor : LOCAL_SNAPSHOT_PATH:C:\Users\24012\nacos\config 2025-10-10T16:17:07.731+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.remote.client : [RpcClientFactory] create a new rpc client of 6f83f9f9-b2cb-48dc-83a6-971d90af8159_config-0 2025-10-10T16:17:07.763+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.remote.client : [6f83f9f9-b2cb-48dc-83a6-971d90af8159_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda$767/0x000001d85048ad88 2025-10-10T16:17:07.763+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.remote.client : [6f83f9f9-b2cb-48dc-83a6-971d90af8159_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda$768/0x000001d85048b1a8 2025-10-10T16:17:07.765+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.remote.client : [6f83f9f9-b2cb-48dc-83a6-971d90af8159_config-0] Registry connection listener to current client:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$1 2025-10-10T16:17:07.765+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.remote.client : [6f83f9f9-b2cb-48dc-83a6-971d90af8159_config-0] RpcClient init, ServerListFactory = com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$2 2025-10-10T16:17:07.775+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.remote.client : [6f83f9f9-b2cb-48dc-83a6-971d90af8159_config-0] Try to connect to server on start up, server: {serverIp = '127.0.0.1', server main port = 8848} 2025-10-10T16:17:07.834+08:00 INFO 21360 --- [ main] c.a.n.c.remote.client.grpc.GrpcClient : grpc client connection server:127.0.0.1 ip,serverPort:9848,grpcTslConfig:{"sslProvider":"","enableTls":false,"mutualAuthEnable":false,"trustAll":false} 2025-10-10T16:17:10.018+08:00 INFO 21360 --- [ main] c.a.n.c.a.AbstractAbilityControlManager : Ready to get current node abilities... 2025-10-10T16:17:10.021+08:00 INFO 21360 --- [ main] c.a.n.c.a.AbstractAbilityControlManager : Ready to initialize current node abilities, support modes: [SDK_CLIENT] 2025-10-10T16:17:10.022+08:00 INFO 21360 --- [ main] c.a.n.c.a.AbstractAbilityControlManager : Initialize current abilities finish... 2025-10-10T16:17:10.023+08:00 INFO 21360 --- [ main] c.a.n.c.a.d.NacosAbilityManagerHolder : [AbilityControlManager] Successfully initialize AbilityControlManager 2025-10-10T16:17:10.061+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.remote.client : [6f83f9f9-b2cb-48dc-83a6-971d90af8159_config-0] Success to connect to server [127.0.0.1:8848] on start up, connectionId = 1760084229800_127.0.0.1_59736 2025-10-10T16:17:10.063+08:00 INFO 21360 --- [remote.worker.0] com.alibaba.nacos.common.remote.client : [6f83f9f9-b2cb-48dc-83a6-971d90af8159_config-0] Notify connected event to listeners. 2025-10-10T16:17:10.064+08:00 INFO 21360 --- [remote.worker.0] c.a.n.client.config.impl.ClientWorker : [6f83f9f9-b2cb-48dc-83a6-971d90af8159_config-0] Connected,notify listen context... 2025-10-10T16:17:10.064+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.remote.client : [6f83f9f9-b2cb-48dc-83a6-971d90af8159_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler 2025-10-10T16:17:10.064+08:00 INFO 21360 --- [ main] com.alibaba.nacos.common.remote.client : [6f83f9f9-b2cb-48dc-83a6-971d90af8159_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$$Lambda$787/0x000001d8505d3a50 2025-10-10T16:17:10.184+08:00 INFO 21360 --- [ main] c.a.nacos.client.config.impl.Limiter : limitTime:5.0 2025-10-10T16:17:10.230+08:00 WARN 21360 --- [ main] c.a.c.n.c.NacosPropertySourceBuilder : Ignore the empty nacos configuration and get it based on dataId[null.properties] & group[DEFAULT_GROUP] 2025-10-10T16:17:10.233+08:00 INFO 21360 --- [ main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-null.properties,DEFAULT_GROUP'}] 2025-10-10T16:17:10.250+08:00 INFO 21360 --- [ main] com.jiuyun.JiuyunUcServiceApplication : No active profile set, falling back to 1 default profile: "default" 2025-10-10T16:17:12.913+08:00 WARN 21360 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'jiuyun-uc-server.FeignClientSpecification' defined in null: Cannot register bean definition [Generic bean: class=org.springframework.cloud.openfeign.FeignClientSpecification; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; fallback=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null] for bean 'jiuyun-uc-server.FeignClientSpecification' since there is already [Generic bean: class=org.springframework.cloud.openfeign.FeignClientSpecification; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; fallback=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null] bound. 2025-10-10T16:17:12.935+08:00 INFO 21360 --- [ main] .s.b.a.l.ConditionEvaluationReportLogger : Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 2025-10-10T16:17:12.979+08:00 ERROR 21360 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START *************************** Description: The bean 'jiuyun-uc-server.FeignClientSpecification' could not be registered. A bean with that name has already been defined and overriding is disabled. Action: Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true 2025-10-10T16:17:12.982+08:00 WARN 21360 --- [ Thread-2] c.a.n.common.http.HttpClientBeanHolder : [HttpClientBeanHolder] Start destroying common HttpClient 2025-10-10T16:17:12.982+08:00 WARN 21360 --- [ Thread-5] c.a.nacos.common.notify.NotifyCenter : [NotifyCenter] Start destroying Publisher 2025-10-10T16:17:12.983+08:00 WARN 21360 --- [ Thread-5] c.a.nacos.common.notify.NotifyCenter : [NotifyCenter] Destruction of the end 2025-10-10T16:17:12.984+08:00 WARN 21360 --- [ Thread-2] c.a.n.common.http.HttpClientBeanHolder : [HttpClientBeanHolder] Destruction of the end 已与地址为 ''127.0.0.1:59714',传输: '套接字'' 的目标虚拟机断开连接 进程已结束,退出代码为 1
最新发布
10-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值