手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Oracle RAC 客户端连接负载均衡(Load Balance)

[日期:2012-10-11] 来源:Linux社区  作者:robinson_0612 [字体:大 中 小]

2、参数配置

  1. -->instrance ora10g1上的参数配置  
  2. SQL> show parameter instance_na 
  3.  
  4. NAME                                 TYPE        VALUE 
  5. ------------------------------------ ----------- ------------------------------  
  6. instance_name                        string      ora10g1 
  7.  
  8. SQL> show parameter listener 
  9.  
  10. NAME                                 TYPE        VALUE 
  11. ------------------------------------ ----------- ------------------------------  
  12. local_listener                       string      local_lsnr_ora10g1 
  13. remote_listener                      string      remote_lsnr_ora10g 
  14.  
  15. -->instrance ora10g2上的参数配置  
  16. SQL> show parameter instance_name 
  17.  
  18. NAME                                 TYPE        VALUE 
  19. ------------------------------------ ----------- ------------------------------  
  20. instance_name                        string      ora10g2 
  21.  
  22. SQL> show parameter listener 
  23.  
  24. NAME                                 TYPE        VALUE 
  25. ------------------------------------ ----------- ------------------------------  
  26. local_listener                       string      local_lsnr_ora10g2 
  27. remote_listener                      string      remote_lsnr_ora10g 
  28.  
  29. -->instrance ora10g2上的监听信息  
  30. SQL> ho ps -ef | grep lsnr 
  31. Oracle   17372     1  0 11:00 ?        00:00:00 /u01/oracle/db/bin/tnslsnr LISTENER_NEW_BO2DBS -inherit 
  32. oracle   17502 24301  0 12:10 pts/0    00:00:00 /bin/bash -c ps -ef | grep lsnr 
  33. oracle   17504 17502  0 12:10 pts/0    00:00:00 grep lsnr 
  34.  
  35. SQL> ho lsnrctl status LISTENER_NEW_BO2DBS 
  36. Listening Endpoints Summary... 
  37.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.7.62)(PORT=1314))) 
  38.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.7.52)(PORT=1314))) 
  39. Services Summary... 
  40. Service "ora10g" has 2 instance(s). 
  41.   Instance "ora10g1", status READY, has 1 handler(s) for this service... 
  42.   Instance "ora10g2", status READY, has 2 handler(s) for this service... 
  43. .......... 
  44.    
  45. -->由于只是测试基于客户端的load balance,因此移出remote_listener参数  
  46. SQL> alter system reset remote_listener scope=both sid='*'; 
  47. alter system reset remote_listener scope=both sid='*' 
  48. * 
  49. ERROR at line 1: 
  50. ORA-32009: cannot reset the memory value for instance * from instance ora10g2 
  51.  
  52. SQL> alter system reset remote_listener scope=spfile sid='*'; 
  53.  
  54. System altered. 
  55.  
  56. SQL> ho srvctl stop database -d ora10g  -->关闭数据库ora10g  
  57.  
  58. SQL> ho srvctl start database -d ora10g  -->启动数据库ora10g使得刚刚修改的remote_listener生效  
  59.  
  60. SQL> ho lsnrctl status LISTENER_NEW_BO2DBS  -->此时可以看到只有ora10g2注册到监听器  
  61.  
  62. Listening Endpoints Summary... 
  63.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.7.62)(PORT=1314))) 
  64.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.7.52)(PORT=1314))) 
  65. Services Summary... 
  66. Service "PLSExtProc" has 1 instance(s). 
  67.   Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... 
  68. Service "ora10g" has 1 instance(s). 
  69.   Instance "ora10g2", status READY, has 1 handler(s) for this service... 
  70. ..........   
  71.  
  72. oracle@bo2dbp:~> lsnrctl status LISTENER_NEW_BO2DBP  #同样在节点bo2dbp也只有ora10g1注册到监听器 
  73.  
  74. Listening Endpoints Summary... 
  75.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.7.61)(PORT=1314))) 
  76.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.7.51)(PORT=1314))) 
  77. Services Summary... 
  78. Service "ora10g" has 1 instance(s). 
  79.   Instance "ora10g1", status READY, has 1 handler(s) for this service... 
  80. ......... 
linux
相关资讯       负载均衡  Oracle RAC 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款