暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

ASM扩存储

原创 jichao.liu 2022-02-24
985

在自己的虚机上扩存储

image.png

在二节点上添加现有盘
image.png

看一下磁盘

[root@oadb1 ~]#  fdisk -l

Disk /dev/sda: 85.9 GB, 85899345920 bytes, 167772160 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000c390e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    20973567    10485760   82  Linux swap / Solaris
/dev/sda2   *    20973568   167772159    73399296   83  Linux

Disk /dev/sdb: 4294 MB, 4294967296 bytes, 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdc: 8589 MB, 8589934592 bytes, 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdd: 32.2 GB, 32212254720 bytes, 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sde: 17.2 GB, 17179869184 bytes, 33554432 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x7c72135a

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1            2048    33554431    16776192   83  Linux

Disk /dev/sdf: 64.4 GB, 64424509440 bytes, 125829120 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdg: 64.4 GB, 64424509440 bytes, 125829120 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sdh: 8589 MB, 8589934592 bytes, 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

查询磁盘设备的wwid

[root@oadb1 ~]#  for i in `cat /proc/partitions | awk '{print $4}' |grep sd | grep [a-z]$`; do echo "### $i: ` /usr/lib/udev/scsi_id -g -u -d /dev/$i`"; done 
### sda: 1ATA_VBOX_HARDDISK_VB7ce26990-aa750cf0
### sdb: 1ATA_VBOX_HARDDISK_VBde3c019d-caf00bc0
### sdc: 1ATA_VBOX_HARDDISK_VBe667f96f-368aa1fe
### sdd: 1ATA_VBOX_HARDDISK_VBc912d45c-82262fda
### sde: 1ATA_VBOX_HARDDISK_VB12600c52-a729d559
### sdf: 1ATA_VBOX_HARDDISK_VBf73a44b9-b943e567
### sdg: 1ATA_VBOX_HARDDISK_VB393edf3e-84df2725
### sdh: 1ATA_VBOX_HARDDISK_VB63ddc84c-5962130e
[root@oadb1 ~]# 

检查一下raw

[root@oadb1 ~]# ll /dev/raw
total 0
brw-rw---- 1 grid asmadmin   8, 16 Feb 21 11:05 raw1
brw-rw---- 1 grid asmadmin   8, 32 Feb 21 11:05 raw2
brw-rw---- 1 grid asmadmin   8, 48 Feb 21 11:05 raw3
brw-rw---- 1 grid asmadmin   8, 80 Feb 21 12:08 raw4
brw-rw---- 1 grid asmadmin   8, 96 Feb 21 12:08 raw5
crw-rw---- 1 root disk     162,  0 Feb 21 11:05 rawctl

1节点和2节点都需要添加

 [root@oadb1 ~]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="1ATA_VBOX_HARDDISK_VBde3c019d-caf00bc0", RUN+="/bin/sh -c 'mknod /dev/raw/raw1 b $major $minor; chown grid:asmadmin /dev/raw/raw1; chmod 0660 /dev/raw/raw1'"
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="1ATA_VBOX_HARDDISK_VBe667f96f-368aa1fe", RUN+="/bin/sh -c 'mknod /dev/raw/raw2 b $major $minor; chown grid:asmadmin /dev/raw/raw2; chmod 0660 /dev/raw/raw2'"
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="1ATA_VBOX_HARDDISK_VBc912d45c-82262fda", RUN+="/bin/sh -c 'mknod /dev/raw/raw3 b $major $minor; chown grid:asmadmin /dev/raw/raw3; chmod 0660 /dev/raw/raw3'"
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="1ATA_VBOX_HARDDISK_VBf73a44b9-b943e567", RUN+="/bin/sh -c 'mknod /dev/raw/raw4 b $major $minor; chown grid:asmadmin /dev/raw/raw4; chmod 0660 /dev/raw/raw4'"
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="1ATA_VBOX_HARDDISK_VB393edf3e-84df2725", RUN+="/bin/sh -c 'mknod /dev/raw/raw5 b $major $minor; chown grid:asmadmin /dev/raw/raw5; chmod 0660 /dev/raw/raw5'"
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="1ATA_VBOX_HARDDISK_VB63ddc84c-5962130e", RUN+="/bin/sh -c 'mknod /dev/raw/raw6 b $major $minor; chown grid:asmadmin /dev/raw/raw6; chmod 0660 /dev/raw/raw6'"

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


检查一下raw

[root@oadb1 ~]# ll /dev/raw
total 0
brw-rw---- 1 grid asmadmin   8,  16 Feb 21 11:05 raw1
brw-rw---- 1 grid asmadmin   8,  32 Feb 21 11:05 raw2
brw-rw---- 1 grid asmadmin   8,  48 Feb 21 11:05 raw3
brw-rw---- 1 grid asmadmin   8,  80 Feb 21 12:08 raw4
brw-rw---- 1 grid asmadmin   8,  96 Feb 21 12:08 raw5
brw-rw---- 1 grid asmadmin   8, 112 Feb 21 12:08 raw6
crw-rw---- 1 root disk     162,   0 Feb 21 12:08 rawctl
[root@oadb1 ~]# 

检查一下COMPATIBILITY,DATABASE_COMPATIBILITY参数


SQL>  select NAME,COMPATIBILITY,DATABASE_COMPATIBILITY from v$asm_diskgroup;

NAME                           COMPATIBILITY                                                DATABASE_COMPATIBILITY
------------------------------ ------------------------------------------------------------ ------------------------------------------------------------
ARCHDG                         19.0.0.0.0                                                   10.1.0.0.0
CRSDG                          19.0.0.0.0                                                   10.1.0.0.0
DATADG2                        19.0.0.0.0                                                   10.1.0.0.0
DATADG3                        19.0.0.0.0                                                   10.1.0.0.0
DATADG                         19.0.0.0.0                                                   10.1.0.0.0

SQL> 

新建磁盘组的方法:

一节点grid用户登录:

sqlplus / as sysasm
create diskgroup bakdg external redundancy disk 
'/dev/raw/raw6'
attribute 'compatible.asm' ='19.0.0.0.0','

二节点


SQL*Plus: Release 19.0.0.0.0 - Production on Mon Feb 21 13:54:26 2022
Version 19.9.0.0.0

Copyright (c) 1982, 2020, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.9.0.0.0

SQL>  alter diskgroup  BAKDG mount;

Diskgroup altered.

SQL> 



在原有的磁盘组上扩

在一节点上

su - grid
sqlplus / as sysasm
alter diskgroup ARCHDG add disk 
'/dev/asm-disk33',
'/dev/asm-disk34',
'/dev/asm-disk35',
'/dev/asm-disk36',
'/dev/asm-disk37',
'/dev/asm-disk38'
 rebalance power 6;

==rebalanced进度检查=

SQL> set linesize 160
SQL> select * from gv$asm_operation;

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
3人已赞赏
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论