----------------------------------------- -------- ----------------------------
GROUP_NUMBER NUMBER
DISK_NUMBER NUMBER
COMPOUND_INDEX NUMBER
INCARNATION NUMBER
MOUNT_STATUS VARCHAR2(7)
HEADER_STATUS VARCHAR2(12)
MODE_STATUS VARCHAR2(7)
STATE VARCHAR2(8)
REDUNDANCY VARCHAR2(64)
OS_MB NUMBER
TOTAL_MB NUMBER
FREE_MB NUMBER
HOT_USED_MB NUMBER
COLD_USED_MB NUMBER
NAME VARCHAR2(30)
FAILGROUP VARCHAR2(30)
LABEL VARCHAR2(31)
PATH VARCHAR2(256)
UDID VARCHAR2(64)
PRODUCT VARCHAR2(32)
CREATE_DATE DATE
MOUNT_DATE DATE
REPAIR_TIMER NUMBER
READS NUMBER
WRITES NUMBER
READ_ERRS NUMBER
WRITE_ERRS NUMBER
READ_TIMEOUT NUMBER
WRITE_TIMEOUT NUMBER
READ_TIME NUMBER
WRITE_TIME NUMBER
BYTES_READ NUMBER
BYTES_WRITTEN NUMBER
PREFERRED_READ VARCHAR2(1)
HASH_VALUE NUMBER
HOT_READS NUMBER
HOT_WRITES NUMBER
HOT_BYTES_READ NUMBER
HOT_BYTES_WRITTEN NUMBER
COLD_READS NUMBER
COLD_WRITES NUMBER
COLD_BYTES_READ NUMBER
COLD_BYTES_WRITTEN NUMBER
VOTING_FILE VARCHAR2(1)
SECTOR_SIZE NUMBER
LOGICAL_SECTOR_SIZE NUMBER
FAILGROUP_TYPE VARCHAR2(7)
CON_ID NUMBER
THIN_PROVISION_CAPABLE VARCHAR2(1)
DATA_INTEGRITY_CAPABLE VARCHAR2(1)
SITE_NAME VARCHAR2(30)
SITE_GUID VARCHAR2(33)
FAILGROUP_LABEL VARCHAR2(30)
SITE_LABEL VARCHAR2(30)
SITE_LABEL VARCHAR2(30)
SITE_STATUS VARCHAR2(11)
SQL> desc v$asm_diskgroup
Name Null? Type
----------------------------------------- -------- ----------------------------
GROUP_NUMBER NUMBER
NAME VARCHAR2(30)
SECTOR_SIZE NUMBER
LOGICAL_SECTOR_SIZE NUMBER
BLOCK_SIZE NUMBER
ALLOCATION_UNIT_SIZE NUMBER
STATE VARCHAR2(11)
TYPE VARCHAR2(6)
TOTAL_MB NUMBER
FREE_MB NUMBER
HOT_USED_MB NUMBER
COLD_USED_MB NUMBER
REQUIRED_MIRROR_FREE_MB NUMBER
USABLE_FILE_MB NUMBER
OFFLINE_DISKS NUMBER
COMPATIBILITY VARCHAR2(60)
DATABASE_COMPATIBILITY VARCHAR2(60)
VOTING_FILES VARCHAR2(1)
CON_ID NUMBER
#########
col PATH format a20;
set linesize 1000;
select GROUP_NUMBER,DISK_NUMBER,NAME,PATH,HEADER_STATUS,MOUNT_STATUS,FAILGROUP,VOTING_FILE,FAILGROUP_TYPE,STATE from v$asm_disk order by 1,2;
alter diskgroup data add failgroup dg01 disk '/nfs/rhvot01';
alter diskgroup data drop disks in failgroup G01;
alter diskgroup data drop disk 'DATA_0001';
################
select GROUP_NUMBER,STATE,name,v$asm_diskgroup;
#磁盘属性:
disk_repair_time
failgroup_repair_time
setattr -G data disk_repair_time=0.5h
#
Version 19.3.0.0.0
2 0 _DROPPED_0000_DATA UNKNOWN MISSING G01 N REGULAR FORCING <<<---当向故障磁盘组中加入磁盘,该状态自动消失。/或者重启asm 自动小时。
2 1 DATA_0001 /nfs/rhvot02 MEMBER CACHED DG01 N REGULAR NORMAL
2 2 DATA_0002 /nfs/rhvot03 MEMBER CACHED DG02 N REGULAR NORMAL
2 3 DATA_0003 /nfs/rhvot04 MEMBER CACHED DG02 N REGULAR NORMAL
2 4 DATA_0004 /nfs/rhvot01 MEMBER CACHED DG01 N REGULAR NORMAL
8 rows selected.
alter diskgroup data add failgroup g01 disk '/nfs/rhvot02' force;
GROUP_NUMBER DISK_NUMBER NAME PATH HEADER_STATU MOUNT_S FAILGROUP V FAILGRO STATE
------------ ----------- ------------------------------ -------------------- ------------ ------- ------------------------------ - ------- --------
1 0 SYS_0000 /dev/sdb MEMBER CACHED G01 Y QUORUM NORMAL
1 1 SYS_0001 /dev/sdc MEMBER CACHED G02 Y REGULAR NORMAL
1 2 SYS_0002 /dev/sdd MEMBER CACHED G03 Y REGULAR NORMAL
2 1 DATA_0001 /nfs/rhvot02 MEMBER CACHED G01 N REGULAR NORMAL
2 2 DATA_0002 /nfs/rhvot03 MEMBER CACHED DG02 N REGULAR NORMAL
2 3 DATA_0003 /nfs/rhvot04 MEMBER CACHED DG02 N REGULAR NORMAL
2 4 DATA_0004 /nfs/rhvot01 MEMBER CACHED DG01 N REGULAR NORMAL
7 rows selected.
alter diskgroup data add failgroup dg01 disk '/nfs/rhvot02' force;
#指定QUORUM FAILGROUP
alter diskgroup sys add QUORUM failgroup vot002 disk '/dev/sdb' force;
#删除:
alter diskgroup sys drop QUORUM disk 'SYS_0000' force;@force 可选的
GROUP_NUMBER DISK_NUMBER NAME PATH HEADER_STATU MOUNT_S FAILGROUP V FAILGRO STATE
------------ ----------- ------------------------------ -------------------- ------------ ------- ------------------------------ - ------- --------
0 0 /nfs/rhvot03 FORMER CLOSED N REGULAR NORMAL
0 1 /nfs/rhvot01 CANDIDATE CLOSED N REGULAR NORMAL
0 2 /nfs/rhvot02 FORMER CLOSED N REGULAR NORMAL
0 3 /nfs/rhvot04 FORMER CLOSED N REGULAR NORMAL
1 0 SYS_0000 /dev/sdb MEMBER CACHED VOT001 Y QUORUM NORMAL
1 1 SYS_0001 /dev/sdc MEMBER CACHED G02 Y REGULAR NORMAL
1 2 SYS_0002 /dev/sdd MEMBER CACHED G03 Y REGULAR NORMAL
#删除:
alter diskgroup sys drop QUORUM disk 'SYS_0000' force;@force 可选的
GROUP_NUMBER DISK_NUMBER NAME PATH HEADER_STATU MOUNT_S FAILGROUP V FAILGRO STATE
------------ ----------- ------------------------------ -------------------- ------------ ------- ------------------------------ - ------- --------
0 0 /nfs/rhvot03 FORMER CLOSED N REGULAR NORMAL
0 1 /nfs/rhvot01 CANDIDATE CLOSED N REGULAR NORMAL
0 2 /nfs/rhvot02 FORMER CLOSED N REGULAR NORMAL
0 3 /dev/sdb MEMBER CLOSED Y REGULAR NORMAL
0 4 /nfs/rhvot04 FORMER CLOSED N REGULAR NORMAL
1 0 _DROPPED_0000_SYS UNKNOWN MISSING VOT001 N QUORUM FORCING
1 1 SYS_0001 /dev/sdc MEMBER CACHED G02 Y REGULAR NORMAL
1 2 SYS_0002 /dev/sdd MEMBER CACHED G03 Y REGULAR NORMAL
8 rows selected.
[root@ora03 ~]# crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 4b0621fe36814ff3bf126178504a8188 (/dev/sdc) [SYS]
2. ONLINE b82f27d06c614f44bf4fcc38212e6f23 (/dev/sdd) [SYS]
alter diskgroup data drop disk 'data_0002' force; @force 可选的
SQL> alter diskgroup data drop disk 'data_0001' ;
alter diskgroup data drop disk 'data_0001'
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-59327: Dropping more fail groups is not allowed with disk group redundancy.
SQL> alter diskgroup data drop disk 'data_0002' force;
alter diskgroup data drop disk 'data_0002' force
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-59328: Offlining more failure groups is not allowed with disk group redundancy.
alter diskgroup data add disk '/nfs/rhvot03' force;
##################
crsctl start crs -excl -nocrs
#
alter diskgroup sys drop QUORUM disk 'SYS_0000' force ;
alter diskgroup ocr add QUORUM failgroup vot003 disk '/dev/sdb';
alter diskgroup SYS add failgroup VOT002 disk '/nfs/rhvot03';
alter diskgroup SYS add QUORUM failgroup VOT002 disk '/nfs/rhvot01';
ALTER DISKGROUP SYS ADD QUORUM FAILGROUP VOT003 DISK '/nfs/rhvot01';
alter diskgroup ocr drop QUORUM disk 'OCR_0004' force;
alter diskgroup ocr add QUORUM disk '/nfs/rhvot01';
alter diskgroup ocr drop QUORUM disk 'OCR_0000' force ;
alter diskgroup ocr add QUORUM disk '/nfs/rhvot01';
--------DISK_REPAIR_TIME
Oracle ASM快速镜像重新同步
要使用此功能,磁盘组兼容性属性必须设置为11.1或更高
此属性指定在启动放置操作之前修复磁盘并使其恢复联机的时间间隔。此属性只能在更改磁盘组时设置,并且仅适用于普通和高冗余磁盘组
此属性指定磁盘组中故障组的默认修复时间。如果Oracle ASM确定整个故障组已失败,则使用故障组修复时间。默认值为24小时( 24h )
col name format a30
select name,value from v$asm_attribute where group_number=1 and name like '%repair_time%';
alter diskgroup vot set attribute 'disk_repair_time'='5m';
alter diskgroup vot set attribute 'failgroup_repair_time'='5m';
ALTER DISKGROUP ocr OFFLINE DISK '1:bin:/bin:/sbin/nologin' DROP AFTER 5m;
ALTER DISKGROUP ocr OFFLINE QUORUM DISK OCR_0000 DROP AFTER 5m;
###########故障模拟!
1,dd 磁盘
2,add QUORUM
alter diskgroup ocr add QUORUM disk '/nfs/rhvot04';
---> 损害磁盘状态为:HEADER_STATU :CANDIDATE
3,删除missing 磁盘? <-----步骤错误,正确步骤:应该offline故障磁盘,asm会自动删除。
alter diskgroup ocr drop QUORUM disk 'OCR_0003';<======磁盘不能删除状态一直为DROPPING。
GROUP_NUMBER DISK_NUMBER NAME PATH HEADER_STATU FAILGROUP V FAILGRO STATE MOUNT_S MODE_ST REPAIR_TIMER
------------ ----------- ------------------------------ -------------------- ------------ ------------------------------ - ------- -------- -------
1 0 OCR_0000 /nfs/rhvot04 MEMBER OCR_0000 Y QUORUM NORMAL CACHED ONLINE 0
1 1 OCR_0001 /nfs/rhvot02 MEMBER OCR_0001 Y REGULAR NORMAL CACHED ONLINE 0
1 2 OCR_0002 /nfs/rhvot03 MEMBER OCR_0002 Y REGULAR NORMAL CACHED ONLINE 0
1 3 OCR_0003 /nfs/rhvot01 CANDIDATE OCR_0003 Y QUORUM DROPPING CACHED ONLINE 0
或者使用命令:
alter diskgroup vot drop QUORUM disk 'VOT_0003';
force;
alter diskgroup vot offline QUORUM disk 'VOT_0000';
alter diskgroup vot add QUORUM disk '/nfs/rhvot04';
###############
SQL> @c
GROUP_NUMBER DISK_NUMBER NAME PATH HEADER_STATU FAILGROUP V FAILGRO STATE MOUNT_S MODE_ST REPAIR_TIMER
------------ ----------- ------------------------------ -------------------- ------------ ------------------------------ - ------- -------- ------- ------- ------------
1 0 OCR_0000 /nfs/rhvot04 MEMBER OCR_0000 Y QUORUM NORMAL CACHED ONLINE 0
1 1 OCR_0001 /nfs/rhvot02 MEMBER OCR_0001 Y REGULAR NORMAL CACHED ONLINE 0
1 2 OCR_0002 /nfs/rhvot03 MEMBER OCR_0002 Y REGULAR NORMAL CACHED ONLINE 0
1 3 OCR_0003 UNKNOWN OCR_0003 N QUORUM DROPPING MISSING OFFLINE 0
SQL>
SQL> alter diskgroup ocr drop QUORUM disk 'OCR_0003' force;
Diskgroup altered.
SQL> @c
GROUP_NUMBER DISK_NUMBER NAME PATH HEADER_STATU FAILGROUP V FAILGRO STATE MOUNT_S MODE_ST REPAIR_TIMER
------------ ----------- ------------------------------ -------------------- ------------ ------------------------------ - ------- -------- ------- ------- ------------
1 0 OCR_0000 /nfs/rhvot04 MEMBER OCR_0000 Y QUORUM NORMAL CACHED ONLINE 0
1 1 OCR_0001 /nfs/rhvot02 MEMBER OCR_0001 Y REGULAR NORMAL CACHED ONLINE 0
1 2 OCR_0002 /nfs/rhvot03 MEMBER OCR_0002 Y REGULAR NORMAL CACHED ONLINE 0
SQL>