Bugra Canbakal's Oracle Blog

  • Home
  • Contact
  • SITE MAP
You are here: Home / Oracle / Add a new disk to asm diskgroup

Add a new disk to asm diskgroup

12:43 PM By Bugra Canbakal 4 Comments

1.PURPOSE AND SCOPE

In this article i am going to explation how to add new disk to the diskgroup which used by database.Before starting i wanted to give some informations about our steps. In this practice we had got a disk named DISK4 and this isnt belong to single diskgroup.First of all i am going to check the stability of DISK4, if disk success i am going to create a different diskgroup and try to add it there.If this step also succeed we are going to add this disk to diskgroup which used by production diskgroup.

2.PRACTICE

2.1. Time to control stability of  DISK4 . (If you have got RAC env, you need to do this every single node)

[root@oracle ~]# /etc/init.d/oracleasm  scandisks

Scanning the system for Oracle ASMLib disks:               [  OK  ]

[root@oracle ~]# /etc/init.d/oracleasm  listdisks

DISK1

DISK2

DISK3

DISK4

[root@oracle ~]# /etc/init.d/oracleasm  querydisk DISK4

Disk "DISK4" is a valid ASM disk

[root@oracle ~]# ls -l /dev/oracleasm/disks/DISK4

brw-rw---- 1 oracle dba 8, 34 Jun 23 23:40 /dev/oracleasm/disks/DISK4

2.2.   Now we are going to check asm headers. For this step we need to use ASM metadata editor kfed. If everything is okey about asm header we need to see “kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD”

[root@oracle ~]# kfed read /dev/oracleasm/disks/DISK4
 kfbh.endian: 1 ; 0x000: 0x01
 kfbh.hard: 130 ; 0x001: 0x82
 kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
 ...
 kfbh.check: 1539641569 ; 0x00c: 0x5bc510e1
 ...
 kfdhdb.driver.provstr: ORCLDISKDISK4 ; 0x000: length=13
 ...
 kfdhdb.dsknum: 0 ; 0x024: 0x0000
 kfdhdb.grptyp: 2 ; 0x026: KFDGTP_NORMAL
 kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER
 kfdhdb.dskname: PLAY0 ; 0x028: length=5
 kfdhdb.grpname: PLAY ; 0x048: length=4
 kfdhdb.fgname: P1 ; 0x068: length=2
 ...
 kfdhdb.blksize: 4096 ; 0x0ba: 0x1000
 kfdhdb.ausize: 4194304 ; 0x0bc: 0x00400000
 ...
 kfdhdb.dsksize: 1221 ; 0x0c4: 0x000004c5
 ...

2.3.1. Lets connect to ASM instance.

[oracle@oracle ~]$ export ORACLE_SID=+ASM

[oracle@oracle ~]$ sqlplus /  as sysdba

SQL*Plus: Release 11.1.0.6.0 - Production on Fri Jun 24 00:11:02 2011

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

2.3.2. Lets create a new diskgroup and add DISK4 to this group.

P.S.: While crating diskgroup it gave error about asm_diskstring because of it i am adding information about this too maybe it would be usefull for you.

SQL> CREATE DISKGROUP TEST EXTERNAL REDUNDANCY DISK '/dev/oracleasm/disks/DISK4';

CREATE DISKGROUP TEST EXTERNAL REDUNDANCY DISK '/dev/oracleasm/disks/DISK4'

*

ERROR at line 1:

ORA-15018: diskgroup cannot be created

ORA-15031: disk specification '/dev/oracleasm/disks/DISK4' matches no disks

ORA-15014: path '/dev/oracleasm/disks/DISK4' is not in the discovery set

SQL> show parameter disk

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

asm_diskgroups                       string      DATA1, DATA2

asm_diskstring                       string

disk_asynch_io                       boolean     TRUE

SQL> alter system set asm_diskstring='/dev/oracleasm/disks/DISK*';

alter system set asm_diskstring='/dev/oracleasm/disks/DISK*'

*

ERROR at line 1:

ORA-02097: parameter cannot be modified because specified value is invalid

ORA-15014: path 'ORCL:DISK1' is not in the discovery s

SQL> alter system set asm_diskstring='ORCL:DISK*';

System altered.

SQL> CREATE DISKGROUP TEST EXTERNAL REDUNDANCY DISK 'ORCL:DISK4';

Diskgroup created.

2.4. We created TEST diskgroup so lets execute query to is it mounted and work correctly.

SQL> SELECT STATE, NAME FROM V$ASM_DISKGROUP;

STATE       NAME
----------- ------------------------------
MOUNTED     DATA1
MOUNTED     DATA2
MOUNTED     TEST

2.5. Seems like DISK4 passed our exams so lets drop TEST diskgroup

SQL> drop diskgroup test;

Diskgroup dropped.

2.6. Before adding disk to diskgroup lets check size of current diskgroups.

SQL> COL % FORMAT 99.0
SQL> SELECT name, free_mb, total_mb, free_mb/total_mb*100 "%" FROM v$asm_diskgroup;
NAME                              FREE_MB   TOTAL_MB     %
------------------------------ ---------- ---------- -----
DATA1                                8554      10196  83.9
DATA2                                4902       5137  95.4

2.7. Time to add DISK4 to DATA1 diskgroup.

SQL>  ALTER DISKGROUP DATA1 ADD DISK 'ORCL:DISK4';

Diskgroup altered.

2.8. Lets check diskgroup sizes again.

 
SQL> SELECT name, free_mb, total_mb, free_mb/total_mb*100 "%" FROM v$asm_diskgroup;

NAME                              FREE_MB   TOTAL_MB     %
------------------------------ ---------- ---------- -----
DATA1                               13689      15333  89.3
DATA2                                4902       5137  95.4

Share this:

  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on X (Opens in new window) X

Filed Under: Oracle, RAC - Real Application Cluster, Single Node Tagged With: asm, disk, diskgroup, new diskgroup

Comments

  1. saswins says

    Monday February 23rd, 2015 at 07:12 AM

    Wonderful article, helped a lot in fixing my issue.

  2. Bugra Canbakal says

    Monday February 23rd, 2015 at 10:09 AM

    Hello, i am happy that it help you! 🙂

  3. Saurabh says

    Wednesday December 2nd, 2015 at 04:13 AM

    Hi Bugra,

    Could please let me know where is value of ORCL is mapped to ”/dev/oracleasm/disks’? How Oracle is able to identify value of ORL in disk string?

  4. Bugra Canbakal says

    Monday January 25th, 2016 at 09:49 AM

    Hi Saurabh,

    I wanted to map to /dev/oracleasm/disks/DISK* but it gave me error , thats the reason i mapped on ORCL:DISK1 . You can find the log on highlight 2.3.2 . It can be a problem of 11.1.0.6.0 .
    PS: Sorry for late answer.

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About Me



Language:

  • English
  • Turkish

Categories

  • Oracle
    • RAC – Real Application Cluster
    • RMAN
    • Single Node
    • Standby – Dataguard
  • OS
    • Linux

Blogroll

  • Emre Baransel
  • Gökhan Atıl
  • H. Tonguc Yılmaz
  • Kamil Türkyılmaz
  • Tanel Poder
  • Turkce Oracle
  • Turkish Oracle User Group
  • Uwe Hesse
  • Zekeriya Beşiroğlu

Archives

  • April 2014
  • March 2014
  • August 2013
  • June 2013
  • March 2013
  • January 2013
  • December 2012
  • November 2012
  • July 2012
  • June 2012
  • May 2012
  • January 2012
  • November 2011
  • October 2011
  • August 2011
  • July 2011
  • June 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • June 2010
OCP
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

[footer_backtotop]

Copyright © 2010-2014 Bugra Canbakal. All rights reserved.