Thursday, May 28, 2015

Add New Disk Group In ASM

Disk Redundancy : There are three disk redundancy in Oracle ASM which are used at the time of Disk group creation.

NORMAL REDUNDANCY - Two-way mirroring, requiring two failure groups.
HIGH REDUNDANCY - Three-way mirroring, requiring three failure groups.
EXTERNAL REDUNDANCY - No mirroring for disks that are already protected using hardware mirroring or RAID.

Disk Group REBALANCE: REBALANCE would not required normally, ASM automatically rebalances disk groups when their configuration changes. We can do an manual REBALANCE operation to control the speed.

POWER: This is specifies the degree of parallelism, and thus the speed of the rebalance operation.

[

CREATE DISKGROUP RMAN_BACKUP EXTERNAL REDUNDANCY DISK '/dev/oracleasm/disks/RMAN_BKP';

CREATE DISKGROUP RMAN_BACKUP NORMAL REDUNDANCY
  FAILGROUP fail_group_1 DISK
    '/dev/oracleasm/disks/file01' NAME disk1,
    '/dev/oracleasm/disks/file02' NAME disk2
  FAILGROUP fail_group_2 DISK
    '/dev/oracleasm/disks/file03' NAME disk1,
    '/dev/oracleasm/disks/file04' NAME disk2;

 CREATE DISKGROUP DATA_DISK01 HIGH REDUNDANCY
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file01'
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file02'
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file03'
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file04'
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file05'
 FAILGROUP FAIL_GROUP_1 DISK
 '/dev/oracleasm/disks/file06'
 ATTRIBUTE 'compatible.asm' = '11.2.0.0.0';

 ]

=== From root User

List of LUN Available for ASM

[root@OEL564ASMN1 ~]# fdisk -l

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2624    20972857+  83  Linux
/dev/sda3            2625        3146     4192965   82  Linux swap / Solaris
/dev/sda4            3147        6527    27157882+   5  Extended
/dev/sda5            3147        6527    27157851   8e  Linux LVM

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        3916    31455238+  83  Linux

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1305    10482381   83  Linux

Disk /dev/sdd: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdd doesn't contain a valid partition table

Prepare Disk For ASM

[root@OEL564ASMN1 ~]# fdisk /dev/sdd
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. 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)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-652, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-652, default 652):
Using default value 652

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@OEL564ASMN1 ~]#

List of Disk For ASM

[root@OEL564ASMN1 ~]# fdisk -l

Disk /dev/sda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2624    20972857+  83  Linux
/dev/sda3            2625        3146     4192965   82  Linux swap / Solaris
/dev/sda4            3147        6527    27157882+   5  Extended
/dev/sda5            3147        6527    27157851   8e  Linux LVM

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        3916    31455238+  83  Linux

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1305    10482381   83  Linux

Disk /dev/sdd: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1         652     5237158+  83  Linux
[root@OEL564ASMN1 ~]# oracleasm createdisk RMAN_BKP /dev/sdd1
Writing disk header: done
Instantiating disk: done
[root@OEL564ASMN1 ~]#
[root@OEL564ASMN1 ~]# oracleasm listdisks
DATAVOL1
FRAVOL1
RMAN_BKP
[root@OEL564ASMN1 ~]#
[root@OEL564ASMN1 ~]# oracleasm-discover
Using ASMLib from /opt/oracle/extapi/32/asm/orcl/1/libasm.so
[ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
Discovered disk: ORCL:DATAVOL1 [62910477 blocks (32210164224 bytes), maxio 512]
Discovered disk: ORCL:FRAVOL1 [20964762 blocks (10733958144 bytes), maxio 512]
Discovered disk: ORCL:RMAN_BKP [10474317 blocks (5362850304 bytes), maxio 512]
[root@OEL564ASMN1 ~]#
[root@OEL564ASMN1 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@OEL564ASMN1 ~]#

=== From grid User

[grid@OEL564ASMN1 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Thu May 28 14:17:16 2015

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

SQL> conn /as sysasm
Connected.
SQL> SELECT GROUP_NUMBER, NAME FROM V$ASM_DISKGROUP;

GROUP_NUMBER Disk Name
------------ ------------
           1 DATA
           2 FRA

SQL> SET LINE 2000
SQL> COLUMN group_number                FORMAT 999,999       HEAD 'Group Number'
SQL> COLUMN MOUNT_STATUS         FORMAT a10           HEAD 'Mount Status'
SQL> COLUMN HEADER_STATUS               FORMAT a12           HEAD 'Header Status'
SQL> COLUMN MODE_STATUS         FORMAT a10           HEAD ' Mode Status'
SQL> COLUMN STATE                       FORMAT a10           HEAD 'State'
SQL> COLUMN TOTAL_MB                    FORMAT 999,999       HEAD 'Total Size In MB'
SQL> COLUMN FREE_MB                     FORMAT 999,999       HEAD 'Free Space In MB'
SQL> COLUMN NAME                        FORMAT a12           HEAD 'Disk Name'
SQL> COLUMN PATH                        FORMAT a45           HEAD 'Disk Location'
SQL> COLUMN LABEL                       FORMAT a12           HEAD 'Disk Level'
SQL> SELECT GROUP_NUMBER, MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,TOTAL_MB,FREE_MB,NAME,PATH,LABEL FROM V$ASM_DISK;

Group Number Mount Stat Header Statu  Mode Stat State      Total Size In MB Free Space In MB Disk Name    Disk Location                                 Disk Level
------------ ---------- ------------ ---------- ---------- ---------------- ---------------- ------------ --------------------------------------------- ------------
           0 CLOSED     PROVISIONED  ONLINE     NORMAL                    0                0              /dev/oracleasm/disks/RMAN_BKP
           2 CACHED     MEMBER       ONLINE     NORMAL               10,236            9,942 FRA_0000     /dev/oracleasm/disks/FRAVOL1
           1 CACHED     MEMBER       ONLINE     NORMAL               30,718           28,836 DATA_0000    /dev/oracleasm/disks/DATAVOL1

SQL>
SQL> CREATE DISKGROUP RMAN_BACKUP EXTERNAL REDUNDANCY DISK '/dev/oracleasm/disks/RMAN_BKP';

Diskgroup created.

SQL>
SQL> SELECT GROUP_NUMBER, MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,TOTAL_MB,FREE_MB,NAME,PATH,LABEL FROM V$ASM_DISK;

Group Number Mount Stat Header Statu  Mode Stat State      Total Size In MB Free Space In MB Disk Name    Disk Location                                 Disk Level
------------ ---------- ------------ ---------- ---------- ---------------- ---------------- ------------ --------------------------------------------- ------------
           2 CACHED     MEMBER       ONLINE     NORMAL               10,236            9,942 FRA_0000     /dev/oracleasm/disks/FRAVOL1
           1 CACHED     MEMBER       ONLINE     NORMAL               30,718           28,836 DATA_0000    /dev/oracleasm/disks/DATAVOL1
           3 CACHED     MEMBER       ONLINE     NORMAL                5,114            5,064 RMAN_BACKUP_ /dev/oracleasm/disks/RMAN_BKP
                                                                                             0000
SQL>


No comments:

Post a Comment