ASM下添加磁盘

 

linux下asm磁盘扩容,此次扩容添加4块480G磁盘

第一步:multipath -ll : 查看多路径映射磁盘(两节点都做)

配置 /etc/multipath.conf文件,配置新加磁盘的alias 的wwid    (两节点都做)

第二步:停库 (最好停库,有时候start_udev容易发生磁盘错误)   (两节点都做)

第三步:         1、multipath -F : 删除现有路径         (两节点都做)

                        2、multipath -v2 : 格式化路径         两节点都做)

                        3、multipath -ll : 查看多路径                         (两节点都做)

 

[root@chicbi1 bin]# multipath -F
Dec 15 21:53:43 | mpathk: map in use

[root@chicbi1 bin]# df -h

Filesystem                     Size  Used Avail Use% Mounted on

/dev/mapper/VolGroup-LogVol02  419G   33G  364G   9% /

tmpfs                          126G   72K  126G   1% /dev/shm

/dev/sda1                      194M   35M  150M  19% /boot

/dev/mapper/VolGroup-LogVol01   99G   18G   76G  19% /u01

/dev/mapper/rman_vg-rman_lv    2.0T  994G  876G  54% /oracle_rman

[root@chicbi1 bin]#

[root@chicbi1 bin]#

[root@chicbi1 bin]#

[root@chicbi1 bin]# multipath -v2

Dec 15 21:54:03 | mpathb: ignoring map

create: data3 (3600a0980383046304a5d4c68436b6775) undef NETAPP,LUN C-Mode

size=480G features='3 queue_if_no_path pg_init_retries 50' hwhandler='0' wp=undef

`-+- policy='round-robin 0' prio=50 status=undef

 |- 1:0:0:1 sdc 8:32  undef ready running

 `- 2:0:0:1 sdk 8:160 undef ready running

create: ocr2 (3600a0980383046304a5d4c68436b6832) undef NETAPP,LUN C-Mode

size=5.0G features='3 queue_if_no_path pg_init_retries 50' hwhandler='0' wp=undef

`-+- policy='round-robin 0' prio=50 status=undef

 |- 1:0:0:5 sdg 8:96  undef ready running

 `- 2:0:0:5 sdo 8:224 undef ready running

create: ocr1 (3600a0980383046304a5d4c68436b6777) undef NETAPP,LUN C-Mode

size=5.0G features='3 queue_if_no_path pg_init_retries 50' hwhandler='0' wp=undef

`-+- policy='round-robin 0' prio=50 status=undef

 |- 1:0:0:3 sde 8:64  undef ready running

 `- 2:0:0:3 sdm 8:192 undef ready running

create: data1 (3600a0980383046304a5d4c68436b6774) undef NETAPP,LUN C-Mode

size=480G features='3 queue_if_no_path pg_init_retries 50' hwhandler='0' wp=undef

 

第四步:配置udev规则 (两节点都做),此次添加四块磁盘

 

for i in data4 data5 data6 data7;  
do

       echo "KERNEL==\"dm-*\", SUBSYSTEM==\"block\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/mapper/$i`\", NAME=\"asm$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""      >> /etc/udev/rules.d/99-oracle-asmdevices.rules

done

 

查看udev规则,确认配置正确: (两节点都做)

 

[root@chicbi1 rules.d]# cat 99-oracle-asmdevices.rules
 

KERNEL=="dm-*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3600a0980383046304a5d4c68436b6777", NAME="asmocr1", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="dm-*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3600a0980383046304a5d4c68436b6832", NAME="asmocr2", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="dm-*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3600a0980383046304a5d4c68436b6778", NAME="asmocr3", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="dm-*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3600a0980383046304a5d4c68436b6774", NAME="asmdata1", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="dm-*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3600a0980383046304a5d4c68436b6835", NAME="asmdata2", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="dm-*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3600a0980383046304a5d4c68436b6775", NAME="asmdata3", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="dm-*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3600a0980383046304a5d4c68436b6844", NAME="asmdata4", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="dm-*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3600a0980383046304a5d4c68436b6849", NAME="asmdata5", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="dm-*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3600a0980383046304a5d4c68436b684b", NAME="asmdata6", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="dm-*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3600a0980383046304a5d4c68436b684c", NAME="asmdata7", OWNER="grid", GROUP="asmadmin", MODE="0660"



[root@chicbi1 rules.d]# start_udev   (两节点都做)

 
  

Starting udev:                                             [  OK  ]

 
  

[root@chicbi1 rules.d]# ll /dev/asm*

 
  

brw-rw---- 1 grid asmadmin 253,  5 Dec 15 22:00 /dev/asmdata1

 
  

brw-rw---- 1 grid asmadmin 253,  6 Dec 15 22:00 /dev/asmdata2

 
  

brw-rw---- 1 grid asmadmin 253,  2 Dec 15 21:54 /dev/asmdata3

 
  

brw-rw---- 1 grid asmadmin 253,  8 Dec 15 22:00 /dev/asmdata4

 
  

brw-rw---- 1 grid asmadmin 253, 12 Dec 15 22:00 /dev/asmdata5

 
  

brw-rw---- 1 grid asmadmin 253, 13 Dec 15 22:00 /dev/asmdata6

 
  

brw-rw---- 1 grid asmadmin 253, 14 Dec 15 22:00 /dev/asmdata7

 
  

brw-rw---- 1 grid asmadmin 253,  4 Dec 15 22:00 /dev/asmocr1

 
  

brw-rw---- 1 grid asmadmin 253,  3 Dec 15 22:00 /dev/asmocr2

 
  

brw-rw---- 1 grid asmadmin 253,  7 Dec 15 22:00 /dev/asmocr3

 

 

 

SQL> select GROUP_NUMBER,DISK_NUMBER, MODE_STATUS,HEADER_STATUS, MODE_STATUS,state,TOTAL_MB,FREE_MB,name,PATH from v$asm_disk;
 
 
GROUP_NUMBER DISK_NUMBER MODE_STATUS    HEADER_STATUS            MODE_STATUS    STATE              TOTAL_MB    FREE_MB NAME                                                         PATH
 
------------ ----------- -------------- ------------------------ -------------- ---------------- ---------- ---------- ------------------------------------------------------------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
          0           0 ONLINE         CANDIDATE                ONLINE         NORMAL                    0          0                                                              /dev/asmdata4
 
          0           1 ONLINE         CANDIDATE                ONLINE         NORMAL                    0          0                                                              /dev/asmdata7
 
          0           2 ONLINE         CANDIDATE                ONLINE         NORMAL                    0          0                                                              /dev/asmdata6
 
          0           3 ONLINE         CANDIDATE                ONLINE         NORMAL                    0          0                                                              /dev/asmdata5
 
          2           2 ONLINE         MEMBER                   ONLINE         NORMAL                 5120       4772 OCR_0002                                                     /dev/asmocr3
 
          1           1 ONLINE         MEMBER                   ONLINE         NORMAL               491568      74540 DATA_0001                                                    /dev/asmdata2
 
          1           0 ONLINE         MEMBER                   ONLINE         NORMAL               491568      74545 DATA_0000                                                    /dev/asmdata1
 
          2           0 ONLINE         MEMBER                   ONLINE         NORMAL                 5120       4776 OCR_0000                                                     /dev/asmocr1
 
          2           1 ONLINE         MEMBER                   ONLINE         NORMAL                 5120       4772 OCR_0001                                                     /dev/asmocr2
 
          1           2 ONLINE         MEMBER                   ONLINE         NORMAL               491568      74552 DATA_0002  
 

[grid@chicbi1 ~]$ sqlplus / as sysasm (单节点执行)
 

SQL*Plus: Release 11.2.0.4.0 Production on Sun Dec 16 02:24:49 2018

 

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

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Real Application Clusters and Automatic Storage Management options

 

SQL> set time on
 
02:25:06 SQL> set timing on
 
02:25:08 SQL> alter diskgroup DATA add disk '/dev/asmdata4' rebalance power 10 ;
 
alter diskgroup DATA add disk '/dev/asmdata5' rebalance power 10;
 
alter diskgroup DATA add disk '/dev/asmdata6' rebalance power 10;
 
alter diskgroup DATA add disk '/dev/asmdata7' rebalance power 10;
 
Diskgroup altered.
 
Elapsed: 00:00:11.51
 
02:25:28 SQL>
 
Diskgroup altered.
 
Elapsed: 00:00:15.13
 
02:25:43 SQL>
 
Diskgroup altered.
 
Elapsed: 00:00:15.09
 
02:25:58 SQL>
 
Diskgroup altered.
 
Elapsed: 00:00:13.20
 
02:27:37 SQL> 02:27:37 SQL> 02:27:37 SQL>
 

查看扩容后配置:

 
02:28:30 SQL> set lines 1000 pages 1000
02:28:38 SQL> select name,free_mb/1024,total_mb/1024 from v$asm_diskgroup;
 
 
 
NAME                 FREE_MB/1024 TOTAL_MB/1024
 
-------------------- ------------ -------------
 
DATA                   2138.70801     3360.47656
 
OCR                     13.984375            15
 
 
 
 
 
select GROUP_NUMBER,DISK_NUMBER, MODE_STATUS,HEADER_STATUS, MODE_STATUS,state,TOTAL_MB,FREE_MB,name,PATH from v$asm_disk;
 
 
 
GROUP_NUMBER DISK_NUMBER MODE_STATUS    HEADER_STATUS            MODE_STATUS    STATE              TOTAL_MB    FREE_MB NAME                                                         PATH
 
------------ ----------- -------------- ------------------------ -------------- ---------------- ---------- ---------- ------------------------------------------------------------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
          1           4 ONLINE         MEMBER                   ONLINE         NORMAL               491568     478768 DATA_0004                                                    /dev/asmdata4
 
          1           7 ONLINE         MEMBER                   ONLINE         NORMAL               491644     478845 DATA_0007                                                    /dev/asmdata7
 
          1           6 ONLINE         MEMBER                   ONLINE         NORMAL               491644     478841 DATA_0006                                                    /dev/asmdata6
 
          1           5 ONLINE         MEMBER                   ONLINE         NORMAL               491568     478768 DATA_0005                                                    /dev/asmdata5
 
          2           2 ONLINE         MEMBER                   ONLINE         NORMAL                 5120       4772 OCR_0002                                                     /dev/asmocr3
 
          1           1 ONLINE         MEMBER                   ONLINE         NORMAL               491568      91600 DATA_0001                                                    /dev/asmdata2
 
          1           0 ONLINE         MEMBER                   ONLINE         NORMAL               491568      91605 DATA_0000                                                    /dev/asmdata1
 
          2           0 ONLINE         MEMBER                   ONLINE         NORMAL                 5120       4776 OCR_0000                                                     /dev/asmocr1
 
          2           1 ONLINE         MEMBER                   ONLINE         NORMAL                 5120       4772 OCR_0001                                                     /dev/asmocr2
 
          1           2 ONLINE         MEMBER                   ONLINE         NORMAL               491568      91610 DATA_0002  
 

 

 

你可能感兴趣的:(ASM下添加磁盘)