|
本帖最后由 botang 于 2016-9-6 11:06 编辑
vim listener.ora
#动态注册LISTENER监听器
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = station90.example.com)(PORT = 15212))
)
)
#动态注册L2监听器
L2=
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = station90.example.com)(PORT = 15213))
)
)
#使监听器LISTENER静态注册,使其能够与上面的监听器进行一动一静
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME= rcat.example.com)
(SID_NAME= rcat)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1/
)
)
)
使监听器L2静态注册,使其能够与上面的监听器进行一动一静
SID_LIST_L2 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME= rcat.example.com)
(SID_NAME= rcat)
(ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1/
)
)
)
vim tnsnames.ora
#使我的RCAT数据库动态监听在15212端口
RCAT =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = station90.example.com)(PORT = 15212))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rcat.example.com)
)
)
#动态注册FOR15212(是否这么理解?)
FOR15212 =
(DESCRIPTION =
(ADDRESS_LIST=
(ADDRESS = (PROTOCOL = TCP)(HOST = station90.example.com)(PORT = 15212))
(ADDRESS = (PROTOCOL = TCP)(HOST = station90.example.com)(PORT = 15213))
)
)
#使我的RCAT数据库动态监听在15213端口
RCAT2
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = station90.example.com)(PORT = 15213))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rcat.example.com)
)
)
#负载均衡静态15212和15213这两个监听端口
TIGER =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = station90.example.com)(PORT = 15212))
(ADDRESS = (PROTOCOL = TCP)(HOST = station90.example.com)(PORT = 15213))
(LOAD_BALANCE = yes )
)
(CONNECT_DATA =
(SERVICE_NAME = rcat.example.com)
)
)
#以上需要使其动态注册生效,需要进sqlplus修改配置
. oraenv
rcat
sqlplus /nolog
conn /as sysdba
alter system set local_listener=FOR15212;
alter register; #更快的让监听器动态注册,不然得等待2分钟以上
. oraenv
+ASM
sqplus /nolog
conn /as sysdba
alter system set local_listener=FOR15212;
alter register; #更快的让监听器动态注册,不然得等待2分钟以上
以上结束后查看LISTENER监听器状态
[oracle@station90 admin]$ lsnrctl services LISTENER;
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 05-SEP-2016 23:16:52
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=station90.example.com)(PORT=15212)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM", status READY, has 1 handler(s) for this service... #静态注册
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "rcat.example.com" has 2 instance(s).
Instance "rcat", status UNKNOWN, has 1 handler(s) for this service... #动态注册
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Instance "rcat", status READY, has 1 handler(s) for this service... #静态注册
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "rcatXDB.example.com" has 1 instance(s). #静态注册
Instance "rcat", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER <machine: station90.example.com, pid: 12730>
(ADDRESS=(PROTOCOL=tcp)(HOST=station90.example.com)(PORT=44903))
The command completed successfully
L2监听器的状态
[oracle@station90 admin]$ lsnrctl services l2
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 05-SEP-2016 23:19:08
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=station90.example.com)(PORT=15213)))
Services Summary...
Service "rcat.example.com" has 2 instance(s).
Instance "rcat", status UNKNOWN, has 1 handler(s) for this service... #动态注册
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Instance "rcat", status READY, has 1 handler(s) for this service... #静态注册
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "rcatXDB.example.com" has 1 instance(s).
Instance "rcat", status READY, has 1 handler(s) for this service... #静态注册
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER <machine: station90.example.com, pid: 12730>
(ADDRESS=(PROTOCOL=tcp)(HOST=station90.example.com)(PORT=44903))
The command completed successfully
问题1、关于以上理解是否有误
问题2、LISTENER监听的状态有+ASM 为静态注册,但是L2监听为什么没有+ASM这个监听?
问题3、rcatXDB.example.com是什么?
问题4、改什么配置的时候需要重启lsnrctl? 更改alter system set local_listener=FOR15212后是否也要重启监听?
问题5、一般生产环境是否都是这样配置的动态+静态+负载均衡?问题6、负载均衡怎么测试链接?问题7、其他未提到及发现的问题。
|
|