Oracle RAC迁移替换OCR盘的方法是什么

39次阅读
没有评论

共计 3156 个字符,预计需要花费 8 分钟才能阅读完成。

这篇文章主要介绍“Oracle RAC 迁移替换 OCR 盘的方法是什么”,在日常操作中,相信很多人在 Oracle RAC 迁移替换 OCR 盘的方法是什么问题上存在疑惑,丸趣 TV 小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Oracle RAC 迁移替换 OCR 盘的方法是什么”的疑惑有所帮助!接下来,请跟着丸趣 TV 小编一起来学习吧!

案例背景:因安装集群时候使用的 OCR 磁盘组存储有问题,需要迁移到新的磁盘组。

涉及 文件有:
1)OCR 文件
2)VOTING 文件
3)ASM 实例的 spfile 文件

旧 OCR 磁盘组名称:+OCR
新 OCR 磁盘组名称:+GRID

1、迁移 OCR 文件
grid@pgylinux01-or@+ASM1 ocrcheck
Status of Oracle Cluster Registry is as follows :
  Version  :  3
  Total space (kbytes)  :  262120
  Used space (kbytes)  :  3604
  Available space (kbytes) :  258516
  ID  : 1076986448
  Device/File Name  : 
+ocr
  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 文件在 OCR 磁盘组中

迁移 OCR 文件有两种方式:
方法一:添加一个新位置,删除旧位置
[root@pgylinux01-or bin]# /oracle/grid/11.2.0.4/bin/ocrconfig -add +grid

# 查看 OCR 盘路径
grid@pgylinux01-or@+ASM1 ocrcheck
Status of Oracle Cluster Registry is as follows :
  Version  :  3
  Total space (kbytes)  :  262120
  Used space (kbytes)  :  3600
  Available space (kbytes) :  258520
  ID  : 1076986448
  Device/File Name  : 
+ocr
  Device/File integrity check succeeded
  Device/File Name  : 
+grid
  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 bypassed due to non-privileged user

也可以通过查看 /etc/oracle/ocr.loc 文件来确认 OCR 文件路径
oracle@pgylinux01-or@+ASM1 cat /etc/oracle/ocr.loc
#Device/file  getting replaced by device +grid

ocrconfig_loc=+ocr
ocrmirrorconfig_loc=+grid

这时候 OCR 文件在 +OCR 和 +GRID 磁盘组各存了一份,可以删除 +OCR 盘里面的那一份
[root@pgylinux01-or bin]#
/oracle/grid/11.2.0.4/bin/ocrconfig -delete +ocr

方法二:使用 replace 方式直接替换
[root@pgylinux01-or bin]# /oracle/grid/11.2.0.4/bin/ocrconfig -replace +ocr -replacement +grid
PROT-28: Cannot delete or replace the only configured Oracle Cluster Registry location

提示说 当前只有一份 OCR 文件,不能做删除和替换操作,需要先添加一份 OCR 文件,再做替换,添加到哪个盘都可以,这里直接使用 +GRID 盘。
[root@pgylinux01-or bin]#
/oracle/grid/11.2.0.4/bin/ocrconfig -add +grid

[root@pgylinux01-or bin]#
/oracle/grid/11.2.0.4/bin/ocrconfig -replace +ocr -replacement +grid
PROT-29: The Oracle Cluster Registry location is already configured

替换完成,OCR 文件已经转移到 +GRID 磁盘组中。

2、迁移 VOTING 文件
# 查看当前 VOTING 文件路径
grid@pgylinux01-or@+ASM1 crsctl query css votedisk
##  STATE  File Universal Id  File Name Disk group
—  —–  —————–  ——— ———
 1. ONLINE  0de070fb41ae4f30bfd17c9dc7668f01 (ORCL:DATA_01) [OCR]
Located 1 voting disk(s).

# 替换 VOTING 文件到 +GRID 磁盘组
grid@pgylinux01-or@+ASM1 crsctl replace votedisk +grid
Successful addition of voting disk 53e1a6d5ebf84f41bf22d54601a9028f.
Successful deletion of voting disk 0de070fb41ae4f30bfd17c9dc7668f01.
Successfully replaced voting disk group with +grid.
CRS-4266: Voting file(s) successfully replaced

grid@pgylinux01-or@+ASM1 crsctl query css votedisk
##  STATE  File Universal Id  File Name Disk group
—  —–  —————–  ——— ———
 1. ONLINE  53e1a6d5ebf84f41bf22d54601a9028f (ORCL:DATA_03) [GRID]
Located 1 voting disk(s).

替换完成,VOTING 文件已经转移到 +GRID 磁盘组中。

3、重建 ASM 实例的 spfile 文件
SQL
CREATE PFILE= /home/grid/asm_pfile.ora from spfile;

File created.

SQL
CREATE SPFILE= +GRID FROM PFILE= /home/grid/asm_pfile.ora

File created.

所有文件迁移完成,重启集群完成迁移。旧的 OCR 磁盘组不再需要,可以删除。

到此,关于“Oracle RAC 迁移替换 OCR 盘的方法是什么”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注丸趣 TV 网站,丸趣 TV 小编会继续努力为大家带来更多实用的文章!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-26发表,共计3156字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)