• 【11grac】Oracle RAC 更换存储实验


    【11grac】Oracle RAC 更换存储实验

    rac专栏收录该内容
    27 篇文章0 订阅

    实验环境准备:
    RHEL 6.5 + Oracle 11.2.0.4 RAC (2nodes)

    1. OCR和Voting Disk使用的是OCR1磁盘组,底层对应3个1G大小的共享LUN,一般冗余;
    2. DATA使用的是DATA1磁盘组,底层对应的是3个5G大小的共享LUN,外部冗余;
    3. FRA使用的是FRA1磁盘组,底层对应的是1个5G大小的共享LUN,外部冗余;
    4. 额外添加7个共享LUN(3个1G大小,4个5G大小),用来模拟新的存储映射出来的共享LUN;

    我这里是使用Oracle VM VirtualBox 4.3虚拟机软件模拟这个环境,
    默认初始的RAC环境已经安装完毕,且已经存有业务数据。
    对于RAC环境的安装可参考:

    模拟的业务数据可参考 模拟业务最小测试用例01 第1~5步进行初始化。

    初始的RAC环境配置信息:

    1.  
      #public ip
    2.  
      192.168.56.150 jyrac1
    3.  
      192.168.56.152 jyrac2
    4.  
      #private ip
    5.  
      10.10.10.11 jyrac1-priv
    6.  
      10.10.10.12 jyrac2-priv
    7.  
      #virtual ip
    8.  
      192.168.56.151 jyrac1-vip
    9.  
      192.168.56.153 jyrac2-vip
    10.  
      #scan ip
    11.  
      192.168.56.160 jyrac-scan

    本次需求:
    更换RAC的共享存储,即把之前的存储设备划出的共享LUN上的所有数据全部迁移新的存储设备划分的LUN上。
    具体就涉及到OCR,voting disk迁移,DATA迁移。
    在我这里实验具体就是指OCR1,DATA1,FRA1磁盘组的迁移。

    一、准备工作

    二、更换存储

    一、准备工作

    1.1查看asm磁盘组

    select name, TOTAL_MB, FREE_MB, state, type, COMPATIBILITY from v$asm_diskgroup;

    1.  
      SQL> select name, TOTAL_MB, FREE_MB, state, type, COMPATIBILITY from v$asm_diskgroup;
    2.  
       
    3.  
      NAME TOTAL_MB FREE_MB STATE TYPE COMPATIBILITY
    4.  
       
    5.  
      DATA1 15360 13502 MOUNTED EXTERN 11.2.0.0.0
    6.  
      FRA1 5120 4790 MOUNTED EXTERN 11.2.0.0.0
    7.  
      OCR1 3072 2146 MOUNTED NORMAL 11.2.0.0.0

    1.2查看asm的磁盘信息

    select GROUP_NUMBER, DISK_NUMBER, TOTAL_MB, FREE_MB, NAME, PATH from v$asm_disk order by 1,2;

    1.  
      SQL> set linesize 1000
    2.  
      SQL> r
    3.  
      1* select GROUP_NUMBER, DISK_NUMBER, TOTAL_MB, FREE_MB, NAME, PATH from v$asm_disk order by 1,2
    4.  
       
    5.  
      GROUP_NUMBER DISK_NUMBER TOTAL_MB FREE_MB NAME PATH
    6.  
       
    7.  
      1 0 1024 714 OCR1_0000 /dev/asm-diskb
    8.  
      1 1 1024 716 OCR1_0001 /dev/asm-diskc
    9.  
      1 2 1024 716 OCR1_0002 /dev/asm-diskd
    10.  
      2 0 5120 4552 DATA1_0000 /dev/asm-diske
    11.  
      2 1 5120 4549 DATA1_0001 /dev/asm-diskf
    12.  
      2 2 5120 4549 DATA1_0002 /dev/asm-diskg
    13.  
      3 0 5120 4790 FRA1_0000 /dev/asm-diskh
    14.  
       
    15.  
      7 rows selected.

    1.3查看存储设备信息,确定新的存储

    这里实验环境是使用virtualbox模拟添加7个大小和之前一样的共享存储;
    即分别为 1G大小的3个(OCR2),5G大小的3个(DATA1),5G大小的1个(FRA1)。

    NewStorage1
    NewStorage2
    NewStorage3
    NewStorage4
    NewStorage5
    NewStorage6
    NewStorage7
    在系统中就是/dev/sdi j k l m n o

    udev绑定(两个节点root执行)

    1.  
      --New Shared Disks
    2.  
      for i in i j k l m n o;
    3.  
      do
    4.  
      echo "KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`", NAME="asm-disk$i", OWNER="grid", GROUP="asmadmin", MODE="0660"" >> /etc/udev/rules.d/99-oracle-asmdevices.rules
    5.  
      done

    udev绑定后对应就是asm-diski,j,k,l,m,n,o

    start_udev (两个节点root执行)

    查看某个磁盘大小:

    1.  
      [root@jyrac1 ~]# fdisk -l /dev/asm-diski
    2.  
       
    3.  
      Disk /dev/asm-diski: 1073 MB, 1073741824 bytes
    4.  
      255 heads, 63 sectors/track, 130 cylinders
    5.  
      Units = cylinders of 16065 * 512 = 8225280 bytes
    6.  
      Sector size (logical/physical): 512 bytes / 512 bytes
    7.  
      I/O size (minimum/optimal): 512 bytes / 512 bytes
    8.  
      Disk identifier: 0x00000000

    确定/dev/asm-diski,/dev/asm-diskj,/dev/asm-diskk对应的是新加的1G大小的3个盘
    用于创建新的OCR2

    二、更换存储

    2.1迁移OCR1到OCR2

    2.1.1 创建新的OCR2磁盘组

    su – grid
    sqlplus / as sysasm
    CREATE DISKGROUP OCR2 NORMAL REDUNDANCY DISK '/dev/asm-diski', '/dev/asm-diskj', '/dev/asm-diskk' ATTRIBUTE 'compatible.asm'='11.2';

    1.  
      SQL> CREATE DISKGROUP OCR2 NORMAL REDUNDANCY DISK '/dev/asm-diski', '/dev/asm-diskj', '/dev/asm-diskk' ATTRIBUTE 'compatible.asm'='11.2';
    2.  
       
    3.  
      Diskgroup created.

    查看两个节点是否添加了OCR2:

    1.  
      --节点1:
    2.  
      SQL> r
    3.  
      1* select name, TOTAL_MB, FREE_MB, state, type, COMPATIBILITY from v$asm_diskgroup
    4.  
       
    5.  
      NAME TOTAL_MB FREE_MB STATE TYPE COMPATIBILITY
    6.  
      ------------------------------------------------------------ ---------- ---------- ---------------------- ------------ ------------------------------------------------------------------------------------------------------------------------
    7.  
      DATA1 15360 13502 MOUNTED EXTERN 11.2.0.0.0
    8.  
      FRA1 5120 4790 MOUNTED EXTERN 11.2.0.0.0
    9.  
      OCR1 3072 2146 MOUNTED NORMAL 11.2.0.0.0
    10.  
      OCR2 3072 2913 MOUNTED NORMAL 11.2.0.0.0
    11.  
       
    12.  
      --节点2:
    13.  
      SQL> select name, TOTAL_MB, FREE_MB, state, type, COMPATIBILITY from v$asm_diskgroup
    14.  
      2 ;
    15.  
       
    16.  
      NAME TOTAL_MB FREE_MB STATE TYPE COMPATIBILITY
    17.  
      ------------------------------------------------------------ ---------- ---------- ---------------------- ------------ ------------------------------------------------------------------------------------------------------------------------
    18.  
      DATA1 15360 13502 MOUNTED EXTERN 11.2.0.0.0
    19.  
      FRA1 5120 4790 MOUNTED EXTERN 11.2.0.0.0
    20.  
      OCR1 3072 2146 MOUNTED NORMAL 11.2.0.0.0
    21.  
      OCR2 0 0 DISMOUNTED 0.0.0.0.0

    发现节点2需要手动mount新加的ASM磁盘组
    sqlplus / as sysasm

    1.  
      SQL> alter diskgroup OCR2 mount;
    2.  
       
    3.  
      Diskgroup altered.

    2.1.2 添加OCR信息到OCR2

    more /etc/oracle/ocr.loc
    ocrconfig -add +OCR2
    ocrcheck -config
    more /etc/oracle/ocr.loc

    1.  
      [root@jyrac1 ~]# more /etc/oracle/ocr.loc
    2.  
      ocrconfig_loc=+OCR1
    3.  
      local_only=FALSE
    4.  
      [root@jyrac1 ~]# ocrconfig -add +OCR2
    5.  
      [root@jyrac1 ~]#
    6.  
      [root@jyrac1 ~]# ocrcheck -config
    7.  
      Oracle Cluster Registry configuration is :
    8.  
      Device/File Name : +OCR1
    9.  
      Device/File Name : +OCR2
    10.  
      [root@jyrac1 ~]# more /etc/oracle/ocr.loc
    11.  
      #Device/file getting replaced by device +OCR2
    12.  
      ocrconfig_loc=+OCR1
    13.  
      ocrmirrorconfig_loc=+OCR2
    14.  
      local_only=false
    15.  
      [root@jyrac1 ~]# ocrcheck && crsctl query css votedisk
    16.  
      Status of Oracle Cluster Registry is as follows :
    17.  
      Version : 3
    18.  
      Total space (kbytes) : 262120
    19.  
      Used space (kbytes) : 3116
    20.  
      Available space (kbytes) : 259004
    21.  
      ID : 1718040627
    22.  
      Device/File Name : +OCR1
    23.  
      Device/File integrity check succeeded
    24.  
      Device/File Name : +OCR2
    25.  
      Device/File integrity check succeeded
    26.  
       
    27.  
      Device/File not configured
    28.  
       
    29.  
      Device/File not configured
    30.  
       
    31.  
      Device/File not configured
    32.  
       
    33.  
      Cluster registry integrity check succeeded
    34.  
       
    35.  
      Logical corruption check succeeded
    36.  
       
    37.  
      ## STATE File Universal Id File Name Disk group
    38.  
      -- ----- ----------------- --------- ---------
    39.  
      1. ONLINE ab583d47c34a4f0ebfd46c8b04d7332b (/dev/asm-diskb) [OCR1]
    40.  
      2. ONLINE 853e95652d994fe3bfdf21ca23e65dfc (/dev/asm-diskc) [OCR1]
    41.  
      3. ONLINE 9f712a096a7b4f9bbfd811bff6462157 (/dev/asm-diskd) [OCR1]
    42.  
      Located 3 voting disk(s).

    2.1.3迁移VOTE DISK到新创建的ASM磁盘组OCR2上

    crsctl replace votedisk +OCR2 (一个节点root执行)
    先查询:

    1.  
      SQL> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
    2.  
       
    3.  
      GROUP_NUMBER NAME STATE TYPE TOTAL_MB FREE_MB VO COMPATIBILITY
    4.  
      ------------ ------------------------------------------------------------ ---------------------- ------------ ---------- ---------- -- ------------------------------------------------------------------------------------------------------------------------
    5.  
      1 DATA1 MOUNTED EXTERN 15360 13502 N 11.2.0.0.0
    6.  
      2 FRA1 MOUNTED EXTERN 5120 4790 N 11.2.0.0.0
    7.  
      3 OCR1 MOUNTED NORMAL 3072 2146 Y 11.2.0.0.0
    8.  
      4 OCR2 MOUNTED NORMAL 3072 2244 N 11.2.0.0.0

    替换为新添加的OCR2:

    1.  
      [root@jyrac1 ~]# crsctl replace votedisk +OCR2
    2.  
      Successful addition of voting disk 83f3dea9f4c24fccbf05eaa163c5c087.
    3.  
      Successful addition of voting disk ad21c1f0452e4f4abff906127ff9fcc3.
    4.  
      Successful addition of voting disk 2771819c65984f85bf366e74ee85781a.
    5.  
      Successful deletion of voting disk ab583d47c34a4f0ebfd46c8b04d7332b.
    6.  
      Successful deletion of voting disk 853e95652d994fe3bfdf21ca23e65dfc.
    7.  
      Successful deletion of voting disk 9f712a096a7b4f9bbfd811bff6462157.
    8.  
      Successfully replaced voting disk group with +OCR2.
    9.  
      CRS-4266: Voting file(s) successfully replaced

    再查询:

    1.  
      SQL> r
    2.  
      1* select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup
    3.  
       
    4.  
      GROUP_NUMBER NAME STATE TYPE TOTAL_MB FREE_MB VO COMPATIBILITY
    5.  
      ------------ ------------------------------------------------------------ ---------------------- ------------ ---------- ---------- -- ------------------------------------------------------------------------------------------------------------------------
    6.  
      1 DATA1 MOUNTED EXTERN 15360 13502 N 11.2.0.0.0
    7.  
      2 FRA1 MOUNTED EXTERN 5120 4790 N 11.2.0.0.0
    8.  
      3 OCR1 MOUNTED NORMAL 3072 2242 N 11.2.0.0.0
    9.  
      4 OCR2 MOUNTED NORMAL 3072 2148 Y 11.2.0.0.0

    发现已经voting file已经在OCR2上,然后在两个节点root查询:
    ocrcheck && crsctl query css votedisk

    1.  
      [root@jyrac1 ~]# ocrcheck && crsctl query css votedisk
    2.  
      Status of Oracle Cluster Registry is as follows :
    3.  
      Version : 3
    4.  
      Total space (kbytes) : 262120
    5.  
      Used space (kbytes) : 3116
    6.  
      Available space (kbytes) : 259004
    7.  
      ID : 1718040627
    8.  
      Device/File Name : +OCR1
    9.  
      Device/File integrity check succeeded
    10.  
      Device/File Name : +OCR2
    11.  
      Device/File integrity check succeeded
    12.  
       
    13.  
      Device/File not configured
    14.  
       
    15.  
      Device/File not configured
    16.  
       
    17.  
      Device/File not configured
    18.  
       
    19.  
      Cluster registry integrity check succeeded
    20.  
       
    21.  
      Logical corruption check succeeded
    22.  
       
    23.  
      ## STATE File Universal Id File Name Disk group
    24.  
      -- ----- ----------------- --------- ---------
    25.  
      1. ONLINE 83f3dea9f4c24fccbf05eaa163c5c087 (/dev/asm-diski) [OCR2]
    26.  
      2. ONLINE ad21c1f0452e4f4abff906127ff9fcc3 (/dev/asm-diskj) [OCR2]
    27.  
      3. ONLINE 2771819c65984f85bf366e74ee85781a (/dev/asm-diskk) [OCR2]
    28.  
      Located 3 voting disk(s).
    29.  
       
    30.  
      [root@jyrac2 ~]# ocrcheck && crsctl query css votedisk
    31.  
      Status of Oracle Cluster Registry is as follows :
    32.  
      Version : 3
    33.  
      Total space (kbytes) : 262120
    34.  
      Used space (kbytes) : 3116
    35.  
      Available space (kbytes) : 259004
    36.  
      ID : 1718040627
    37.  
      Device/File Name : +OCR1
    38.  
      Device/File integrity check succeeded
    39.  
      Device/File Name : +OCR2
    40.  
      Device/File integrity check succeeded
    41.  
       
    42.  
      Device/File not configured
    43.  
       
    44.  
      Device/File not configured
    45.  
       
    46.  
      Device/File not configured
    47.  
       
    48.  
      Cluster registry integrity check succeeded
    49.  
       
    50.  
      Logical corruption check succeeded
    51.  
       
    52.  
      ## STATE File Universal Id File Name Disk group
    53.  
      -- ----- ----------------- --------- ---------
    54.  
      1. ONLINE 83f3dea9f4c24fccbf05eaa163c5c087 (/dev/asm-diski) [OCR2]
    55.  
      2. ONLINE ad21c1f0452e4f4abff906127ff9fcc3 (/dev/asm-diskj) [OCR2]
    56.  
      3. ONLINE 2771819c65984f85bf366e74ee85781a (/dev/asm-diskk) [OCR2]
    57.  
      Located 3 voting disk(s).

    2.1.4 创建ASM实例spfile到新创建的OCR2 ASM磁盘组上

    一个节点grid用户登录ASM实例执行:
    create pfile='/tmp/asmpfile.ora' from spfile;
    create spfile='+OCR2' from pfile='/tmp/asmpfile.ora';

    1.  
      SQL> show parameter pfile
    2.  
       
    3.  
      NAME TYPE VALUE
    4.  
      ------------------------------------ ---------------------- ------------------------------
    5.  
      spfile string +OCR1/jyrac-scan/asmparameterf
    6.  
      ile/registry.253.919993739
    7.  
      SQL> create pfile='/tmp/asmpfile.ora' from spfile;
    8.  
       
    9.  
      File created.
    10.  
       
    11.  
      SQL> create spfile='+OCR2' from pfile='/tmp/asmpfile.ora';
    12.  
       
    13.  
      File created.
    14.  
       
    15.  
      SQL> show parameter pfile
    16.  
       
    17.  
      NAME TYPE VALUE
    18.  
      ------------------------------------ ---------------------- ------------------------------
    19.  
      spfile string +OCR1/jyrac-scan/asmparameterf
    20.  
      ile/registry.253.919993739

    2.1.5 删除OCR原位置ASM磁盘组OCR1

    一个节点root执行:
    [root@jyrac1 ~]# ocrconfig -delete +OCR1

    两个节点root执行:
    查看OCR和VOTE新状态与位置
    [root@jyrac1 ~]# ocrcheck && crsctl query css votedisk

    1.  
      [root@jyrac1 ~]# ocrconfig -delete +OCR1
    2.  
      [root@jyrac1 ~]# ocrcheck && crsctl query css votedisk
    3.  
      Status of Oracle Cluster Registry is as follows :
    4.  
      Version : 3
    5.  
      Total space (kbytes) : 262120
    6.  
      Used space (kbytes) : 3116
    7.  
      Available space (kbytes) : 259004
    8.  
      ID : 1718040627
    9.  
      Device/File Name : +OCR2
    10.  
      Device/File integrity check succeeded
    11.  
       
    12.  
      Device/File not configured
    13.  
       
    14.  
      Device/File not configured
    15.  
       
    16.  
      Device/File not configured
    17.  
       
    18.  
      Device/File not configured
    19.  
       
    20.  
      Cluster registry integrity check succeeded
    21.  
       
    22.  
      Logical corruption check succeeded
    23.  
       
    24.  
      ## STATE File Universal Id File Name Disk group
    25.  
      -- ----- ----------------- --------- ---------
    26.  
      1. ONLINE 83f3dea9f4c24fccbf05eaa163c5c087 (/dev/asm-diski) [OCR2]
    27.  
      2. ONLINE ad21c1f0452e4f4abff906127ff9fcc3 (/dev/asm-diskj) [OCR2]
    28.  
      3. ONLINE 2771819c65984f85bf366e74ee85781a (/dev/asm-diskk) [OCR2]
    29.  
      Located 3 voting disk(s).
    30.  
      节点2的ocrcheck输出也没问题,略。

    2.1.6 重启整个集群

    两个节点root执行:
    crsctl stop crs && crsctl start crs

    2.1.7 将旧的磁盘组drop掉

    检查参数文件:

    1.  
      SQL> show parameter pfile
    2.  
       
    3.  
      NAME TYPE VALUE
    4.  
      ------------------------------------ ---------------------- ------------------------------
    5.  
      spfile string +OCR2/jyrac-scan/asmparameterf
    6.  
      ile/registry.253.920008067

    检查磁盘组状态:

    1.  
      Select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
    2.  
       
    3.  
      select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;

    最后将旧的磁盘组mount并drop掉:
    alter diskgroup OCR1 mount;
    drop diskgroup OCR1 including contents;

    1.  
      SQL> alter diskgroup OCR1 mount;
    2.  
      Diskgroup altered.
    3.  
       
    4.  
      SQL> drop diskgroup OCR1 including contents;
    5.  
      Diskgroup dropped.

    注:旧的磁盘组只允许在一个节点mount,如果发现多个节点mount,需要在其他节点dismount,否则会删除不掉旧的磁盘组。

    2.2迁移DATA1

    2.2.1 数据磁盘组DATA1添加

    确定/dev/asm-diskl,/dev/asm-diskm,/dev/asm-diskn对应的是新加的5G大小的3个盘
    用于数据磁盘组DATA1添加
    alter diskgroup DATA1 add disk '/dev/asm-diskl' rebalance power 7;
    alter diskgroup DATA1 add disk '/dev/asm-diskm', '/dev/asm-diskn' rebalance power 11;

    1.  
      SQL> alter diskgroup DATA1 add disk '/dev/asm-diskl' rebalance power 7;
    2.  
       
    3.  
      Diskgroup altered.
    4.  
       
    5.  
      SQL> alter diskgroup DATA1 add disk '/dev/asm-diskm', '/dev/asm-diskn' rebalance power 11;
    6.  
       
    7.  
      Diskgroup altered.

    这里说明可以单个添加,也可以多个添加。

    2.2.2 查询同步状态

    1.  
      set linesize 200
    2.  
      col NAME for a10
    3.  
      select name,allocation_unit_size,state,type,free_mb,required_mirror_free_mb req_mi_fr_mb,usable_file_mb
    4.  
      from v$asm_diskgroup;

    2.2.3 删除原存储的LUN

    所有磁盘添加进ASM磁盘组后,删除原存储的LUN。
    查询LUN path与asm_disk_name的对应关系
    select name,path from v$asm_disk;

    1.  
      SQL> select name,path from v$asm_disk
    2.  
       
    3.  
      NAME PATH
    4.  
      ---------- ------------------------------------------------------------
    5.  
      /dev/asm-diskc
    6.  
      /dev/asm-diskd
    7.  
      /dev/asm-disko
    8.  
      /dev/asm-diskb
    9.  
      OCR2_0001 /dev/asm-diskj
    10.  
      OCR2_0000 /dev/asm-diski
    11.  
      DATA1_0003 /dev/asm-diskl
    12.  
      DATA1_0004 /dev/asm-diskm
    13.  
      DATA1_0005 /dev/asm-diskn
    14.  
      OCR2_0002 /dev/asm-diskk
    15.  
      FRA1_0000 /dev/asm-diskh
    16.  
      DATA1_0001 /dev/asm-diskf
    17.  
      DATA1_0002 /dev/asm-diskg
    18.  
      DATA1_0000 /dev/asm-diske
    19.  
       
    20.  
      14 rows selected.

    确定是DATA1_0000,DATA1_0001,DATA1_0002
    删除磁盘组DATA1中旧存储对应的LUN:

    1.  
      alter diskgroup DATA1 drop disk DATA1_0000 rebalance power 7;
    2.  
      alter diskgroup DATA1 drop disk DATA1_0001,DATA1_0002 rebalance power 7;

    2.2.4 确认存储置换完成

    1.  
      select disk_number,path,total_mb,free_mb from v$asm_disk;
    2.  
       
    3.  
      DISK_NUMBER PATH TOTAL_MB FREE_MB
    4.  
      ----------- ------------------------------------------------------------ ---------- ----------
    5.  
      0 /dev/asm-diskc 0 0
    6.  
      1 /dev/asm-diskd 0 0
    7.  
      2 /dev/asm-disko 0 0
    8.  
      3 /dev/asm-diske 0 0
    9.  
      4 /dev/asm-diskf 0 0
    10.  
      5 /dev/asm-diskg 0 0
    11.  
      6 /dev/asm-diskb 0 0
    12.  
      1 /dev/asm-diskj 1024 715
    13.  
      0 /dev/asm-diski 1024 717
    14.  
      3 /dev/asm-diskl 5120 4502
    15.  
      4 /dev/asm-diskm 5120 4499
    16.  
      5 /dev/asm-diskn 5120 4501
    17.  
      2 /dev/asm-diskk 1024 714
    18.  
      0 /dev/asm-diskh 5120 4790
    19.  
       
    20.  
      14 rows selected.

    2.3迁移FRA1

    FRA1磁盘组和DATA1磁盘组的添加一样,

    1.  
      alter diskgroup FRA1 add disk '/dev/asm-disko' rebalance power 7;
    2.  
      alter diskgroup FRA1 drop disk FRA1_0000 rebalance power 7;
    3.  
      select disk_number,path,total_mb,free_mb from v$asm_disk;

    最后确定所有盘都置换完成:

    1.  
      SQL> select disk_number,path,total_mb,free_mb from v$asm_disk;
    2.  
       
    3.  
      DISK_NUMBER PATH TOTAL_MB FREE_MB
    4.  
      ----------- ------------------------------------------------------------ ---------- ----------
    5.  
      0 /dev/asm-diskc 0 0
    6.  
      1 /dev/asm-diskd 0 0
    7.  
      3 /dev/asm-diske 0 0
    8.  
      4 /dev/asm-diskf 0 0
    9.  
      5 /dev/asm-diskg 0 0
    10.  
      6 /dev/asm-diskb 0 0
    11.  
      1 /dev/asm-diskj 1024 715
    12.  
      0 /dev/asm-diski 1024 717
    13.  
      1 /dev/asm-disko 5120 4943
    14.  
      3 /dev/asm-diskl 5120 4502
    15.  
      4 /dev/asm-diskm 5120 4499
    16.  
      5 /dev/asm-diskn 5120 4501
    17.  
      2 /dev/asm-diskk 1024 714
    18.  
      0 /dev/asm-diskh 5120 4965
    19.  
       
    20.  
      14 rows selected.
    21.  
       
    22.  
      SQL> r
    23.  
      1* select disk_number,path,total_mb,free_mb from v$asm_disk
    24.  
       
    25.  
      DISK_NUMBER PATH TOTAL_MB FREE_MB
    26.  
      ----------- ------------------------------------------------------------ ---------- ----------
    27.  
      0 /dev/asm-diskc 0 0
    28.  
      1 /dev/asm-diskd 0 0
    29.  
      2 /dev/asm-diskh 0 0
    30.  
      3 /dev/asm-diske 0 0
    31.  
      4 /dev/asm-diskf 0 0
    32.  
      5 /dev/asm-diskg 0 0
    33.  
      6 /dev/asm-diskb 0 0
    34.  
      1 /dev/asm-diskj 1024 715
    35.  
      0 /dev/asm-diski 1024 717
    36.  
      1 /dev/asm-disko 5120 4790
    37.  
      3 /dev/asm-diskl 5120 4502
    38.  
      4 /dev/asm-diskm 5120 4499
    39.  
      5 /dev/asm-diskn 5120 4501
    40.  
      2 /dev/asm-diskk 1024 714
    41.  
       
    42.  
      14 rows selected.

    最终确定要替换的LUN都没有数据了,主机侧就可以操作了。

    2.4测试


    查看集群各资源状态:

    crsctl stat res -t

    查看OCR信息:

    ocrcheck && crsctl query css votedisk

    查询ASM实例的spfile文件:

    1.  
      sqlplus / as sysasm <<EOF
    2.  
      show parameter pfile
    3.  
      EOF

    查询之前的业务数据:

    1.  
      -- 业务查询SQL 1
    2.  
      select * from t1, t2 where t1.id = t2.t1_id and t1.n = 19;
    3.  
      -- 业务查询SQL 2
    4.  
      select * from t1, t2 where t1.id = t2.t1_id;

    至此,整个RAC环境更换存储的实验就全部完成了。

  • 相关阅读:
    异或运算用途
    js正则表达式子校验
    SMART原则
    边际成本,机会成本,沉默成本
    cxf 例子
    CXF使用JMS作为传输协议的配置
    js验证手机号,身份证,车牌号验证
    redis应用
    list集合去重复元素
    lodop
  • 原文地址:https://www.cnblogs.com/yaoyangding/p/15484442.html
Copyright © 2020-2023  润新知