asm建立刪除磁碟,磁碟組和rebalance操作,asmrebalance
[grid@lzl1 ~]$ sqlplus / as sysasmSQL*Plus: Release 11.2.0.3.0 Production on Fri Oct 20 15:20:44 2017Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Real Application Clusters and Automatic Storage Management optionsSQL>
現有磁碟
SQL> select name,free_mb,total_mb from v$asm_disk;NAME FREE_MB TOTAL_MB------------------------------ ---------- ----------DATA_0002 44245120DATA_0001 44245120DATA_0000 44195120CRS_0002 30895120CRS_0001 30825120CRS_0000 308951206 rows selected.SQL> select group_number,operation,state,power from v$asm_operation;no rows selected
刪除磁碟
SQL> alter diskgroup DATA drop disk DATA_0002 rebalance power 5;Diskgroup altered.SQL> select group_number,operation,state,power from v$asm_operation;GROUP_NUMBER OPERA STAT POWER------------ ----- ---- ---------- 2 REBAL RUN5
進行中rebalance操作
SQL> /no rows selectedSQL> select name,free_mb,total_mb,path,state,mount_status,header_status from v$asm_disk;SQL> col name for a10;SQL> /NAME FREE_MBTOTAL_MB PATHSTATE MOUNT_S HEADER_STATU---------- ---------- ---------- --------------- -------- ------- ------------ 0 0 /dev/asm-diskg NORMAL CLOSED FORMERDATA_0001 4075 5120 /dev/asm-diskf NORMAL CACHED MEMBERDATA_0000 4074 5120 /dev/asm-diske NORMAL CACHED MEMBERCRS_0002 3089 5120 /dev/asm-diskd NORMAL CACHED MEMBERCRS_0001 3082 5120 /dev/asm-diskc NORMAL CACHED MEMBERCRS_0000 3089 5120 /dev/asm-diskb NORMAL CACHED MEMBER6 rows selected.
磁碟已刪除但仍然識別。
在drop之前DATA組的used mb=(5120-4424)+(5120-4424)+(5120-4419)= 2093
在drop之後DATA組的used mb=(5120-4075)+(5120-4074)= 2091
可以看出used mb幾乎是相等的,rebalance把drop盤裡的資料平衡分配到其他盤去了。
建立磁碟組SQL> create diskgroup fra external redundancy disk '/dev/asm-diskg';Diskgroup created.SQL> select name,free_mb,total_mb,path,state,mount_status,header_status from v$asm_disk;NAME FREE_MBTOTAL_MB PATHSTATE MOUNT_S HEADER_STATU---------- ---------- ---------- --------------- -------- ------- ------------FRA_0000 5070 5120 /dev/asm-diskg NORMAL CACHED MEMBERDATA_0001 4075 5120 /dev/asm-diskf NORMAL CACHED MEMBERDATA_0000 4074 5120 /dev/asm-diske NORMAL CACHED MEMBERCRS_0002 3089 5120 /dev/asm-diskd NORMAL CACHED MEMBERCRS_0001 3082 5120 /dev/asm-diskc NORMAL CACHED MEMBERCRS_0000 3089 5120 /dev/asm-diskb NORMAL CACHED MEMBER6 rows selected.
asm通過asm_diskstring識別磁碟
SQL> show parameter stringNAME TYPE VALUE------------------------------------ ----------- ------------------------------asm_diskstring string/dev/asm*
我們新增一個磁碟來添加到FRA磁碟組中
[root@lzl1 Desktop]# ls /dev/asm-*/dev/asm-diskb /dev/asm-diskd /dev/asm-diskf /dev/asm-diskh/dev/asm-diskc /dev/asm-diske /dev/asm-diskg
共用裝置已經配置好,/dev/asm-diskg就是我們新增的
SQL>select name,free_mb,total_mb,path,state,mount_status,header_status from v$asm_disk;NAME FREE_MBTOTAL_MB PATHSTATE MOUNT_S HEADER_STATU---------- ---------- ---------- --------------- -------- ------- ------------ 0 0 /dev/asm-diskh NORMAL CLOSED CANDIDATEFRA_0000 5070 5120 /dev/asm-diskg NORMAL CACHED MEMBERDATA_0001 4075 5120 /dev/asm-diskf NORMAL CACHED MEMBERDATA_0000 4074 5120 /dev/asm-diske NORMAL CACHED MEMBERCRS_0002 3089 5120 /dev/asm-diskd NORMAL CACHED MEMBERCRS_0001 3082 5120 /dev/asm-diskc NORMAL CACHED MEMBERCRS_0000 3089 5120 /dev/asm-diskb NORMAL CACHED MEMBER7 rows selected
已經自動識別了
在查詢下另外一個視圖
SQL> select name,free_mb,total_mb,path,state,mount_status,header_status from v$asm_disk_stat;NAME FREE_MBTOTAL_MB PATHSTATE MOUNT_S HEADER_STATU---------- ---------- ---------- --------------- -------- ------- ------------FRA_0000 5070 5120 /dev/asm-diskg NORMAL CACHED MEMBERDATA_0001 4075 5120 /dev/asm-diskf NORMAL CACHED MEMBERDATA_0000 4074 5120 /dev/asm-diske NORMAL CACHED MEMBERCRS_0002 3089 5120 /dev/asm-diskd NORMAL CACHED MEMBERCRS_0001 3082 5120 /dev/asm-diskc NORMAL CACHED MEMBERCRS_0000 3089 5120 /dev/asm-diskb NORMAL CACHED MEMBER6 rows selected.
v$asm_disk_stat不會展示新增的磁碟
v$asm_disk_stat在官方文檔中的描述
V$ASM_DISK_STAT displays performance statistics in the same way that V$ASM_DISK does, but without performing discovery of new disks. This results in a less expensive operation. However, since discovery is not performed, the output of this view does not include any data about disks that are new to the system.
The columns for V$ASM_DISK_STAT are the same as those for V$ASM_DISK.
著作權聲明:本文為博主原創文章,轉載請註明出處