Oracle rac如何替换OCR和VOTE磁盘组

2024年 5月 23日 77.5k 0

昨天公众号发了利用ASM实现存储的零停机存储迁移,有粉丝后台私信,DATA/ARCH DG可以这样加盘踢盘实现零停机存储迁移。但是OCR磁盘组如何来替换呢?

利用ASM功能实现Oracle RAC零停机存储迁移

翻文档,找到了之前给一套Solaris 10+oracle 11g rac  环境替换ocr和vote log在这里分享给大家,背景是存储换代由原来的HP EVA6000替换为HDS VSP400,具体的步骤如下

1.create new vdisk on storage

2. two node find new disk

小机平台发现新加存储盘命令 ,有一定的概率怎么都无法发现新加存储,需要无法发现需要重启OS

--AIXcfgmgrlspv--solaris cfgadm -al -o show_FCP_devdevfsadm -v format

 3. change disk own  

修改新加磁盘属性

chown -R grid:asmadmin ssd@g60060e801227c400504027c400000017*chmod -R 660 ssd@g60060e801227c400504027c400000017* chdev -l hdisk10 -a reserve_policy=no_reserve

 4.  check disk on ASM 

select group_number,name,path,total_mb,free_mb from v$asm_disk order by group_number,name;select name,state,type,total_mb,free_mb from v$asm_diskgroup;

 5. create new disk group for switch OCR

创建新的ocr磁盘组 用来替换原有旧存储OCR磁盘组

CREATE DISKGROUP NSFC3DB_CRS_N EXTERNAL REDUNDANCY DISK '/dev/rdsk/c0t60060E801227C400504027C40000000Ad0s6';

 6 .check diskgroup compatible

参看磁盘组兼容性

select NAME ,COMPATIBILITY,DATABASE_COMPATIBILITY from v$asm_diskgroup;

 7. change diskgroup compatible 

 将磁盘组兼容性都改到11.2

 alter diskgroup NSFC3DB_CRS_N  set attribute 'compatible.asm'='11.2';  select NAME ,COMPATIBILITY,DATABASE_COMPATIBILITY from v$asm_diskgroup;alter diskgroup NSFC3DB_CRS_N set attribute 'compatible.rdbms'='11.2';select NAME ,COMPATIBILITY,DATABASE_COMPATIBILITY from v$asm_diskgroup;

8.ocrcheck 

ocrcheck -config /var/opt/oracle/ocr.loc --solarismore /etc/oracle/ocr.loc ---AIX/LINUX

9 . add new OCR diskgroup 

ocrconfig -add +NSFC3DB_CRS_Nocrcheck -configmore /etc/oracle/ocr.loc

local_only=false[root@nsfc3rac1:/]# ocrconfig -add +NSFC3DB_CRS_N[root@nsfc3rac1:/]# cat /var/opt/oracle/ocr.loc#Device/file getting replaced by device +NSFC3DB_CRS ocrconfig_loc=+NSFC3DB_CRSocrmirrorconfig_loc=+NSFC3DB_CRS_N ---add mirror ocr

10. delete old OCR diskgroup

ocrconfig -delete +NSFC3DB_CRS

11 . check OCR SWITCH 

ocrcheck -config more /etc/oracle/ocr.loc[root@nsfc3rac1:/]# cat /var/opt/oracle/ocr.loc#Device/file +NSFC3DB_CRS getting replaced by device +NSFC3DB_CRS_N ocrconfig_loc=+NSFC3DB_CRS_N[root@nsfc3rac1:/]# ocrcheck -config Oracle Cluster Registry configuration is :         Device/File Name         : +NSFC3DB_CRS_N

12. switch VOTE disk

crsctl replace votedisk +NSFC3DB_CRS_NSuccessful addition of voting disk 82a755bee2764f34bf42ef09300ee70e.Successful deletion of voting disk 700be500eddf4f6fbf181e91149f5398.Successfully replaced voting disk group with +NSFC3DB_CRS_N.CRS-4266: Voting file(s) successfully replacedsfc3rc2:/# sfc3rc2:/# crsctl query css votedisk## STATE File Universal Id File Name Disk group-- ----- ----------------- --------- ---------1. ONLINE 82a755bee2764f34bf42ef09300ee70e (/dev/rhdisk9) [NSFC3DB_CRS_N]Located 1 voting disk(s).

13.create new spfile on new OCR DG

create pfile='/u01/app/oracle/init.ora' from spfile;create spfile='+NSFC3DB_CRS_N' from pfile='/u01/app/oracle/init.ora'    

14. drop old OCR diskgroup 

SQL> alter diskgroup NSFC3DB_CRS dismount force; Diskgroup altered.SQL> SQL> drop diskgroup NSFC3DB_CRS force including contents;Diskgroup dropped.SQL> SQL> select path,total_mb,free_mb,name,state from v$asm_disk order by path;

15. restart db ASM

16. check crs status

17. check spfile location 

show parameter spfile

18. delete from crs_stat 

srvctl disable diskgroup -g NSFC3DB_CRSsrvctl remove diskgroup -g NSFC3DB_CRS -f

19. check crs

crs_stat -t -v

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论