oracle RAC 更换存储迁移数据(在线迁移ASM磁盘组)测试

oracle RAC 更换存储迁移数据(在线迁移ASM磁盘组)测试
雨丶花丶石 2017-03-10 17:09:09 7790 收藏 2
展开
oracle RAC 更换存储迁移数据
我们利用ASM rebalance特性实现更换存储迁移数据的需求
基本零宕机时间(操作步骤总结)
1)保证新存储和RAC当前节点间的可用性;
2)新存储划分LUN,可以重新规划存储方案;
3)迁移OCR和表决盘
4)给现有ASM磁盘组添加ASM磁盘(新存储分配的),充分利用ASM REBALANCE技术
5)删除原存储的ASM磁盘
6)观察期

注意:
1).关于替换ocr votedisk 已经在之前的文章里已经测试过了,详细可参考:
http://blog.csdn.net/shiyu1157758655/article/details/61195600

2)本次接着上次的ocr votedisk 的替换之后,替换数据磁盘组

具体步骤:
1.登录到ASM实例,查看当前磁盘组的信息
SQL> select group_number,name,type,total_mb,free_mb from v$asm_diskgroup;


GROUP_NUMBER NAME      TYPE     TOTAL_MB    FREE_MB
------------ ---------------------------------------- ------ ---------- ----------
  1 DATA      EXTERN  51200      47921
  2 FRA_ARC      EXTERN  20480      19557
  3 OCR_VOTING_NEW      NORMAL  12288      11236


SQL>

注意:其中OCR_VOTING_NEW 是之前新添替换的OCR磁盘


SQL>  select NAME,PATH,total_mb,free_mb from v$asm_disk;


NAME                                             PATH           TOTAL_NAME FRR_MB

------------ ---------------------------------------- ------ ---------- ----------
OCR_VOTING_NEW_0002   /dev/asm-diskj 4096   3745
OCR_VOTING_NEW_0001   /dev/asm-diski 4096   3746
OCR_VOTING_NEW_0000   /dev/asm-diskh 4096   3745
FRA_ARC_0000                   /dev/asm-diskg 20480 19557
DATA_0000                /dev/asm-diskf 51200 47911
                     /dev/asm-diskd 0 0
                       /dev/asm-diskc 0 0
                     /dev/asm-diske 0 0
                                         /dev/asm-diskl 0 0
                                        /dev/asm-diskk 0 0


注意:/dev/asm-diskc /dev/asm-diskd /dev/asm-diske 这3个磁盘是之前旧的OCR VOTDDISK 的3块盘


/dev/asm-diskk  为要添加的新的DATA 磁盘


/dev/asm-diskl  为要添加的新的日志盘


2.迁移数据磁盘组数据


SQL> alter diskgroup DATA add disk '/dev/asm-diskk' rebalance power 11; //添加磁盘data磁盘


Diskgroup altered.


SQL> alter diskgroup FRA_ARC add disk '/dev/asm-diskl' rebalance power 11;//添加磁盘日志磁盘


SQL> select * from v$asm_operation;


GROUP_NUMBER OPERA STAT      POWER     ACTUAL   SOFAR   EST_WORK   EST_RATE
------------ ----- ---- ---------- ---------- ---------- ---------- ----------
EST_MINUTES ERROR_CODE
----------- --------------------------------------------
  1 REBAL RUN 11   11     550       1460  1546
 0


由于指定rebalance power 11,ASM会自动均衡ASM磁盘组DATA里面存放的数据在各ASM磁盘的分布。

当rebalance结束后,查询V$ASM_OPERATION视图,将不会返回信息。

注意一定要查询未空时才能进行删除操作

SQL> select * from v$asm_operation;


no rows selected
此时查询磁盘组信息

SQL> select group_number,name,type,total_mb,free_mb from v$asm_diskgroup;


GROUP_NUMBER NAME      TYPE     TOTAL_MB    FREE_MB
------------ ---------------------------------------- ------ ---------- ----------
  1 DATA      EXTERN  92160      88869
  2 FRA_ARC      EXTERN  40960      40035
  3 OCR_VOTING_NEW      NORMAL  12288      11236


SQL>


观察DATA和FRA_ARC的磁盘大小

SQL> select name,path,state from v$asm_disk;
------------ ---------------------------------
NAME                PATH             STATE
FRA_ARC_0001    /dev/asm-diskl   NORMAL
DATA_0001    /dev/asm-diskk   NORMAL
OCR_VOTING_NEW_0002 /dev/asm-diskj   NORMAL
OCR_VOTING_NEW_0001 /dev/asm-diski   NORMAL
OCR_VOTING_NEW_0000 /dev/asm-diskh   NORMAL
FRA_ARC_0000    /dev/asm-diskg   NORMAL
DATA_0000    /dev/asm-diskf   NORMAL
           /dev/asm-diskd   NORMAL
           /dev/asm-diskc   NORMAL
           /dev/asm-diske   NORMAL


3.删除数据磁盘组上的旧的磁盘


SQL> alter diskgroup DATA drop disk 'DATA_0000' rebalance power 11;


Diskgroup altered.


SQL> alter diskgroup FRA_ARC drop disk 'FRA_ARC_0000' rebalance power 11;


Diskgroup altered.



SQL> select * from v$asm_operation;


GROUP_NUMBER OPERA STAT      POWER     ACTUAL   SOFAR   EST_WORK   EST_RATE EST_MINUTES ERROR_CODE
------------ ----- ---- ---------- ---------- ---------- ---------- ---------- ----------- --------------------------------------------
  1 REBAL RUN 11   11     122       1827   730 2






SQL>  select * from v$asm_operation;


no rows selected


SQL>


ASM不但向磁盘组中加入新磁盘时会做rebalance,在删除ASM磁盘时也会rebalance,将该磁盘上的数据rebalance到其他该磁盘组的磁盘中。

按照此方法删除ASM磁盘后,ASM的所有数据都已经存放在新的存储上。

这时在查看磁盘组信息
SQL> select group_number,name,type,total_mb,free_mb from v$asm_diskgroup;


GROUP_NUMBER NAME      TYPE     TOTAL_MB    FREE_MB
------------ ---------------------------------------- ------ ---------- ----------
  1 DATA      EXTERN  40960      37671
  2 FRA_ARC      EXTERN  20480      19557
  3 OCR_VOTING_NEW      NORMAL  12288      11236


SQL>
注意观察此时的磁盘组大小

SQL> select name,path,state from v$asm_disk;


NAME                 PATH               STATE
------------ ----------------------------------------
FRA_ARC_0001     /dev/asm-diskl NORMAL
DATA_0001     /dev/asm-diskk NORMAL
OCR_VOTING_NEW_0002  /dev/asm-diskj NORMAL
OCR_VOTING_NEW_0001  /dev/asm-diski NORMAL
OCR_VOTING_NEW_0000  /dev/asm-diskh NORMAL
    /dev/asm-diskd NORMAL
            /dev/asm-diskc NORMAL
            /dev/asm-diske NORMAL
            /dev/asm-diskf NORMAL

            /dev/asm-diskg NORMAL

查看crs是否正常

+ASM1:/home/grid@rac1>crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       rac1                                         
               ONLINE  ONLINE       rac2                                         
               ONLINE  ONLINE       rac3                                         
ora.FRA_ARC.dg
               ONLINE  ONLINE       rac1                                         
               ONLINE  ONLINE       rac2                                         
               ONLINE  ONLINE       rac3                                         
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac1                                         
               ONLINE  ONLINE       rac2                                         
               ONLINE  ONLINE       rac3                                         
ora.OCR_VOTING_NEW.dg
               ONLINE  ONLINE       rac1                                         
               ONLINE  ONLINE       rac2                                         
               ONLINE  ONLINE       rac3                                         
ora.asm
               ONLINE  ONLINE       rac1                     Started             
               ONLINE  ONLINE       rac2                     Started             
               ONLINE  ONLINE       rac3                     Started             
ora.gsd
               OFFLINE OFFLINE      rac1                                         
               OFFLINE OFFLINE      rac2                                         
               OFFLINE OFFLINE      rac3                                         
ora.net1.network
               ONLINE  ONLINE       rac1                                         
               ONLINE  ONLINE       rac2                                         
               ONLINE  ONLINE       rac3                                         
ora.ons
               ONLINE  ONLINE       rac1                                         
               ONLINE  ONLINE       rac2                                         
               ONLINE  ONLINE       rac3                                         
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac1                                         
ora.cvu
      1        ONLINE  ONLINE       rac3                                         
ora.oc4j
      1        ONLINE  ONLINE       rac3                                         
ora.rac.db
      1        ONLINE  ONLINE       rac1                     Open                
      2        ONLINE  ONLINE       rac2                     Open                
      3        ONLINE  ONLINE       rac3                     Open                
ora.rac1.vip
      1        ONLINE  ONLINE       rac1                                         
ora.rac2.vip
      1        ONLINE  ONLINE       rac2                                         
ora.rac3.vip
      1        ONLINE  ONLINE       rac3                                         
ora.scan1.vip
      1        ONLINE  ONLINE       rac1                                         
+ASM1:/home/grid@rac1>


至此在线迁移ASM磁盘组测试结束
————————————————
版权声明:本文为CSDN博主「雨丶花丶石」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/shiyu1157758655/article/details/61200819

posted @ 2020-04-28 10:05  耀阳居士  阅读(1355)  评论(0编辑  收藏  举报