使用LOCAL_LISTENER参数进行多监听动态注册
在默认情况下,oracle使用1521作为默认端口进行动态注册,而共享服务器模式则必须通过动态注册方式进行配置。
但是如果有多个监听需要同时进行动态注册怎么办呢?我们可以利用LOCAL_LISTENER参数进行配置。
但是如果有多个监听需要同时进行动态注册怎么办呢?我们可以利用LOCAL_LISTENER参数进行配置。
第一种方式:直接将监听信息配置在参数里面,这种方式比较简单,但是看起来比较乱也不能配置太多的监听。
设置LOCAL_LISTENER=(ADDRESS_LIST=(ADDRESS = (PROTOCOL = TCP)(HOST = RHEL4)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = RHEL4)(PORT = 1522)))
设置LOCAL_LISTENER=(ADDRESS_LIST=(ADDRESS = (PROTOCOL = TCP)(HOST = RHEL4)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = RHEL4)(PORT = 1522)))
第二种方式:通过TNS名字进行地址解析
LOCAL_LSNR =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = RHEL4)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST = RHEL4)(PORT = 1521))
)
)
设置LOCAL_LISTENER=LOCAL_LSNR
LOCAL_LSNR =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = RHEL4)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST = RHEL4)(PORT = 1521))
)
)
设置LOCAL_LISTENER=LOCAL_LSNR
最后你通过lsnrctl service listener;lsnrctl service listener1 查看共享服务是否已经注册到监听里面
[oracle@RHEL4 dbs]$ lsnrctl service listener
LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 04-NOV-2010 22:40:47
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=RHEL4)(PORT=1521)))
Services Summary...
Service "cyclebin" has 2 instance(s).
Instance "cyclebin", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Instance "cyclebin", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "cyclebinXDB" has 1 instance(s).
Instance "cyclebin", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1002 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=RHEL4)(PORT=32809))
The command completed successfully
[oracle@RHEL4 dbs]$ lsnrctl service listener1
Services Summary...
Service "cyclebin" has 2 instance(s).
Instance "cyclebin", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Instance "cyclebin", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "cyclebinXDB" has 1 instance(s).
Instance "cyclebin", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1002 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=RHEL4)(PORT=32809))
The command completed successfully
[oracle@RHEL4 dbs]$ lsnrctl service listener1
LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 04-NOV-2010 22:40:49
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=RHEL4)(PORT=1522)))
Services Summary...
Service "cyclebin" has 2 instance(s).
Instance "cyclebin", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:1 refused:0
LOCAL SERVER
Instance "cyclebin", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "cyclebinXDB" has 1 instance(s).
Instance "cyclebin", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1002 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=RHEL4)(PORT=32809))
Services Summary...
Service "cyclebin" has 2 instance(s).
Instance "cyclebin", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:1 refused:0
LOCAL SERVER
Instance "cyclebin", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "cyclebinXDB" has 1 instance(s).
Instance "cyclebin", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1002 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=RHEL4)(PORT=32809))
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13605188/viewspace-678342/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/13605188/viewspace-678342/