[oracle] ASM磁盘扩容

网友投稿 858 2022-05-28

1.1 记录存储的WWN号及磁盘信息

1.1.1 记录已有磁盘信息

root@pols1:/sys/class/scsi_host# fdisk -l|grep /dev/

WARNING: fdisk GPT support is currently new, and therefore in an experimental phase.

Disk /dev/sda: 1798.7 GB, 1798651772928 bytes, 3512991744 sectors

Disk /dev/mapper/rhel-root: 42.9 GB, 42949672960 bytes, 83886080 sectors

Disk /dev/mapper/rhel-swap: 34.4 GB, 34359738368 bytes, 67108864 sectors

Disk /dev/mapper/mpathh: 536.9 GB, 536870912000 bytes, 1048576000 sectors

Disk /dev/mapper/mpatha: 2147 MB, 2147483648 bytes, 4194304 sectors

[oracle] ASM磁盘扩容

--此处省略--

Disk /dev/sdaw: 214.7 GB, 214748364800 bytes, 419430400 sectors

1.1.2 记录多路径信息

root@pddhuifu1:/root# multipath -ll

mpathe (xxxx) dm-9 EMC     ,Invista

size=500G features='1 queue_if_no_path' hwhandler='0' wp=rw

`-+- policy='service-time 0' prio=1 status=active

|- 15:0:1:3  sds  65:32  active ready running

|- 16:0:0:3  sdv  65:80  active ready running

|- 16:0:1:3  sdj  8:144  active ready running

`- 15:0:0:3  sdg  8:96   active ready running

--此处省略--

root@pddhuifu1:/root# multipath -ll|grep dm-

mpathe (xxxx) dm-9 EMC     ,Invista

--此处省略--

查看udev文件,新加规则

--此处省略--

KERNEL=="dm*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block",  PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",  RESULT=="xxxx", RUN+="/bin/sh -c 'mknod /dev/asm-data09 b  $major $minor; chown grid:asmadmin /dev/asm-data09; chmod 0660 /dev/asm-data09'"

root@pddhuifu1:/dev# ls -l asm*

--此处省略--

brw-rw---- 1 grid asmadmin 253,  9 Jan 14 08:48 asm-data09

1.1.3记录当前wwn号,

1.2 分配磁盘

1.2.1 存储分配磁盘

1.2.2 系统动态扫盘

echo "- - -" >  /sys/class/scsi_host/hostx/scan

然后再运行fdisk -l 就能发现新添加的硬盘已经被系统识别了,查看系统日志/var/log/messages,发现对SCSI设备进行了一次重新扫描。

需要注意的是echo的三个- – -号之间有空隔。

扫描磁盘,使操作系统能够识别到新增的存储

/sys/class/scsi_host/ 下面有几个host 就扫描几次

cd /sys/class/scsi_host/

echo "- - -">host0/scan

echo "- - -">host1/scan

echo "- - -">host2/scan

echo "- - -">host3/scan

echo "- - -">host4/scan

echo "- - -">host5/scan

echo "- - -">host6/scan

echo "- - -">host7/scan

echo "- - -">host8/scan

echo "- - -">host9/scan

echo "- - -">host10/scan

echo "- - -">host11/scan

echo "- - -">host12/scan

echo "- - -">host13/scan

echo "- - -">host14/scan

echo "- - -">host15/scan

echo "- - -">host16/scan

发现新扩容的存储

1.3 识别多路径

multipath –ll

mpathm (xxxx) dm-17 EMC     ,Invista

size=100G features='1 queue_if_no_path' hwhandler='0' wp=rw

`-+- policy='service-time 0' prio=1 status=active

|- 16:0:0:12 sday 67:32  active ready running

|- 15:0:1:12 sdax 67:16  active ready running

|- 15:0:0:12 sdaz 67:48  active ready running

`- 16:0:1:12 sdba 67:64  active ready running

1.5 配置udev

省略

KERNEL=="dm*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block",  PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",  RESULT=="xxxx", RUN+="/bin/sh -c 'mknod /dev/asm-data10 b  $major $minor; chown grid:asmadmin /dev/asm-data10; chmod 0660 /dev/asm-data10'"

/usr/lib/udev/scsi_id -g -u -d /dev/ dm-17

实际操作命令如下(本部分为实际生产操作):

cd /sys/class/fc_host/

echo "1" > /sys/class/fc_host/host15/issue_lip

echo "1" > /sys/class/fc_host/host16/issue_lip

/sbin/udevadm control –reload

/usr/lib/udev/scsi_id -g -u -d /dev/sdbj

/usr/lib/udev/scsi_id -g -u -d /dev/sdbm

/usr/lib/udev/scsi_id -g -u -d /dev/sdbn

/usr/lib/udev/scsi_id -g -u -d /dev/sdbp

/usr/lib/udev/scsi_id -g -u -d /dev/sdbt

/usr/lib/udev/scsi_id -g -u -d /dev/sdbx

/usr/lib/udev/scsi_id -g -u -d /dev/sdcc

/usr/lib/udev/scsi_id -g -u -d /dev/sdcg

echo "1" > /sys/class/fc_host/host15/issue_lip

echo "1" > /sys/class/fc_host/host16/issue_lip

/sbin/udevadm control –reload

cd /dev

ls -lrt asm*

exit

vi /etc/udev/rules.d/99-oracle-asmdevices.rules

cd /dev

/sbin/udevadm trigger --type=devices --action=change

ls -lrt asm*

1.6 图形化形式添加asm磁盘

测试使用命令行添加

查看磁盘

set lin 200

col path for a50

select name,path,state,mount_status,header_status from v$asm_disk;

添加磁盘

--alter diskgroup DATADG add disk '/dev/asm-data10' rebalance power 8;

alter diskgroup DATADG add disk '/dev/asm-data10';

备库:power先用默认的。

查看状态

select name,path,state,mount_status,header_status from v$asm_disk;

select * from v$asm_operation;

默认REBALANCE需要10分钟。

清除磁盘

alter diskgroup DATADG drop disk 'DATADG_0008' rebalance power 8;

Oracle 数据库

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:11.1 磁盘配额是什么
下一篇:Linux 磁盘管理
相关文章