问题背景:
业务需求涉及到asm磁盘加盘踢盘比较频繁,记录一次较为全面的问题处理。
处理方案:
正常流程
查看磁盘状态,
select HEADER_STATUS,GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,Name name2,OS_MB,PATH from v$asm_disk;
相关资料:
MEMBER 属于当前diskgroup的disk
FORMER 这个disk以前属于一个diskgroup,现在这个diskgroup被删除了
CANDIDATE 当使用裸设备,一个新的可以被diskgroup所用的disk
PROVISIONED 当使用asmlib,一个新的可以被diskgroup所用的disk
新添加磁盘要注意状态,如果former添加失败,则可能是之前盘内数据未清空。需要操作类似命令,例如
dd if=/dev/zero of=/dev/mapper/asm5 bs=1024 count=2000
添加磁盘,确定好磁盘组名,可一次添加多个裸设备
alter diskgroup DATA add disk '/dev/rhdisk103','/dev/rhdisk104';
平衡磁盘数据,确定好磁盘组名
alter diskgroup DATA REBALANCE POWER 10;
查看平衡数据所需时间和情况
set lines 300 pages 1000
col ERROR_CODE for a10
select * from v$asm_operation;
踢盘命令
ALTER DISKGROUP DATA DROP DISK DATA_0077;
或
alter diskgroup data drop
disk '/dev/rhdisk103';
查看踢盘状态
select MOUNT_STATUS,HEADER_STATUS,STATE,REDUNDANCY,NAME,PATH from v$asm_disk_stat;
实操记录:
应要求进行踢盘,先查看状态
SQL> select HEADER_STATUS,GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,Name name2,OS_MB,PATH from v$asm_disk;HEADER_STATUS GROUP_NUMBER DISK_NUMBER MOUNT_STATUS NAME2 OS_MB PATH
------------------------ ------------ ----------- -------------- ------------------------------------------------------------ ---------- ------------------------------
MEMBER 1 81 CACHED DATA_0081 2097152 /dev/rhdisk13
MEMBER 1 64 CACHED DATA_0064 2097152 /dev/rhdisk100
MEMBER 1 75 CACHED DATA_0075 2097152 /dev/rhdisk101
MEMBER 1 76 CACHED DATA_0076 2097152 /dev/rhdisk102
MEMBER 1 77 CACHED DATA_0077 2097152 /dev/rhdisk103
尝试剔除77
SQL> ALTER DISKGROUP DATA DROP DISK DATA_0077;
Diskgroup altered.
查看状态,发现状态未发生改变
SQL> select HEADER_STATUS,GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,Name name2,OS_MB,PATH from v$asm_disk;
HEADER_STATUS GROUP_NUMBER DISK_NUMBER MOUNT_STATUS NAME2 OS_MB PATH
------------------------ ------------ ----------- -------------- ------------------------------------------------------------ ---------- ------------------------------
MEMBER 1 81 CACHED DATA_0081 2097152 /dev/rhdisk13
MEMBER 1 64 CACHED DATA_0064 2097152 /dev/rhdisk100
MEMBER 1 75 CACHED DATA_0075 2097152 /dev/rhdisk101
MEMBER 1 76 CACHED DATA_0076 2097152 /dev/rhdisk102
MEMBER 1 77 CACHED DATA_0077 2097152 /dev/rhdisk103
进行平衡数据
SQL> alter diskgroup DATA REBALANCE POWER 10;Diskgroup altered.
查看平衡状态
SQL> set lines 300 pages 1000
SQL> col ERROR_CODE for a10
SQL> select * from v$asm_operation;
GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE
------------ ---------- -------- ---------- ---------- ---------- ---------- ---------- ----------- ----------
1 REBAL WAIT 10 10 0 0 0 0
asm磁盘正常
尝试再次剔除,报错
尝试切换方案进行剔除,报错
SQL> ALTER DISKGROUP DATA DROP DISK DATA_0077;ALTER DISKGROUP DATA DROP DISK DATA_0077
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15071: ASM disk "DATA_0077" is already being dropped
SQL> alter diskgroup data drop 2 disk '/dev/rhdisk103';
alter diskgroup data drop
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15054: disk "/DEV/RHDISK103" does not exist in diskgroup "DATA"
尝试进行添加,再次剔除报错
SQL> alter diskgroup DATA add disk '/dev/rhdisk103';alter diskgroup DATA add disk '/dev/rhdisk103'
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15029: disk '/dev/rhdisk103' is already mounted by this instance
请教大佬后,查看的语句
SQL> select MOUNT_STATUS,HEADER_STATUS,STATE,REDUNDANCY,NAME,PATH from v$asm_disk_stat;
MOUNT_STATUS HEADER_STATUS STATE REDUNDANCY NAME PATH
-------------- ------------------------ ---------------- -------------- ------------------------------------------------------------ ------------------------------
CACHED MEMBER NORMAL UNKNOWN DATA_0081 /dev/rhdisk13
CACHED MEMBER NORMAL UNKNOWN DATA_0064 /dev/rhdisk100
CACHED MEMBER NORMAL UNKNOWN DATA_0075 /dev/rhdisk101
CACHED MEMBER NORMAL UNKNOWN DATA_0076 /dev/rhdisk102
CACHED MEMBER DROPPING UNKNOWN DATA_0077 /dev/rhdisk103
104 rows selected.
发现有中间状态,dropping,查看后power参数较小,所以导致较慢
SQL> show parameter power
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
asm_power_limit integer 1
标签:STATUS,CACHED,磁盘操作,dev,MEMBER,加盘,disk,DATA,asm
From: https://blog.51cto.com/u_16082244/6331074