ホームページ >データベース >mysql チュートリアル >Oracle CRS的管理与维护
欢迎进入Oracle社区论坛,与200万技术人员互动交流 >>进入 4、管理Voting disk Voting disk(表决磁盘)主要用于记录节点成员信息,例如包含哪些节点成员、节点添加删除信息的记录等。 (1)查看Voting disk 要查看Voting disk信息,可执行如下命令: crsctl
欢迎进入Oracle社区论坛,与200万技术人员互动交流 >>进入
<ol> <li><span><span>[oracle@node-rac1 ~]$ crsctl query css votedisk </span></span></li> <li><span> 0. 0 /dev/raw/raw3 </span></li> <li><span> 1. 0 /dev/raw/raw4 </span></li> <li><span> 2. 0 /dev/raw/raw5 </span></li> <li><span>Located 3 voting disk(s). </span></li> </ol>
(2)备份Voting disk
Voting disk的信息很重要,需要定期备份votedisk,例如:
[oracle@node-rac1 ~]$dd if=/dev/raw/raw3 of=/tmp/votedisk.bak
这样就把备份到了/tmp目录下。
(3)恢复Voting disk
例如:
[oracle@node-rac1 ~]$dd if=/tmp/votedisk.bak of=/dev/raw/raw3
(4)删除voting disk镜像盘
如果要删除一块表决磁盘,可以执行如下命令:
crsctl delete css votedisk /dev/raw/raw5 -force
这个操作需要root用户身份,例如:
<ol> <li><span><span>[root@node-rac1 ~]#/app/oracrs/product/11.0.6/crs/bin/crsctl \ </span></span></li> <li> <span>></span><span>delete css votedisk /dev/raw/raw5 </span> </li> <li><span>Successful deletion of voting disk /dev/raw/raw5. </span></li> <li><span>[oracle@node-rac1 ~]$ crsctl query css votedisk </span></li> <li><span> 0. 0 /dev/raw/raw3 </span></li> <li><span> 1. 0 /dev/raw/raw4 </span></li> </ol>
(5)添加voting disk镜像盘
添加一块表决磁盘时,执行如下命令:
crsctl add css votedisk /dev/raw/raw5 -force
这个操作需要root用户身份,例如:
<ol> <li><span><span>[root@node-rac1 ~]#/app/oracrs/product/11.0.6/crs/bin/crsctl add css votedisk /dev/raw/raw5 Now formatting voting disk: /dev/raw/raw5. </span></span></li> <li><span>Successful addition of voting disk /dev/raw/raw5. </span></li> <li><span>[oracle@node-rac1 ~]$ crsctl query css votedisk </span></li> <li><span>crsctl query css votedisk </span></li> <li><span> 0. 0 /dev/raw/raw3 </span></li> <li><span> 1. 0 /dev/raw/raw4 </span></li> <li><span> 2. 0 /dev/raw/raw5 </span></li> </ol>
5、管理OCR
<ol> <li><span><span>[oracle@node-rac1 ~]$ ocrcheck </span></span></li> <li><span>Status of Oracle Cluster Registry is as follows : </span></li> <li><span> Version: 2 </span></li> <li><span> Total space (kbytes): 4000280 </span></li> <li><span> Used space (kbytes): 3840 </span></li> <li><span> Available space (kbytes) : 3996440 </span></li> <li><span> ID: 1806962807 </span></li> <li><span> Device/File Name: /dev/raw/raw1 </span></li> <li><span> Device/File integrity check succeeded </span></li> <li><span> Device/File Name: /dev/raw/raw2 </span></li> <li><span> Device/File integrity check succeeded </span></li> <li><span> Cluster registry integrity check succeeded </span></li> </ol>
(2)OCR的备份与恢复
默认情况下,Oracle每四个小时自动备份一次OCR,并保存三个有效版本,但是仅保存在集群的某一个节点上。
要查看自动备份OCR文件的路径,执行如下命令:
<ol> <li><span><span>[oracle@node-rac1 ~]$ocrconfig -showbackup </span></span></li> <li><span>node-rac2 2011/03/11 13:10:27 /app/crs/product/11.0.6/crs/cdata/rac-cluster/backup00.ocr </span></li> <li><span>node-rac2 2011/03/11 09:10:25 /app/crs/product/11.0.6/crs/cdata/rac-cluster/backup01.ocr </span></li> <li><span>node-rac2 2011/03/11 05:10:24 /app/crs/product/11.0.6/crs/cdata/rac-cluster/backup02.ocr </span></li> <li><span>node-rac2 2011/03/10 21:10:20 /app/crs/product/11.0.6/crs/cdata/rac-cluster/day.ocr </span></li> <li><span>node-rac2 2011/03/10 21:10:20 /app/crs/product/11.0.6/crs/cdata/rac-cluster/week.ocr </span></li> </ol>
恢复OCR的方法也很简单,例如:
[oracle@node-rac1 ~]$ocrconfig ?restore \
> /app/oracrs/product/11.0.6/crs/cdata/rac-cluster/backup01.ocr
其实OCR也可以通过手动的方式导出、导入,方法如下:
手动导出:ocrconfig -export /tmp/ocr_bak
手动导入:ocrconfig -import /tmp/ocr_bak
(3)添加OCR镜像盘
向磁盘组中添加OCR磁盘的基本步骤如下:
执行命令crsctl stop crs停掉CRS服务
创建用于镜像OCR的RAW设备,例如:/dev/raw/raw11
执行“ocrconfig ?export”命令导出OCR的信息
修改/etc/oracle/ocr.loc文件,添加新增的raw设备,例如:
<ol> <li><span><span>[oracle@node-rac1 ~]$more /etc/oracle/ocr.loc </span></span></li> <li> <span>ocrconfig_loc</span><span>=/dev/raw/raw1 </span> </li> <li> <span>ocrmirrorconfig_loc</span><span>=/dev/raw/raw2 </span> </li> <li> <span>ocrmirrorconfig_loc</span><span>=/dev/raw/raw11 </span> </li> <li> <span>local_only</span><span>=</span><span>FALSE</span><span> </span> </li> </ol>
执行命令“ocrconfig -import”将OCR备份信息导入磁盘
检查ocr设置信息,看是否增加成功
最后用“crsctl start crs”启动CRS服务
6、快速卸载CRS
<ol> <li><span><span> [root@node-rac1 install]# /app/oracrs/product/11.0.6/crs/install/rootdeinstall.sh </span></span></li> <li><span>Verifying existence of ocr.loc file </span></li> <li><span>Removing contents from OCR mirror device </span></li> <li><span>2560+0 records in </span></li> <li><span>2560+0 records out </span></li> <li><span>10485760 bytes (10 MB) copied, 3.90308 seconds, 2.7 MB/s </span></li> <li><span>Removing contents from OCR device </span></li> <li><span>2560+0 records in </span></li> <li><span>2560+0 records out </span></li> <li><span>10485760 bytes (10 MB) copied, 3.84383 seconds, 2.7 MB/s </span></li> </ol>
接着,在机(集)群中的任意一个节点上执行$ORA_CRS_HOME/install/rootdeinstall.sh。
(3)用图形界面OUI卸载crs
首先在CRS安装包目录下启动CRS安装欢迎界面,然后在欢迎界面点击“Installed Products”,接着会弹出如下界面: 在这个界面中可以看到已经安装的CRS信息,点击右下角的“Remove”按钮,开始卸载CRS。
(4)删除剩余其它文件
CRS卸载程序可以删除大部分安装程序,但是并不能完全卸载,所以需要手动删除未卸载的一些文件,在集群所有节点上执行如下删除命令:
<ol> <li><span><span>rm -rf /app/oracrs/product/11.0.6/crs/ </span></span></li> <li><span>/bin/rm -rf /var/tmp/.oracle </span></li> <li><span>/bin/rm -f /etc/oraInst.loc </span></li> <li><span>rm -rf /etc/oracle/ </span></li> <li><span>rm -f /etc/oratab </span></li> </ol>
所有操作执行完毕后,重启集群的每个节点,重新安装CRS即可。
[1] [2]