概述:
本次演示asm的數據盤的增 減,長篇大論不是我的風格,實際操作步驟如下:
1、本地硬盤操作
a、添加硬盤,信息如下
Disk /dev/sdg: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
b、查看磁盤UUID:
[root@bpmdb /]# /sbin/scsi_id id -g -u -d /dev/sdg
36000c29761f55fff56c8745580ee9208
c、綁定設備
for i in g;
do
echo "KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`", NAME="asm-disk$i", OWNER="grid", GROUP="asmadmin", MODE="0660"" >> /etc/udev/rules.d/99-oracle-asmdevices.rules
done
d、查看添加到rules的信息
more etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whit
espace --device=/dev/$name", RESULT=="36000c29d90a9767ced0590cea19d0212", NAME="
asm-diskb", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whit
espace --device=/dev/$name", RESULT=="36000c297d0b74d4db2f985157c61a0d3", NAME="
asm-diskc", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whit
espace --device=/dev/$name", RESULT=="36000c2987b1d655d4d615dff47cafa94", NAME="
asm-diskd", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whit
espace --device=/dev/$name", RESULT=="36000c2952dbab1b62cae71800ba2895b", NAME="
asm-diske", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whit
espace --device=/dev/$name", RESULT=="36000c29ce3b778edb6a99f6153bda834", NAME="
asm-diskf", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whit
espace --device=/dev/$name", RESULT=="36000c29761f55fff56c8745580ee9208", NAME="
asm-diskg", OWNER="grid", GROUP="asmadmin", MODE="0660"
e、重啟udev
[root@bpmdb /]# /sbin/start_udev
Starting udev: [ OK ]
f、確認綁定磁盤
[root@bpmdb /]# ls -l /dev/asm*
brw-rw---- 1 grid asmadmin 8, 16 Jul 31 08:52 /dev/asm-diskb
brw-rw---- 1 grid asmadmin 8, 32 Jul 31 08:52 /dev/asm-diskc
brw-rw---- 1 grid asmadmin 8, 48 Jul 31 08:52 /dev/asm-diskd
brw-rw---- 1 grid asmadmin 8, 64 Jul 31 08:52 /dev/asm-diske
brw-rw---- 1 grid asmadmin 8, 80 Jul 31 08:52 /dev/asm-diskf
brw-rw---- 1 grid asmadmin 8, 96 Jul 31 08:52 /dev/asm-diskg
2、ASM擴展步驟
a、查看asm磁盤組
select GROUP_NUMBER,NAME,TOTAL_MB,FREE_MB from v$asm_diskgroup;
b、添加磁盤asm-diskg到DATA_DG磁盤組
alter diskgroup DATA_DG add disk '/dev/asm-diskg';
c、核對可用空間,和步驟a對比,磁盤組空間增加了1G
select GROUP_NUMBER,NAME,TOTAL_MB,FREE_MB from v$asm_diskgroup;
3、ASM磁盤組中踢掉磁盤
a、查詢出要踢出的磁盤所在的工作組
select GROUP_NUMBER,DISK_NUMBER, MODE_STATUS,HEADER_STATUS, MODE_STATUS,state,TOTAL_MB,FREE_MB,name,PATH from v$asm_disk;
SQL> alter diskgroup DATA_DG drop disk 'DATA_DG_0001';
b、核對磁盤組,確認已經踢出
4、實際操作過程中,有些細節還是需要注意的,以免誤操作,丟失數據,喜歡的給個關注。