此次要删除arch磁盘组,需要先修改归档位置:
alter system set log_archive_dest_1=‘location=+data/Elandg/archive‘ scope=both sid=‘*‘;
查看asm磁盘包含关系:
SQL> select name,path from v$asm_disk; NAME PATH ------------------------------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- OCR_0002 /dev/sdk OCR_0001 /dev/sdj OCR_0000 /dev/sdi ARCH_0000 /dev/sdh DATA_0000 /dev/sdg
查看asm磁盘组状态:
SQL> select name,state,total_mb,free_mb from v$asm_diskgroup; NAME STATE TOTAL_MB FREE_MB ------------------------------------------------------------ ---------------------- ---------- ---------- ARCH MOUNTED 48800 47174 DATA MOUNTED 48800 40437 OCR MOUNTED 5760 4720
强制卸载asm磁盘组(两个节点都做):
删除磁盘组: SQL> DROP DISKGROUP ARCH FORCE INCLUDING CONTENTS; Diskgroup dropped. SQL> select name,state,total_mb,free_mb from v$asm_diskgroup; NAME STATE TOTAL_MB FREE_MB ---------------------- ---------- ---------- DATA MOUNTED 48800 40458 OCR MOUNTED 5760 4720
添加磁盘组,并修改扇区大小:(如无扇区大小需求,可默认):
============================================ oracle示例: CREATE DISKGROUP data NORMAL REDUNDANCY FAILGROUP controller1 DISK ‘/devices/diska1‘ NAME diska1, ‘/devices/diska2‘ NAME diska2, ‘/devices/diska3‘ NAME diska3, ‘/devices/diska4‘ NAME diska4 FAILGROUP controller2 DISK ‘/devices/diskb1‘ NAME diskb1, ‘/devices/diskb2‘ NAME diskb2, ‘/devices/diskb3‘ NAME diskb3, ‘/devices/diskb4‘ NAME diskb4 ATTRIBUTE ‘au_size‘=‘4M‘, ‘compatible.asm‘ = ‘11.2‘, ‘compatible.rdbms‘ = ‘11.2‘, ‘compatible.advm‘ = ‘11.2‘; ==========================================
oracle示例:
CREATE DISKGROUP mgmt_dg NORMAL REDUNDANCY
FAILGROUP fg1 DISK ‘/devices/diskg1‘ FAILGROUP fg2 DISK ‘/devices/diskg2‘ QUORUM FAILGROUP fg3 DISK ‘/devices/diskg3‘ ATTRIBUTE ‘compatible.asm‘ = ‘12.2.0.0.0‘; ============================================= 本环境使用: CREATE DISKGROUP arch EXTENDED REDUNDANCY DISK ‘/dev/sdh‘ ATTRIBUTE ‘compatible.asm‘ = ‘11.2‘, ‘compatible.rdbms‘ = ‘11.2‘, ‘sector_size‘=‘4096‘;
SQL> CREATE DISKGROUP arch external REDUNDANCY DISK ‘/dev/sdh‘ ATTRIBUTE ‘compatible.asm‘ = ‘11.2‘, ‘compatible.rdbms‘ = ‘11.2‘, ‘sector_size‘=‘4096‘; Diskgroup created. SQL> select name,state,total_mb,free_mb from v$asm_diskgroup; NAME ------------------------------------------------------------ STATE TOTAL_MB FREE_MB ---------------------- ---------- ---------- ARCH MOUNTED 48800 48748 DATA MOUNTED 48800 40458 OCR MOUNTED 5760 4720 第二个节点需要将arch磁盘组mount一下: SQL> select name,state,total_mb,free_mb from v$asm_diskgroup; NAME STATE TOTAL_MB FREE_MB ---------------------- ---------- ---------- ARCH DISMOUNTED 0 0 DATA MOUNTED 48800 40458 OCR MOUNTED 5760 4720 SQL> SQL> alter diskgroup ARCH mount; Diskgroup altered. SQL> select name,state,total_mb,free_mb from v$asm_diskgroup; NAME STATE TOTAL_MB FREE_MB --------------------- ---------- ---------- ARCH MOUNTED 48800 48705 DATA MOUNTED 48800 40458 OCR MOUNTED 5760 4720
添加完成后查询:
SQL> SELECT SUBSTR(dg.name,1,16) AS diskgroup, SUBSTR(d.name,1,16) AS asmdisk, d.mount_status, d.state, SUBSTR(d.failgroup,1,16) AS failgroup FROM V$ASM_DISKGROUP dg, V$ASM_DISK d WHERE dg.group_number = d.group_number; DISKGROUP ASMDISK MOUNT_S STATE FAILGROUP -------------------------------- -------------------------------- ------- -------- -------------------------------- OCR OCR_0002 CACHED NORMAL OCR_0002 OCR OCR_0001 CACHED NORMAL OCR_0001 OCR OCR_0000 CACHED NORMAL OCR_0000 ARCH ARCH_0000 CACHED NORMAL ARCH_0000 DATA DATA_0000 CACHED NORMAL DATA_0000