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
saswins says
Wonderful article, helped a lot in fixing my issue.
Bugra Canbakal says
Hello, i am happy that it help you! 🙂
Saurabh says
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?
Bugra Canbakal says
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.