-
# 查看当前配置(oracle、grid 都可以)
-
-
sqlplus / as sysdba
-
col path for a40
-
set lin 120 pages 100
-
select group_number,path,total_mb,free_mb from v$asm_disk order by 1,2;
select GROUP_NUMBER,name from v$asm_diskgroup order by 1;
-
# 查看asm磁盘组使用率
-
-
col name for a15
-
select GROUP_NUMBER,name,trunc((total_mb-free_mb)/1024) used_g,trunc(total_mb/1024) total_g, trunc(free_mb/1024) free_g,round((total_mb-free_mb)/total_mb*100,2) used_percent from v$asm_diskgroup order by used_percent desc ;
-
-
-
# 先备份
-
-
cp /etc/udev/rules.d/99-oracle-asmdevices.rules /tmp/99-oracle-asmdevices.rules_$(date "+%Y%m%d%H%M%S")
-
-
# 取出还没授权的新盘,编辑好直接插入规则文件
-
-
for i in `cat /proc/partitions | awk {'print $4'} |grep emcpower`; do val=`/sbin/blockdev --getsize64 /dev/$i` ; val2=`expr $val / 1073741824`; echo "/dev/$i: $val2 `/usr/lib/udev/scsi_id -gud /dev/$i`" ; done
-
-
# 将描述信息存放到临时文件
-
-
ls -l /dev/emcpower*
-
-
rm -fr /tmp/a.rules
-
for i in ` grep emcpower /proc/partitions|awk {'print $4'} ` ;
-
do
-
echo "KERNEL==\"emcpower*\",SUBSYSTEM==\"block\", PROGRAM==\"/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/usr/lib/udev/scsi_id -gud /dev/$i`\", SYMLINK+=\"asmdisk/ARCH05\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\" " >> /tmp/a.rules ;
-
done
-
cat /tmp/a.rules
-
-
# 手工检查修改一下设备名称,将ARCH05改为实际需要的
-
-
vi /etc/udev/rules.d/99-oracle-asmdevices.rules
-
-
生效
-
-
/sbin/udevadm control --reload-rules
-
/sbin/udevadm trigger --type=devices --action=change
-
-
ls -l /dev/asmdisk/* 确认是否有新的asm磁盘,且属主正确
-
-
如果没问题直接复制到节点2
-
-
scp /etc/udev/rules.d/99-oracle-asmdevices.rules node2:/etc/udev/rules.d/99-oracle-asmdevices.rules
-
执行上面两个 udevadm 命令,然后ls 看是否和主机1一样
-
-
添加到磁盘组(grid用户)
-
asmcmd lsdsk --candidate -p
图形方式
asmca
sqlplus / as sysdba
alter diskgroup datadg rebalance power 11;
手工方式
-
sqlplus / as sysdba
-
alter diskgroup ARCHDG add disk '/dev/asmdisk/ARCH05','dev/asmdisk/ARCH06','dev/asmdisk/ARCH07' rebalance power 11;
-
-
查进度
-
-
col error_code for a50
-
set lin 300 pages 100
-
select group_number,operation,state,power,actual,sofar,est_work,est_minutes,error_code,round(sofar/ est_work*100,1) per from v$asm_operation;
-