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

全部博文(57)

文章存档

2014年(2)

2013年(15)

2012年(20)

2011年(20)

我的朋友

分类: Oracle

2012-06-13 17:35:42

:oracle集群管理

1:启动集群软件

点击(此处)折叠或打开

  1. [root@rac1 bin]# ./crsctl start crs
  2. CRS-4123: Oracle High Availability Services has been started.

2:停止集群软件

点击(此处)折叠或打开

  1. [root@rac1 bin]# ./crsctl stop crs
  2. CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1'
  3. CRS-2673: Attempting to stop 'ora.crsd' on 'rac1'
  4. CRS-2677: Stop of 'ora.crsd' on 'rac1' succeeded
  5. CRS-2673: Attempting to stop 'ora.asm' on 'rac1'
  6. CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'rac1'
  7. CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1'
  8. CRS-2673: Attempting to stop 'ora.evmd' on 'rac1'
  9. CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac1'
  10. CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1'
  11. CRS-2677: Stop of 'ora.cssdmonitor' on 'rac1' succeeded
  12. CRS-2677: Stop of 'ora.evmd' on 'rac1' succeeded
  13. CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded
  14. CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded
  15. CRS-2677: Stop of 'ora.drivers.acfs' on 'rac1' succeeded
  16. CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded
  17. CRS-2673: Attempting to stop 'ora.cssd' on 'rac1'
  18. CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded
  19. CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1'
  20. CRS-2673: Attempting to stop 'ora.diskmon' on 'rac1'
  21. CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded
  22. CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1'
  23. CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded
  24. CRS-2677: Stop of 'ora.diskmon' on 'rac1' succeeded
  25. CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completed
  26. CRS-4133: Oracle High Availability Services has been stopped.



如果ohasd 服务已经启动,可以用命令:crsctl start cluster –all

 

二:votedisk 管理

1:查询votedisk

点击(此处)折叠或打开

  1. [grid@rac1 ~]$ crsctl query css votedisk
  2. ## STATE File Universal Id File Name Disk group
  3. -- ----- ----------------- --------- ---------
  4. 1. ONLINE 68bd6b7662694fc6bf378eab18e7e095 (/dev/asm-votedisk01) []
  5. 2. ONLINE 769907a387a14f8cbf9b8e4157bf6a01 (/dev/asm-votedisk02) []
  6. 3. ONLINE 0d9134dbf5df4f18bf42b3330d5185d3 (/dev/asm-votedisk03) []
  7. 4. ONLINE 66c3ea13d8794f3abff4a86b122de194 (/dev/asm-votedisk04) []
  8. Located 4 voting disk(s).
2:删除votedisk

点击(此处)折叠或打开

  1. [grid@rac1 ~]$ crsctl delete css votedisk /dev/asm-votedisk04
  2. CRS-4611: Successful deletion of voting disk /dev/asm-votedisk04.
  3. [grid@rac1 ~]$ crsctl query css votedisk
  4. ## STATE File Universal Id File Name Disk group
  5. -- ----- ----------------- --------- ---------
  6. 1. ONLINE 68bd6b7662694fc6bf378eab18e7e095 (/dev/asm-votedisk01) []
  7. 2. ONLINE 769907a387a14f8cbf9b8e4157bf6a01 (/dev/asm-votedisk02) []
  8. 3. ONLINE 0d9134dbf5df4f18bf42b3330d5185d3 (/dev/asm-votedisk03) []
  9. Located 3 voting disk(s).

3:增加votedisk

点击(此处)折叠或打开

  1. [grid@rac1 ~]$ crsctl add css votedisk /dev/asm-votedisk04
  2. CRS-4611: Successful deletion of voting disk /dev/asm-votedisk04.
  3. [grid@rac1 ~]$ crsctl query css votedisk
  4. ## STATE File Universal Id File Name Disk group
  5. -- ----- ----------------- --------- ---------
  6. 1. ONLINE 68bd6b7662694fc6bf378eab18e7e095 (/dev/asm-votedisk01) []
  7. 2. ONLINE 769907a387a14f8cbf9b8e4157bf6a01 (/dev/asm-votedisk02) []
  8. 3. ONLINE 0d9134dbf5df4f18bf42b3330d5185d3 (/dev/asm-votedisk03) []
  9. 4. ONLINE 66c3ea13d8794f3abff4a86b122de194 (/dev/asm-votedisk04) []
  10. Located 4 voting disk(s).

4:更换votedisk


点击(此处)折叠或打开

  1. [grid@rac1 ~]$ crsctl replace votedisk +data
  2. CRS-4256: Updating the profile
  3. Successful addition of voting disk 530a4aa809214fddbfc15e28867f9284.
  4. Successful deletion of voting disk 68bd6b7662694fc6bf378eab18e7e095.
  5. Successful deletion of voting disk 769907a387a14f8cbf9b8e4157bf6a01.
  6. Successful deletion of voting disk 0d9134dbf5df4f18bf42b3330d5185d3.
  7. Successfully replaced voting disk group with +data.
  8. CRS-4256: Updating the profile
  9. CRS-4266: Voting file(s) successfully replaced
  10. [grid@rac1 ~]$ crsctl query css votedisk
  11. ## STATE File Universal Id File Name Disk group
  12. -- ----- ----------------- --------- ---------
  13. 1. ONLINE 530a4aa809214fddbfc15e28867f9284 (/dev/asm-disk02) [DATA]
  14. Located 1 voting disk(s).

三:OCR资源管理


1:检查OCR内容的一致性

点击(此处)折叠或打开

  1. [grid@rac2 ~]$ ocrcheck
  2. Status of Oracle Cluster Registry is as follows :
  3. Version : 3
  4. Total space (kbytes) : 262120
  5. Used space (kbytes) : 2760
  6. Available space (kbytes) : 259360
  7. ID : 896108600
  8. Device/File Name : /dev/asm-ocrdisk01
  9. Device/File integrity check succeeded
  10. Device/File Name : /dev/asm-ocrdisk02
  11. Device/File integrity check succeeded
  12. Device/File not configured
  13. Device/File not configured
  14. Device/File not configured
  15. Cluster registry integrity check succeeded
  16. Logical corruption check bypassed due to non-privileged user

2OCR配置 ocrconfig

   1):查看ocr备份信息

点击(此处)折叠或打开

  1. [grid@rac2 ~]$ ocrconfig -showbackup
  2. rac2 2012/06/14 00:29:43 /u01/app/grid/11.2.0/cdata/rac-scan/backup00.ocr
  3. rac2 2012/06/13 20:29:40 /u01/app/grid/11.2.0/cdata/rac-scan/backup01.ocr
  4. rac2 2012/06/13 16:29:37 /u01/app/grid/11.2.0/cdata/rac-scan/backup02.ocr
  5. rac1 2012/06/12 07:39:37 /u01/app/grid/11.2.0/cdata/rac-scan/day.ocr
  6. rac1 2012/06/05 23:28:59 /u01/app/grid/11.2.0/cdata/rac-scan/week.ocr
  7. PROT-25: Manual backups for the Oracle Cluster Registry are not available
  8. [grid@rac2 ~]$
  2 导出导出ocr信息

点击(此处)折叠或打开

  1. [root@rac2 bin]# ./ocrconfig -export /tmp/ocr.conf
  2. [root@rac2 bin]# ./ocrconfig -import /tmp/ocr.conf

  3):增加ocr

点击(此处)折叠或打开

  1. [root@rac2 bin]# ./ocrconfig -add +data
  2. [root@rac2 bin]# ./ocrcheck
  3. Status of Oracle Cluster Registry is as follows :
  4. Version : 3
  5. Total space (kbytes) : 262120
  6. Used space (kbytes) : 2760
  7. Available space (kbytes) : 259360
  8. ID : 896108600
  9. Device/File Name : /dev/asm-ocrdisk01
  10. Device/File integrity check succeeded
  11. Device/File Name : /dev/asm-ocrdisk02
  12. Device/File integrity check succeeded
  13. Device/File Name : +data
  14. Device/File integrity check succeeded
  15. Device/File not configured
  16. Device/File not configured
  17. Cluster registry integrity check succeeded
  18. Logical corruption check succeeded
  19. [root@rac2 bin]#

4):删除ocr盘(至少保留一个)

点击(此处)折叠或打开

  1. [root@rac2 bin]# ./ocrconfig -delete +data
  2. [root@rac2 bin]# ./ocrcheck
  3. Status of Oracle Cluster Registry is as follows :
  4. Version : 3
  5. Total space (kbytes) : 262120
  6. Used space (kbytes) : 2760
  7. Available space (kbytes) : 259360
  8. ID : 896108600
  9. Device/File Name : /dev/asm-ocrdisk01
  10. Device/File integrity check succeeded
  11. Device/File Name : /dev/asm-ocrdisk02
  12. Device/File integrity check succeeded
  13. Device/File not configured
  14. Device/File not configured
  15. Device/File not configured
  16. Cluster registry integrity check succeeded
  17. Logical corruption check succeeded
  18. [root@rac2 bin]#
 (5)手动备份ocr

     在手动备份之前 得先设置备份目录

点击(此处)折叠或打开

  1. [root@rac2 bin]# ./ocrconfig -backuploc /tmp/
  2. [root@rac2 bin]# ./ocrconfig -manualbackup
  3. rac2 2012/06/14 01:11:30 /tmp/backup_20120614_011130.ocr
  4. [root@rac2 bin]# ./ocrconfig -showbackup
  5. rac2 2012/06/14 00:29:43 /u01/app/grid/11.2.0/cdata/rac-scan/backup00.ocr
  6. rac2 2012/06/13 20:29:40 /u01/app/grid/11.2.0/cdata/rac-scan/backup01.ocr
  7. rac2 2012/06/13 16:29:37 /u01/app/grid/11.2.0/cdata/rac-scan/backup02.ocr
  8. rac1 2012/06/12 07:39:37 /u01/app/grid/11.2.0/cdata/rac-scan/day.ocr
  9. rac1 2012/06/05 23:28:59 /u01/app/grid/11.2.0/cdata/rac-scan/week.ocr
  10. rac2 2012/06/14 01:11:30 /tmp/backup_20120614_011130.ocr
  11. [root@rac2 bin]#
 
四:scan 配置
   1:查看scan 状态,看哪些scan ip 分布在哪些节点上

点击(此处)折叠或打开

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

2:删除scan

  删除之前得先停掉所有的scan服务

点击(此处)折叠或打开

  1. [grid@rac1 ~]$ srvctl stop scan_listener
  2. [grid@rac1 ~]$ srvctl stop scan
  3. [root@rac1 bin]# ./srvctl remove scan_listener
  4. Remove scan listener? (y/[n]) y
  5. [root@rac1 bin]# ./srvctl remove scan
  6. Remove the scan? (y/[n]) y

3:增加scan

   在增加scan 之前要确保scan name 能被正确的解析出来

点击(此处)折叠或打开

  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


 








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