删除冗余磁盘测试

环境:

DB:19.3.0.0

 

1.创建冗余磁盘组
create diskgroup failtest normal redundancy
failgroup failg1 disk '/dev/mapper/testdisk01' name f1
failgroup failg2 disk '/dev/mapper/testdisk02' name f2
ATTRIBUTE 'compatible.rdbms' = '19.0', 'compatible.asm' = '19.0';

 

2.破坏一个磁盘
dd if=/dev/zero of=/dev/mapper/testdisk01 bs=1024 count=1000

 

3.重新mount
SQL> alter diskgroup failtest dismount;

Diskgroup altered.

SQL> alter diskgroup failtest mount;
alter diskgroup failtest mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15017: diskgroup "FAILTEST" cannot be mounted
ORA-15040: diskgroup is incomplete

发现无法mount

 

4.使用force强制mount
SQL> alter diskgroup failtest mount force;

Diskgroup altered.

因为创建的是冗余磁盘组,另外一个磁盘是完好的,有一份镜像的数据

 

5.查看磁盘组情况

column NAME format a30;
column TYPE format a10;
column DISK_NUMBER format 99;
column LABEL format a20;
column PATH format a24;
column mount_status format a10;
column header_status format a10;


Select
 a.NAME,
 a.TYPE,
 b.DISK_NUMBER,
 b.NAME,
 b.LABEL,
 b.PATH,
 b.mount_status,
 b.header_status
From v$asm_diskgroup a,
     v$asm_disk b
Where a.GROUP_NUMBER = b.GROUP_NUMBER
  and a.name='FAILTEST'
Order By a.GROUP_NUMBER,b.DISK_NUMBER;

NAME       TYPE       DISK_NUMBER NAME       LABEL                PATH                     MOUNT_STAT HEADER_STA
---------- ---------- ----------- ---------- -------------------- ------------------------ ---------- ----------
FAILTEST   NORMAL               0 F1                                                       MISSING    UNKNOWN
FAILTEST   NORMAL               1 F2                              /dev/mapper/testdisk02   CACHED     MEMBER

发现磁盘0处于MISSING状态

 

6.将磁盘重建加入到磁盘组
SQL> alter diskgroup FAILTEST add disk '/dev/mapper/testdisk01' name f1 rebalance power 5 wait;
alter diskgroup FAILTEST add disk '/dev/mapper/testdisk01' name f1 rebalance power 5 wait
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15020: discovered duplicate ASM disk "F1"

原来的名称已经存在了,换个名称
SQL> alter diskgroup FAILTEST add disk '/dev/mapper/testdisk01' name ff1 rebalance power 5 wait;

Diskgroup altered.

发现missing的磁盘还是存在的

 

SQL> Select
  2   a.NAME,
  3   a.TYPE,
  4   b.DISK_NUMBER,
  5   b.NAME,
  6   b.LABEL,
  7   b.PATH,
  8   b.mount_status,
  9   b.header_status
 10  From v$asm_diskgroup a,
 11       v$asm_disk b
 12  Where a.GROUP_NUMBER = b.GROUP_NUMBER
 13    and a.name='FAILTEST'
 14  Order By a.GROUP_NUMBER,b.DISK_NUMBER;

NAME       TYPE       DISK_NUMBER NAME       LABEL                PATH                     MOUNT_STAT HEADER_STA
---------- ---------- ----------- ---------- -------------------- ------------------------ ---------- ----------
FAILTEST   NORMAL               0 F1                                                       MISSING    UNKNOWN
FAILTEST   NORMAL               1 F2                              /dev/mapper/testdisk02   CACHED     MEMBER
FAILTEST   NORMAL               2 FF1                             /dev/mapper/testdisk01   CACHED     MEMBER

 

7.正常重新mount
SQL> alter diskgroup FAILTEST dismount;

Diskgroup altered.

SQL> alter diskgroup FAILTEST mount;

Diskgroup altered.

 

8.删除missing状态的磁盘
SQL> alter diskgroup FAILTEST drop disk F1 force;

Diskgroup altered.

发现只是改了个名称

 

SQL> Select
  2   a.NAME,
  3   a.TYPE,
  4   b.DISK_NUMBER,
  5   b.NAME,
  6   b.LABEL,
  7   b.PATH,
  8   b.mount_status,
  9   b.header_status
 10  From v$asm_diskgroup a,
 11       v$asm_disk b
 12  Where a.GROUP_NUMBER = b.GROUP_NUMBER
 13    and a.name='FAILTEST'
 14  Order By a.GROUP_NUMBER,b.DISK_NUMBER;

NAME                           TYPE       DISK_NUMBER NAME                           LABEL                PATH                     MOUNT_STAT HEADER_STA
------------------------------ ---------- ----------- ------------------------------ -------------------- ------------------------ ---------- ----------
FAILTEST                       NORMAL               0 _DROPPED_0000_FAILTEST                                                       MISSING    UNKNOWN
FAILTEST                       NORMAL               1 F2                                                  /dev/mapper/testdisk02   CACHED     MEMBER
FAILTEST                       NORMAL               2 FF1                                                 /dev/mapper/testdisk01   CACHED     MEMBER

 

posted @ 2022-04-29 16:03  slnngk  阅读(134)  评论(0编辑  收藏  举报