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

ORACLE集群文件磁盘组间迁移实施

IT那活儿 2022-07-02
1064

点击上方“IT那活儿”公众号,关注后了解更多内容,不管IT什么活儿,干就完了!!!



位于OCR磁盘组上的文件类型

  • ASM密码文件
  • ASM spfile
  • OCR
  • Voting files
  • OCR备份



迁移步骤

1. 移ASM密码文件

1)找到ASM密码文件
[grid@rac1 ~]$ asmcmd pwget --asm
+CRS/orapwASM

2)迁移ASM密码文件

[grid@rac1 ~]$ asmcmd pwmove --asm -f +CRS/orapwASM +GRID/orapwASM
moving +CRS/orapwASM -> +GRID/orapwASM

3)确认文件新路径

[grid@rac1 ~]$ asmcmd pwget --asm
+GRID/orapwASM

2. 迁移ASM spfile

1)找到ASM spfile
[grid@rac1 ~]$ asmcmd spget
+CRS/ora12c-cluster/ASMPARAMETERFILE/registry.253.1096127159

2)迁移ASM spfile
[grid@rac1 ~]$ asmcmd spmove +CRS/ora12c-cluster/ASMPARAMETERFILE/registry.253.1096127159 +GRID/ora12c-cluster/ASMPARAMETERFILE/spfileASM
ORA-15032: not all alterations performed
ORA-15028: ASM file '+CRS/ora12c-cluster/ASMPARAMETERFILE/registry.253.1096127159' not dropped; currently being accessed (DBD
ERROR: OCIStmtExecute)

错误信息可以忽略,重启CRS后会使用新的位置。
3)确认文件新路径
[grid@rac1 ~]$ asmcmd spget
+GRID/marirac/ASMPARAMETERFILE/spfileASM

3. 迁移OCR

1)找到OCR位置
[grid@rac1 ~]$ ocrcheck -config
Oracle Cluster Registry configuration is :
Device/File Name : +CRS

2)迁移OCR

[grid@rac1 ~]$ ocrconfig -add +GRID
PROT-20: Insufficient permission to proceed. Require privileged user

[grid@rac1 ~]$ exit
logout

[root@rac1 ~]# ocrconfig -add +GRID
[root@rac1 ~]# ocrconfig -delete +CRS

3)确认文件新路径
[root@rac1 ~]# ocrcheck -config
Oracle Cluster Reg
istry configuration is :
Device/File Name : +GRID

4. 迁移voting files

1)找到voting files位置
[root@rac1 ~]# crsctl query css votedisk
## STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
1. ONLINE   544b7b2dc9f14f8dbf8f5c560a32a95f (/dev/asmdisk/asmdisk1) [OCR]
2. ONLINE   c4035c7009be4f26bffd663651e4d520 (/dev/asmdisk/asmdisk2) [OCR]
3. ONLINE   5737c31731574fa8bf2acc107fbbd364 (/dev/asmdisk/asmdisk3) [OCR]

2)迁移

[root@rac1 ~]# crsctl replace votedisk +GRID
Successful addition of voting disk c82576064f384f98bf982381bba6e65e.
Successful addition of voting disk e85f4992c30d4ffabf96d91b28e58b72.
Successful addition of voting disk 4744602e92a64feebf66b3168810c9c5.
Successful deletion of voting disk 544b7b2dc9f14f8dbf8f5c560a32a95f.
Successful deletion of voting disk c4035c7009be4f26bffd663651e4d520.
Successful deletion of voting disk 5737c31731574fa8bf2acc107fbbd364.
Successfully replaced voting disk group with +GRID.
CRS-4266: Voting file(s) successfully replaced

3)确认文件新路径
[root@rac1 ~]# crsctl query css votedisk
## STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
1. ONLINE   c82576064f384f98bf982381bba6e65e (/dev/asmdisk/asmdisk6) [GRID]
2. ONLINE   e85f4992c30d4ffabf96d91b28e58b72 (/dev/asmdisk/asmdisk7) [GRID]
3. ONLINE   4744602e92a64feebf66b3168810c9c5 (/dev/asmdisk/asmdisk8) [GRID]
Located 3 voting disk(s).

5. 迁移OCR备份

1)找到OCR备份位置
[root@rac1 ~]# ocrconfig -showbackup

rac2     2022/04/29 07:55:40     +CRS:/ora12c-cluster/OCRBACKUP/backup00.ocr.260.1103270133     3342960164

rac2     2022/04/29 03:55:31     +CRS:/ora12c-cluster/OCRBACKUP/backup01.ocr.266.1103255723     3342960164

rac2     2022/04/28 23:55:22     +CRS:/ora12c-cluster/OCRBACKUP/backup02.ocr.264.1103241313     3342960164

rac2     2022/04/28 03:54:17     +CRS:/ora12c-cluster/OCRBACKUP/day.ocr.259.1103169257     3342960164

rac1     2022/04/19 08:04:16     +CRS:/ora12c-cluster/OCRBACKUP/week.ocr.261.1102406657     3342960164
PROT-25: Manual backups for the Oracle Cluster Registry are not available

2)重新配置OCR备份路径,并备份一次

[root@rac1 ~]# ocrconfig -backuploc +GRID
There are automatic OCR backups that are taken in the past 4 hours, 8 hours, 12 hours, and in the last day and week. Until this time passes, we can run manual backup for safety:

[root@rac1 ~]# ocrconfig -manualbackup

rac2 2022/04/29 10:38:54     +GRID:/ora12c-
cluster/OCRBACKUP/backup_20220429_103854.ocr.257.1089980415     3342960164

3)确认
[root@rac1 ~]# ocrconfig -showbackup

rac2     2022/04/29 07:55:40     +CRS:/ora12c-cluster/OCRBACKUP/backup00.ocr.260.1103270133     3342960164

rac2     2022/04/29 03:55:31     +CRS:/ora12c-cluster/OCRBACKUP/backup01.ocr.266.1103255723     3342960164

rac2     2022/04/28 23:55:22     +CRS:/ora12c-cluster/OCRBACKUP/backup02.ocr.264.1103241313     3342960164

rac2     2022/04/28 03:54:17     +CRS:/ora12c-cluster/OCRBACKUP/day.ocr.259.1103169257     3342960164

rac1     2022/04/19 08:04:16     +CRS:/ora12c-cluster/OCRBACKUP/week.ocr.261.1102406657     3342960164

rac2     2022/04/29 10:38:54     +GRID:/ora12c-cluster/OCRBACKUP/backup_20220429_103854.ocr.257.1089980415     3342960164


本文作者:张连坤(上海新炬王翦团队)

本文来源:“IT那活儿”公众号

文章转载自IT那活儿,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论