Category: ASM

  • OracleDB12c New Feature: Rename and Replace ASM Disk(s) in Diskgroup

    As I have not set up 12c GI ASM yet, have not tested this feature… Rename clause is nice to have. Replace clause helps to avoid multiple steps when replacing disk (LUN) with new one [array migration, for example].

    Information below is straight copy from Oracle Documentation

    rename_disk_clause

    ALTER DISKGROUP diskgroup_name 
      RENAME
      { DISK old_disk_name TO new_disk_name 
      [, old_disk_name TO new_disk_name ]...
      | DISKS ALL }

    Use this clause to rename one or more disks in the disk group. The disk group must be in the MOUNT RESTRICTED state and all disks in the disk group must be online.

    RENAME DISK Specify this clause to rename one or more disks. For each disk, specify the old_disk_name and new_disk_name. If new_disk_name already exists, then this operation fails.
    RENAME DISKS ALL Specify this clause to rename all disks in the disk group to a name of the form diskgroupname_####, where #### is the disk number. Disk names that are already in the diskgroupname_#### format are not changed.

    replace_disk_clause

    ALTER DISKGROUP diskgroup_name 
      REPLACE DISK disk_name 
      WITH 'path_name' 
      [ POWER integer ] [ WAIT | NOWAIT ]

    Use this clause to replace a disk in the disk group. This clause provides a single replace operation, which is more efficient than dropping and adding a disk.

    For disk_name, specify the name of the disk you want to replace. This name is assigned to the replacement disk. You can view disk names by querying the NAME column of the V$ASM_DISK dynamic performance view.

    For path_name, specify the full path name for the replacement disk.

    The POWER clause has the same semantics here as for a manual rebalancing of a disk group, except that the power value cannot be set to 0.  The WAIT and NOWAIT keywords have the same semantics here as for a manual rebalancing of a disk group.

     

  • Disk Array Migration for ASM Databases

    This blog identifies the DBA steps required to migrate databases from one disk array to another.
    Identify the ASM diskgroups and their disk (LUN) sizes
    Login to the ASM instance and identify the LUNs allocated to server.
    SQL> SET PAGES 999
    SQL> col name format a15

    For 11g ASM:

    SQL> select d.group_number, g.name, d.os_mb
    from v$asm_disk d left outer join v$asm_diskgroup g
    on (d.group_number = g.group_number)
    order by g.group_number, d.os_mb;

    For 10g ASM:

    SQL> select d.group_number, g.name, d.total_mb
    from v$asm_disk d left outer join v$asm_diskgroup g
    on (d.group_number = g.group_number)
    order by g.group_number, d.total_mb;

    You may discard LUNs with group number 0, as they are not part of any diskgroup. Request Sysadmin team to provision the new LUNs to the server, same LUN size or total of multiple LUNs in the group is equal or more to what is allocated to the group. 

     To find out what is allocated and free in each diskgroup, you may use:
    SQL> select name, total_mb, free_mb from v$asm_diskgroup;

    Once LUNs are provisioned by Unix team, use OEM or SQL to add the LUNs to respective diskgroups [existing diskgroup]. NO outage required for this step. Remember to login to 11g ASM using the SYSASM privilege, for 10g login using SYSDBA privilege.

    SQL> ALTER DISKGROUP ADD DISK ‘/full_path_of_device’;

    To find out which LUNs are available to add, you may use SQL:

    SQL> col path format a40
    SQL> select path, os_mb from v$asm_disk where group_number = 0;
    {for 10g ASM, please substitute os_mb with total_mb}
    Then, go ahead and drop the old LUNs. No need to wait for the add operation to complete.
    SQL> ALTER DISKGROUP DROP DISK name_of_old_LUN;

    The name of the LUN can be found by querying the V$ASM_DISK…

    SQL> select path,name from v$asm_disk where group_number=3;

    Keep the rebalance power low, so that the migration activity does not impact database performance.

    You may check the progress of rebalance periodically using V$ASM_OPERATION, once no rows are in this view, you may advice SYSADMIN team to pull out the old LUNs from the server. V$ASM_OPERATION also shows the work so far completed and how long it will take to complete the work.