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)

Oracle PL/SQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[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”

Oracle PL/SQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[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 PL/SQL
1
2
3
4
5
6
7
8
9
10
11
12
13
[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.

Oracle PL/SQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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.

Oracle PL/SQL
1
2
3
4
5
6
7
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

Oracle PL/SQL
1
2
3
SQL> drop diskgroup test;
 
Diskgroup dropped.

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

Oracle PL/SQL
1
2
3
4
5
6
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.

Oracle PL/SQL
1
2
3
SQL>  ALTER DISKGROUP DATA1 ADD DISK 'ORCL:DISK4';
 
Diskgroup altered.

2.8. Lets check diskgroup sizes again.

Oracle PL/SQL
1
2
3
4
5
6
7
 
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:

  • LinkedIn
  • Twitter

Konuyla ilgili diğer yazılar

  • Oracle AMDU
  • Datapump da ASM alanını kullanmak
  • Asm Disk Üstüne Oracle Veritabanı Kurulumu
  • Moving datafile local disk to ASM

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

Comments

  1. Avatarsaswins says

    Monday February 23rd, 2015 at 07:12 AM

    Wonderful article, helped a lot in fixing my issue.

  2. AvatarBugra Canbakal says

    Monday February 23rd, 2015 at 10:09 AM

    Hello, i am happy that it help you! 🙂

  3. AvatarSaurabh 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. AvatarBugra 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 Reply Cancel 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.