首页 » 数据库 » Oracle » Oracle 11g rac asm磁盘组增加硬盘操作

Oracle 11g rac asm磁盘组增加硬盘操作

 

要增加磁盘的磁盘组为:DATA

要增加的磁盘为: /dev/mpath/mpathc 大小1.5T

当asm磁盘情况查看
[root@DB11 ~]# su - grid
[grid@DB11 ~]$ asmcmd
ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  4194304   1509480    57396                0           57396              0             N  DATA/
MOUNTED  NORMAL  N         512   4096  1048576      6024     5098             2008            1545              0             Y  OCRVOTE/ 

增加前Total_MB 1509480


查看磁盘

在第一个节点上:
[root@DB11 ~]# multipath -ll
mpathc (36000c293f6bbbc389bd05510eafa061f) dm-7 VMware,Virtual disk
size=1.5T features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
  `- 3:0:2:0 sdd 8:48 active ready running
36000c290cbcbdb49a3f95dee3c1f13be dm-1 VMware,Virtual disk
size=500G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
  `- 3:0:1:0 sdc 8:32 active ready running
36000c29a805236ed740b94a822cf344c dm-0 VMware,Virtual disk
size=980G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
  `- 3:0:0:0 sdb 8:16 active ready running
You have new mail in /var/spool/mail/root

[root@DB11 mapper]# ll
total 0
lrwxrwxrwx 1 root root      7 Oct 27 23:32 36000c290cbcbdb49a3f95dee3c1f13be -> ../dm-1
lrwxrwxrwx 1 root root      7 Oct 27 23:32 36000c290cbcbdb49a3f95dee3c1f13bep1 -> ../dm-3
lrwxrwxrwx 1 root root      7 Oct 27 23:32 36000c290cbcbdb49a3f95dee3c1f13bep2 -> ../dm-4
lrwxrwxrwx 1 root root      7 Oct 27 23:32 36000c290cbcbdb49a3f95dee3c1f13bep3 -> ../dm-5
lrwxrwxrwx 1 root root      7 Oct 27 23:32 36000c290cbcbdb49a3f95dee3c1f13bep4 -> ../dm-6
lrwxrwxrwx 1 root root      7 Oct 27 23:32 36000c29a805236ed740b94a822cf344c -> ../dm-0
lrwxrwxrwx 1 root root      7 Oct 27 23:32 36000c29a805236ed740b94a822cf344cp1 -> ../dm-2
crw-rw---- 1 root root 10, 58 Oct 27 23:32 control
lrwxrwxrwx 1 root root      7 Dec  9 18:00 mpathc -> ../dm-7

在第二个节点上:
[root@DB12 ~]# multipath -ll
mpathe (36000c293f6bbbc389bd05510eafa061f) dm-7 VMware,Virtual disk
size=1.5T features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
  `- 4:0:2:0 sdd 8:48 active ready running
mpathd (36000c290cbcbdb49a3f95dee3c1f13be) dm-1 VMware,Virtual disk
size=500G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
  `- 4:0:1:0 sdc 8:32 active ready running
mpathc (36000c29a805236ed740b94a822cf344c) dm-0 VMware,Virtual disk
size=980G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
  `- 4:0:0:0 sdb 8:16 active ready running

创建ASM磁盘并添加到DATA组

在第一个节点上把新增的1.5T存储分一个区作为新增加的ASM数据盘
[root@DB11 ~]# fdisk /dev/mpath/mpathc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x2f438bcd.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/mapper/mpathc: 1649.3 GB, 1649267441664 bytes
255 heads, 63 sectors/track, 200512 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2f438bcd

             Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-200512, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-200512, default 200512):
Using default value 200512

Command (m for help): p

Disk /dev/mapper/mpathc: 1649.3 GB, 1649267441664 bytes
255 heads, 63 sectors/track, 200512 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2f438bcd

             Device Boot      Start         End      Blocks   Id  System
/dev/mapper/mpathcp1               1      200512  1610612608+  83  Linux

[root@DB11 ~]# partprobe /dev/mapper/mpathc     #不重启识别磁盘分区
[root@DB12 ~]# partprobe /dev/mapper/mpathe

现有ASM磁盘组合DISK查看

SQL*Plus: Release 11.2.0.4.0 Production on Fri Jul 1 10:55:18 2016

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> select instance_name from v$instance;

INSTANCE_NAME
----------------
+ASM1

SQL> col name for a10
SQL> set linesize 150
SQL> select NAME, ALLOCATION_UNIT_SIZE, STATE, TOTAL_MB, FREE_MB USABLE_FILE_MB from gv$asm_diskgroup;

NAME    ALLOCATION_UNIT_SIZE STATE       TOTAL_MB USABLE_FILE_MB
---------- -------------------- ----------- ---------- --------------
DATA   4194304 CONNECTED      1509480  57396
OCRVOTE   1048576 MOUNTED    6024   5098
DATA   4194304 CONNECTED      1509480  57396
OCRVOTE   1048576 MOUNTED    6024   5098

SQL> select failgroup, name from v$asm_disk where group_number=(select group_number from v$asm_diskgroup where name = 'DATA');

FAILGROUP         NAME
------------------------------ ------------------------------
ORADATA02         ORADATA02
ORADATA03         ORADATA03

[root@DB11 dev]# ll /dev/oracleasm/disks
total 0
brw-rw---- 1 grid asmadmin 8, 33 Oct 27 23:32 OCR_VOTE04
brw-rw---- 1 grid asmadmin 8, 34 Oct 27 23:32 OCR_VOTE05
brw-rw---- 1 grid asmadmin 8, 35 Oct 27 23:32 OCR_VOTE06
brw-rw---- 1 grid asmadmin 8, 17 Oct 27 23:32 ORADATA02
brw-rw---- 1 grid asmadmin 8, 36 Oct 27 23:32 ORADATA03
You have new mail in /var/spool/mail/root
[root@HJY_DB11 dev]# oracleasm listdisks
OCR_VOTE04
OCR_VOTE05
OCR_VOTE06
ORADATA02
ORADATA03

在节点一上创建 ORADATA04

[root@HJY_DB11 ~]# oracleasm createdisk ORADATA04 /dev/mapper/mpathcp1
Writing disk header: done
Instantiating disk: done

[root@DB11 ~]# ll /dev/oracleasm/disks
total 0
brw-rw---- 1 grid asmadmin   8, 33 Oct 27 23:32 OCR_VOTE04
brw-rw---- 1 grid asmadmin   8, 34 Oct 27 23:32 OCR_VOTE05
brw-rw---- 1 grid asmadmin   8, 35 Oct 27 23:32 OCR_VOTE06
brw-rw---- 1 grid asmadmin   8, 17 Oct 27 23:32 ORADATA02
brw-rw---- 1 grid asmadmin   8, 36 Oct 27 23:32 ORADATA03
brw-rw---- 1 grid asmadmin 253,  8 Dec 12 16:43 ORADATA04
[root@HJY_DB11 dev]# oracleasm listdisks
OCR_VOTE04
OCR_VOTE05
OCR_VOTE06
ORADATA02
ORADATA03
ORADATA04

在第二个节点:
[root@DB12 dev]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "ORADATA04"

[root@DB12 dev]# ll /dev/oracleasm/disks
total 0
brw-rw---- 1 grid asmadmin 8, 33 Sep 14 15:06 OCR_VOTE04
brw-rw---- 1 grid asmadmin 8, 34 Sep 14 15:06 OCR_VOTE05
brw-rw---- 1 grid asmadmin 8, 35 Sep 14 15:06 OCR_VOTE06
brw-rw---- 1 grid asmadmin 8, 17 Sep 14 15:06 ORADATA02
brw-rw---- 1 grid asmadmin 8, 36 Sep 14 15:06 ORADATA03
brw-rw---- 1 grid asmadmin 8, 49 Dec 12 16:43 ORADATA04
[root@HJY_DB12 dev]# oracleasm listdisks
OCR_VOTE04
OCR_VOTE05
OCR_VOTE06
ORADATA02
ORADATA03
ORADATA04

添加到DATA组

[root@rac1 ~]# su - grid
[grid@rac1 ~]$ export ORACLE_SID=+ASM1
[grid@rac1 ~]$ 
[grid@rac1 ~]$ 
[grid@rac1 ~]$ sqlplus /nolog
SQL> conn / as sysasm
SQL> alter diskgroup DATA add disk 'ORCL:ORADATA04';

Diskgroup altered.

ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  Y         512   4096  4194304   3082340  1630248                0         1630248              0             N  DATA/
MOUNTED  NORMAL  N         512   4096  1048576      6024     5098             2008            1545              0             Y  OCRVOTE/


total_MB : 4194304  


ASM磁盘添加完成。

原文链接:Oracle 11g rac asm磁盘组增加硬盘操作,转载请注明来源!

0