Chinaunix首页 | 论坛 | 博客
  • 博客访问: 593899
  • 博文数量: 57
  • 博客积分: 877
  • 博客等级: 准尉
  • 技术积分: 1275
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-24 16:16
文章分类

全部博文(57)

文章存档

2014年(2)

2013年(15)

2012年(20)

2011年(20)

我的朋友

分类: Oracle

2012-06-12 16:23:28

    在ORACLE 11R2 版本中引入了SCAN,SCAN的最主要作用就是在rac中增加节点或删除节点对客户端来说是完全透明的:
    1:删除SCAN
       在删除scan之前必须要把scan服务停掉
       

点击(此处)折叠或打开

  1. [grid@rac1 ~]$ srvctl stop scan_listener
  2. [grid@rac1 ~]$ srvctl stop scan
  3. [grid@rac1 ~]$ crs_stat -t
  4. Name Type Target State Host
  5. ------------------------------------------------------------
  6. ora.DATA.dg ora....up.type ONLINE ONLINE rac1
  7. ora....ER.lsnr ora....er.type ONLINE ONLINE rac1
  8. ora....N1.lsnr ora....er.type OFFLINE OFFLINE
  9. ora....N2.lsnr ora....er.type OFFLINE OFFLINE
  10. ora....N3.lsnr ora....er.type OFFLINE OFFLINE
  11. ora.asm ora.asm.type ONLINE ONLINE rac1
  12. ora.eons ora.eons.type ONLINE ONLINE rac1
  13. ora.gsd ora.gsd.type ONLINE ONLINE rac1
  14. ora....network ora....rk.type ONLINE ONLINE rac1
  15. ora.oc4j ora.oc4j.type ONLINE ONLINE rac2
  16. ora.ons ora.ons.type ONLINE ONLINE rac1
  17. ora.orcl.db ora....se.type ONLINE ONLINE rac1
  18. ora....SM1.asm application ONLINE ONLINE rac1
  19. ora....C1.lsnr application ONLINE ONLINE rac1
  20. ora.rac1.gsd application ONLINE ONLINE rac1
  21. ora.rac1.ons application ONLINE ONLINE rac1
  22. ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
  23. ora....SM2.asm application ONLINE ONLINE rac2
  24. ora....C2.lsnr application ONLINE ONLINE rac2
  25. ora.rac2.gsd application ONLINE ONLINE rac2
  26. ora.rac2.ons application ONLINE ONLINE rac2
  27. ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
  28. ora....ry.acfs ora....fs.type ONLINE ONLINE rac1
  29. ora.scan1.vip ora....ip.type OFFLINE OFFLINE
  30. ora.scan2.vip ora....ip.type OFFLINE OFFLINE
  31. ora.scan3.vip ora....ip.type OFFLINE OFFLINE
  32. [grid@rac1 ~]$
    删除scan,需要用root的权限 

点击(此处)折叠或打开

  1. [root@rac1 ~]# cd /u01/app/grid/11.2.0/bin/
  2. Display all 381 possibilities? (y or n)
  3. [root@rac1 ~]# cd /u01/app/grid/11.2.0/bin/
  4. [root@rac1 bin]# ./srvctl remove scan_listener
  5. Remove scan listener? (y/[n]) y
  6. [root@rac1 bin]# ./srvctl remove scan
  7. Remove the scan? (y/[n]) y
  8. [root@rac1 bin]# ./srvctl status scan
  9. PRCS-1025 : Could not find Single Client Access Name Virtual Internet Protocol(VIP) resources TYPE=ora.scan_vip.type
  10. [root@rac1 bin]# ./srvctl status scan_listener
  11. PRCS-1026 : Could not find Single Client Access Name listener resources TYPE=ora.scan_listener.type

   2:增加scan
      在增加scan之前,得保证SCAN地址都能正确的解析出来
     

点击(此处)折叠或打开

  1. [root@rac1 bin]# nslookup rac-scan
  2. Server: 172.72.15.200
  3. Address: 172.72.15.200#53
  4. Name: rac-scan.sb.com
  5. Address: 172.72.15.191
  6. Name: rac-scan.sb.com
  7. Address: 172.72.15.192
  8. Name: rac-scan.sb.com
  9. Address: 172.72.15.190
  10. [root@rac1 bin]#
    增加scan

点击(此处)折叠或打开

  1. [root@rac1 bin]# ./srvctl add scan -n rac-scan
  2. [root@rac1 bin]# ./srvctl status scan
  3. SCAN VIP scan1 is enabled
  4. SCAN VIP scan1 is not running
  5. SCAN VIP scan2 is enabled
  6. SCAN VIP scan2 is not running
  7. SCAN VIP scan3 is enabled
  8. SCAN VIP scan3 is not running
  9. [root@rac1 bin]# ./srvctl add scan_listener
  10. [root@rac1 bin]# ./srvctl status scan_listener
  11. SCAN Listener LISTENER_SCAN1 is enabled
  12. SCAN listener LISTENER_SCAN1 is not running
  13. SCAN Listener LISTENER_SCAN2 is enabled
  14. SCAN listener LISTENER_SCAN2 is not running
  15. SCAN Listener LISTENER_SCAN3 is enabled
  16. SCAN listener LISTENER_SCAN3 is not running

  3:重启crs服务
     ./crsctl stop cluster -all
     ./crsctl start cluster -all

点击(此处)折叠或打开

  1. [root@rac1 bin]# ./srvctl status scan_listener
  2. SCAN Listener LISTENER_SCAN1 is enabled
  3. SCAN listener LISTENER_SCAN1 is running on node rac1
  4. SCAN Listener LISTENER_SCAN2 is enabled
  5. SCAN listener LISTENER_SCAN2 is running on node rac2
  6. SCAN Listener LISTENER_SCAN3 is enabled
  7. SCAN listener LISTENER_SCAN3 is running on node rac1
scan的地址分配到各个节点上去了!
 


          
阅读(6436) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~