概述:
本次演示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、实际操作过程中,有些细节还是需要注意的,以免误操作,丢失数据,喜欢的给个关注。