暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

19c RAC 更换OCR磁盘组方法

原创 袁长刚 2020-02-28
3920

旧的OCR磁盘组名称:+OCRDG

新的OCR磁盘组名称:+CRSDG

涉及文件有:

  1. ocr文件
  2. voting文件
  3. asm实例spfile文件

如下是整个迁移替换过程,大体分四部份,迁移ocr=>迁移voting==>重建spfile==>重启集群。

注:前面4步都可以在线操作,只有重启集群需要停业务

一、准备迁移OCR文件

  1. 检查ocr状态
[grid@xydb5node1 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
	 Version                  :          4
	 Total space (kbytes)     :     491684
	 Used space (kbytes)      :      84476
	 Available space (kbytes) :     407208
	 ID                       : 1627568361
	 Device/File Name         :     +OCRDG
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

	 Cluster registry integrity check succeeded

	 Logical corruption check bypassed due to non-privileged user

如上,ocr存储在+ocrdg磁盘组中。
2. 将ocr文件添加到新的+crsdg磁盘组中,需要在root用户下执行,如下:

[root@xydb5node1 ~]# /u01/app/19.3.0/grid/bin/ocrconfig -add +crsdg

  1. 再次检查ocr,发现已添加成功,如下:
[root@xydb5node1 ~]# /u01/app/19.3.0/grid/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
	 Version                  :          4
	 Total space (kbytes)     :     491684
	 Used space (kbytes)      :      84476
	 Available space (kbytes) :     407208
	 ID                       : 1627568361
	 Device/File Name         :     +OCRDG
                                    Device/File integrity check succeeded
	 Device/File Name         :     +CRSDG
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

	 Cluster registry integrity check succeeded

	 Logical corruption check succeeded

  1. 通过replace转移ocrdg到crsdg,如下:
[root@xydb5node1 ~]# /u01/app/19.3.0/grid/bin/ocrconfig -replace +ocrdg -replacement +crsdg
PROT-29: The Oracle Cluster Registry location is already configured

如上,表示替换完成,ocr文件已经转移到+crsdg磁盘组中了。

二、准备迁移voting文件

  1. 检查voting文件状态,如下
[grid@xydb5node1 ~]$ crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   27902376db4c4f9bbfb4960aed340f6e (AFD:OCRDG1) [OCRDG]
 2. ONLINE   b07b517c85b14fadbfdb259bb919b950 (AFD:OCRDG2) [OCRDG]
 3. ONLINE   d1349520b4914f07bff3b08f08aaf406 (AFD:OCRDG3) [OCRDG]
Located 3 voting disk(s).

  1. 替换voting文件到+crsdg磁盘组中,如下
[grid@xydb5node1 ~]$ crsctl replace votedisk +crsdg
Successful addition of voting disk bcae5ebc1c5b4f7fbf78cbf0574d6a50.
Successful addition of voting disk c97e4ead0c5b4f1fbf119006fec0ead5.
Successful addition of voting disk 7f6f6b0e03dc4f3ebf363da84475bb56.
Successful deletion of voting disk 27902376db4c4f9bbfb4960aed340f6e.
Successful deletion of voting disk b07b517c85b14fadbfdb259bb919b950.
Successful deletion of voting disk d1349520b4914f07bff3b08f08aaf406.
Successfully replaced voting disk group with +crsdg.
CRS-4266: Voting file(s) successfully replaced
[grid@xydb5node1 ~]$ crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   bcae5ebc1c5b4f7fbf78cbf0574d6a50 (AFD:CRSDG1) [CRSDG]
 2. ONLINE   c97e4ead0c5b4f1fbf119006fec0ead5 (AFD:CRSDG2) [CRSDG]
 3. ONLINE   7f6f6b0e03dc4f3ebf363da84475bb56 (AFD:CRSDG3) [CRSDG]
Located 3 voting disk(s).
  1. 删除旧的+ocrdg磁盘组,如下:
/u01/app/19.3.0/grid/bin/ocrconfig -delete +ocrdg

如上,voting文件已转移到+crsdg磁盘组中。

三、准备重建asm实例spfile文件

[grid@xydb5node1 ~]$ sqlplus / as sysasm

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Feb 27 17:49:33 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle.  All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> create pfile='/home/grid/asm_spfile.ora' from spfile;

File created.

SQL> create spfile ='+CRSDG' from pfile='/home/grid/asm_spfile.ora';

File created.

四、重启CRS集群

  1. 参考文档:Oracle 集群资源启停v1.5

总结

整个流程操作下来很流畅,基本没遇到什么问题 ,可能是比较幸运,希望各位在有遇到相同需求时能帮得上。

以上仅供参考,谢谢。

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论