Tuesday, June 11, 2019

ADD DISKS TO ASM DISKGROUP

How do I add a disks to ASM DISKGROUP ?

1. Create partition of disk /dev/sde which we got new LUN from Storage.

you can check the disks as fdisk -l

for formatting the disks :::

[root@node4 Ora-Soft]# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x494214d4.
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): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-261, default 1):  >> enter
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-261, default 261):  >> enter
Using default value 261

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

Calling ioctl() to re-read partition table.
Syncing disks.

2.  Create ASM disk using oracleasm utility

[root@node4 Ora-Soft]# /etc/init.d/oracleasm createdisk ASMDISK2 /dev/sdc1
Marking disk "ASMDISK2" as an ASM disk:                    [  OK  ]

3  check Scadisks and Listdisks using oracleasm utility 

[root@node4 ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks:               [  OK  ]
[root@node4 ~]# /etc/init.d/oracleasm listdisks
ASMDISK1
ASMDISK2
ASMDISK3
[root@node4 ~]#


4. Now Add the newly created oracle ASM disk to existing ASM diskgroup with the help of following query:

Login to grid user and loin as sysasm and run the following Query.

[grid@node4 ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 10 17:12:36 2019

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 * from v$asm_operation;

no rows selected

SQL> ALTER DISKGROUP DATADG ADD DISK 'ORCL:ASMDISK2' REBALANCE POWER 11;

Diskgroup altered.

SQL> set lines 300
SQL> select * from v$asm_operation;

GROUP_NUMBER OPERA STAT      POWER     ACTUAL    SOFAR   EST_WORK   EST_RATE EST_MINUTES ERROR_CODE
------------ ----- ---- ---------- ---------- ---------- ---------- ---------- ----------- ------------
   1 REBAL RUN 11    11      288       1012   1366 0

Check Diskgroup size: 

SQL> SELECT NAME,TOTAL_MB/1024 as TOTAL_GB,FREE_MB /1024 as FREE_GB,(TOTAL_MB-FREE_MB)/1024 as USED_GB FROM v$asm_diskgroup; 

NAME TOTAL_GB    FREE_GB USED_GB
------------------------------ ---------- ---------- ----------
DATADG        3.99804688 2.01464844 1.98339844
FRADG        1.99902344 1.81347656 .185546875
VOTEDISK        1.99902344 1.61230469  .38671875

No comments:

Post a Comment

Thanks for giving comments!!