How to rename a Disk in ASM


asm

When create a Diskgroup the ASM diskname is created per default for you. The name of the disk typically looks like Diskgroupname an some Digits.

First check your current diskname.

SQL>col name format a12
SQL>col path format a30
SQL>SELECT name, path
      FROM v$asm_disk
     WHERE group_number = (SELECT group_number FROM v$asm_diskgroup WHERE name = 'DG_DATA');
NAME         PATH
------------ ------------------------------
DG_DATA_0000 /dev/oracleasm/disks/ORA_DISK1

The diskname DG_DATA_0000 is not very intuitiv because it tells nothing about the diskshelf or the storage the disk belongs to. For this example we want to rename the diskname to DG_DATA_0_ST1_FG1 which means Storage1 and Failgroup 1.
For renaming a disk in ASM we must remount the Diskgroup in restricted mode.

SQL> alter diskgroup dg_data dismount;
Diskgroup altered.
SQL> alter diskgroup dg_data mount restricted;
Diskgroup altered.

After mounting the diskgroup in restricted mode, we can now rename the diskname.

SQL> alter diskgroup DG_DATA rename disk 'DG_DATA_0000' to 'DG_DATA_0_ST1_FG1';
Diskgroup altered.

Now the Disk is renamed. Query the v$ASM_DISK View to check for the new name.

SQL> SELECT name, path
       FROM v$asm_disk
     WHERE group_number = (SELECT group_number FROM v$asm_diskgroup WHERE name = 'DG_DATA');
NAME              PATH
----------------- -------------------------------------
DG_DATA_0_ST1_FG1 /dev/oracleasm/disks/ORA_DISK1

Don`t forget that the diskgroup is in restricted mode. If you have finished your work remount them in normal mode.

Advertisements

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s