开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 1688|回复: 1
打印 上一主题 下一主题
收起左侧

[其它数据库例题] Oracle双监听器的配置

[复制链接]

结帖率:61% (35/57)
跳转到指定楼层
楼主
发表于 2013-1-12 18:42:08 | 只看该作者 回帖奖励 |正序浏览 |阅读模式   海南省海口市
以Oracle Net看,数据库服务器可能也是客户端因为tnsnames.ora可以有服务器的描述也就是,只有监听器才会一直是服务器    实例:监听=n:m
    ㈠ 双监听器的好处:
    ① 客户端故障转移--CF
    ② 客户端负载均衡--CLB
    ㈡ 注意事项:
    ① 要保证1521端口可用,否则,OEM将不可用,须emca重配
    ② 非标端口使用静态注册是个比较好的实践
    配置案例:
    [sql]
    [oracle@localhost admin]$ cat listener.ora
    think =
    (DESCRIPTION =
    (load_balance = on)
    (failover = on)
    (ADDRESS_LIST =
    (ADDRESS=(PROTOCOL = tcp)(HOST= 192.168.1.113)(PORT= 1521)
    (ADDRESS=(PROTOCOL = tcp)(HOST= 192.168.1.113)(PORT= 1522)
    )
    )
    )
    SID_LIST_think =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = emrep.us.oracle.com)
    (SID_NAME = emrep)
    (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)))
    water =
    (DESCRIPTION =
    (load_balance = on)
    (failover = on)
    (ADDRESS_LIST =
    (ADDRESS=(PROTOCOL = tcp)(HOST= 192.168.1.113)(PORT= 1521))
    (ADDRESS=(PROTOCOL = tcp)(HOST= 192.168.1.113)(PORT= 1522))
    )
    )
    )
    SID_LIST_water =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = emrep.us.oracle.com)
    (SID_NAME = emrep)
    (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)))
    [oracle@localhost admin]$ lsnrctl status water
    LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 10-DEC-2012 21:47:22
    Copyright (c) 1991, 2005, Oracle.  All rights reserved.
    Connecting to (DESCRIPTION=(load_balance=on)(failover=on)(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.113)(PORT=1521)))
    STATUS of the LISTENER

-


  Alias                     LISTENER    Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
    Start Date                10-DEC-2012 20:02:23
    Uptime                    0 days 1 hr. 44 min. 58 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
    Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
    Listening Endpoints Summary…
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
    Services Summary…
    Service "emrep.us.oracle.com" has 1 instance(s)。
    Instance "emrep", status READY, has 1 handler(s) for this service…
    Service "emrep_XPT.us.oracle.com" has 1 instance(s)。
    Instance "emrep", status READY, has 1 handler(s) for this service…
    The command completed successfully
    如果1521和1522并存,在业务不繁忙时,listener进程只会使用1521
    [oracle@localhost admin]$ lsnrctl status water
    LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 10-DEC-2012 21:48:45
    Copyright (c) 1991, 2005, Oracle.  All rights reserved.
    Connecting to (DESCRIPTION=(load_balance=on)(failover=on)(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.113)(PORT=1522)))
    STATUS of the LISTENER
    ------------------------
    Alias                     water
    Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
    Start Date                10-DEC-2012 21:24:17
    Uptime                    0 days 0 hr. 24 min. 28 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
    Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/water.log
    Listening Endpoints Summary…
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.113)(PORT=1522)))
    Services Summary…
    Service "emrep.us.oracle.com" has 1 instance(s)。
    Instance "emrep", status UNKNOWN, has 1 handler(s) for this service…
    The command completed successfully
    ㈢ 测试
    ① tnsping
    [sql]
    [oracle@localhost admin]$ tnsping water
    TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 10-DEC-2012 21:53:13
    Copyright (c) 1997, 2005, Oracle.  All rights reserved.
    Used parameter files:
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS=(PROTOCOL= tcp)(HOST= 192.168.1.113)(PORT= 1522)) (CONNECT_DATA=(SERVICE_NAME= emrep.us.oracle.com)))
    OK (10 msec)
    ② netstat
    [sql]
    [oracle@localhost admin]$ netstat -lntp| grep :15
    (Not all processes could be identified, non-owned process info
    will not be shown, you would have to be root to see it all.)
    tcp        0      0 0.0.0.0:1521                0.0.0.0:*                   LISTEN      8524/tnslsnr
    tcp        0      0 192.168.1.113:1522          0.0.0.0:*                   LISTEN      9826/tnslsnr
    ③ conn
    [sql]
    sys@EMREP> conn u1/u1@water
    Connected.

结帖率:37% (7/19)
沙发
发表于 2013-1-20 09:13:54 | 只看该作者   北京市北京市
沙发既然还是我的
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 793400750,邮箱:[email protected]
网站简介:精易论坛成立于2009年,是一个程序设计学习交流技术论坛,隶属于揭阳市揭东区精易科技有限公司所有。
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表