juin 21 2011

Disk operations with ASM.

Tag: DBUggla @ 11 h 12 min

A short article to keep some useful queries for ASM.

  1. Querie to list disks and groups.
    set pages 1000
    set lines 300
    col path format a50
    col instance_name format a20
    select v$asm_diskgroup.name,v$asm_disk.GROUP_NUMBER,v$asm_client.INSTANCE_NAME,v$asm_disk.PATH,v$asm_disk.name,v$asm_disk.STATE
    from v$asm_diskgroup, v$asm_client, v$asm_disk
    where v$asm_client.GROUP_NUMBER=v$asm_disk.GROUP_NUMBER and v$asm_disk.GROUP_NUMBER=v$asm_diskgroup.GROUP_NUMBER
    order by group_number,path;

    NAME                           GROUP_NUMBER INSTANCE_NAME        PATH                                               NAME                           STATE
    ------------------------------ ------------ -------------------- -------------------------------------------------- ------------------------------ --------
    DCLICDGR                                  1 MODEFRR12            /dev/oracle/asmdisk_decldr1                        DCLICDGR_0000                  NORMAL
    DCLICDG                                   2 MODEFRR12            /dev/oracle/asmdisk_decldd1                        DCLICDG_0000                   NORMAL
    DCLICDG                                   2 MODEFRR12            /dev/oracle/asmdisk_decldd2                        DCLICDG_0001                   NORMAL
    DCLICDG                                   2 MODEFRR12            /dev/oracle/asmdisk_decldd3                        DCLICDG_0002                   NORMAL
    DCLICDG                                   2 MODEFRR12            /dev/oracle/asmdisk_decldd4                        DCLICDG_0003                   NORMAL
    ESBDGR                                    3 ASCGFRR12            /dev/oracle/asmdisk_esbdr1                         ESBDGR_0000                    NORMAL
    ESBDG                                     4 ASCGFRR12            /dev/oracle/asmdisk_esbdd1                         ESBDG_0000                     NORMAL
    ESBDG                                     4 ASCGFRR12            /dev/oracle/asmdisk_esbdd2                         ESBDG_0001                     NORMAL
    ESBDG                                     4 ASCGFRR12            /dev/oracle/asmdisk_esbdd3                         ESBDG_0002                     NORMAL
    ETTDGR                                    5 ITECFRR12            /dev/oracle/asmdisk_ettdr1                         ETTDGR_0001                    NORMAL
    ETTDG                                     6 ITECFRR12            /dev/oracle/asmdisk_ettdd1                         ETTDG_0001                     NORMAL
    ETTDG                                     6 ITECFRR12            /dev/oracle/asmdisk_ettdd2                         ETTDG_0002                     NORMAL
    ETTDG                                     6 ITECFRR12            /dev/oracle/asmdisk_ettdd3                         ETTDG_0003                     NORMAL
    OCRDG                                     7 +ASM2                /dev/oracle/asmdisk_ocr1                           OCRDG_0000                     NORMAL
    OCRDG                                     7 +ASM2                /dev/oracle/asmdisk_ocr2                           OCRDG_0001                     NORMAL
    OCRDG                                     7 +ASM2                /dev/oracle/asmdisk_ocr3                           OCRDG_0002                     NORMAL
    PYRADGR                                   8 FISOFRR02            /dev/oracle/asmdisk_pyradr1                        PYRADGR_0000                   NORMAL
    PYRADG                                    9 FISOFRR02            /dev/oracle/asmdisk_pyradd1                        PYRADG_0001                    NORMAL
    PYRADG                                    9 FISOFRR02            /dev/oracle/asmdisk_pyradd2                        PYRADG_0002                    NORMAL
    PYRADG                                    9 FISOFRR02            /dev/oracle/asmdisk_pyradd3                        PYRADG_0003                    NORMAL
    PYRADG                                    9 FISOFRR02            /dev/oracle/asmdisk_pyradd4                        PYRADG_0004                    NORMAL
    DATA3                                    10 EDOCFRE12            /dev/oracle/asmdisk_data3                          DATA3_0000                     NORMAL
    EDOCDG                                   12 EDOCFRU02            /dev/oracle/asmdisk_edocdg                         EDOCDG_0000                    NORMAL
    EDOCARCHDG                               13 EDOCFRU02            /dev/oracle/asmdisk_edocarchdg                     EDOCARCHDG_0000                NORMAL
  2. Add / remove disk.
    alter diskgroup EDOCDG add disk '/dev/oracle/asmdisk_xp01','/dev/oracle/asmdisk_xp02'
    alter diskgroup EDOCDG drop disk 'EDOCDG_0000';
  3. Follow oprations.
    select * from v$asm_operation;
  4. Change rebalancing power (1 –>11) to speed up operations.
    alter diskgroup DATA2 REBALANCE POWER 5;

Warning : Take care about ownerships and rights on the disk special files !

A good synthetic article about ASM can be found here : http://www.oracle-base.com/articles/10g/AutomaticStorageManagement10g.php