This discussion is archived
7 Replies Latest reply: May 22, 2011 1:06 PM by Levi-Pereira RSS

what is the correct procedure to drop asm diskgroup is rac?

863526 Newbie
Currently Being Moderated
Hi,

I would like to drop a asm diskgroup in RAC? what is the correct procedure?
1.do I have to unmount the diskgroup first in the 2 nodes?
2. alter diskgroup xxx drop command to be run in the 2 nodes or just 1 node?
3. after droping command, is there any other procdures to do?

any doc to follow?

thanks

andrew
  • 1. Re: what is the correct procedure to drop asm diskgroup is rac?
    Levi-Pereira Guru
    Currently Being Moderated
    Hi,

    What's version of ASM?
    860523 wrote:
    I would like to drop a asm diskgroup in RAC? what is the correct procedure?
    1.do I have to unmount the diskgroup first in the 2 nodes?
    If you are using ASM 11.2, I recommend you use the utility ASMCA to drop DISKGROUP.

    If you are using ASM 11.1 or earlier use SQLPLUS.
    Dismount Diskgroup from all the ASM instances, except from one.
    Drop diskgroup from the ASM instance, which the diskgroup is still mounted
    Just it.

    If you query v$asm_disk the header_status must be "FORMER" on asmdisks that belonged to the diskgroup dropped.
    FORMER - Disk was once part of a disk group but has been dropped cleanly from the group.
    2. alter diskgroup xxx drop command to be run in the 2 nodes or just 1 node?
    Execute command only one ASM instance
    3. after droping command, is there any other procdures to do?
    No.
    any doc to follow?
    How To Add a New Disk(s) to An Existing Diskgroup on RAC (Best Practices). [ID 557348.1]

    Regards,
    Levi Pereira
  • 2. Re: what is the correct procedure to drop asm diskgroup is rac?
    863526 Newbie
    Currently Being Moderated
    Hi Levi,

    thank you very much. oracle 10.2, if I unmount the diskgroup, do I have to offline something or what is the procedure before alter disgroup xxx unmount?

    thanks again

    andrew
  • 3. Re: what is the correct procedure to drop asm diskgroup is rac?
    Levi-Pereira Guru
    Currently Being Moderated
    Hi Andrew,
    860523 wrote:
    thank you very much. oracle 10.2, if I unmount the diskgroup, do I have to offline something or what is the procedure before alter disgroup xxx unmount?
    You MUST remove (using DBCA) or move (using RMAN) all database stored on this diskgroup (if exists) before dropping DISKGROUP.
    1) Check if exists database using this DISKGROUP.
    The query above must return no rows.
    SQL>  SELECT D.NAME,C.INSTANCE_NAME,C.DB_NAME,C.STATUS
         FROM GV$ASM_DISKGROUP D , GV$ASM_CLIENT C
         WHERE D.GROUP_NUMBER=C.GROUP_NUMBER
         AND D.NAME = '<DISKGROUP_NAME>';  
    
    no rows selected
    If query above return rows you must shutdown all instance first and remove or move database to another DISKGROUP.

    2) Dismount Diskgroup from all the ASM instances, except from one.
    ALTER DISKGROUP <DISKGROUP_NAME> DISMOUNT;
    3)Drop diskgroup from the ASM instance, which the diskgroup is still mounted
    DROP DISKGROUP <DISKGROUP_NAME>; -- If no files on DISKGROUP
    DROP DISKGROUP <DISKGROUP_NAME> INCLUDING CONTENTS; - If exits files on DISKGROUP
    Just it.

    Regards,
    Levi Pereira
  • 4. Re: what is the correct procedure to drop asm diskgroup is rac?
    863526 Newbie
    Currently Being Moderated
    thanks Levi, I've already marked the answer as correct. However, another question, sorry, I have no testing rac environment to test. We've only got production rac .

    - if I unmount diskgroup on node1 and then after serveral hours I dismount this diskgroup in node 2 - just to make sure no errors and nothing is pointed to this diskgroup.
    - will there be error if I mount this diskgroup back to node 2 before I can drop it, (may be not in sync since the diskgroup is dismounted from 2 nodes at different times)?

    thanks

    andrew
  • 5. Re: what is the correct procedure to drop asm diskgroup is rac?
    Levi-Pereira Guru
    Currently Being Moderated
    Hi Andrew,
    860523 wrote:
    - if I unmount diskgroup on node1 and then after serveral hours I dismount this diskgroup in node 2 - just to make sure no errors and nothing is pointed to this diskgroup.
    I recommend you first of all check files on DISKGROUP. Indentify if this files is used by any databases. So I recommended you delete or move database (i.e: all files) before dropping Diskgroup. If no files on DISKGROUP then none databases use this DISKGROUP.

    You can use the query below to identifiy this files.

    e.g:
    set linesize 200
    col FULL_ALIAS_PATH for A70
    select concat('+'||gname, sys_connect_by_path(aname, '/')) full_alias_path, 
           system_created, alias_directory, file_type
         from ( select b.name gname, a.parent_index pindex, a.name aname, 
                  a.reference_index rindex , a.system_created, a.alias_directory,
                  c.type file_type
           from v$asm_alias a, v$asm_diskgroup b, v$asm_file c
           where a.group_number = b.group_number
                 and a.group_number = c.group_number(+)
                 and a.file_number = c.file_number(+)
                 and a.file_incarnation = c.incarnation(+)
         ) 
    start with (mod(pindex, power(2, 24))) = 0
                and rindex in 
                    ( select a.reference_index
                      from v$asm_alias a, v$asm_diskgroup b
                      where a.group_number = b.group_number
                            and (mod(a.parent_index, power(2, 24))) = 0
                            and b.name = UPPER('&DG_NAME')
                    )
    connect by prior rindex = pindex;
    - will there be error if I mount this diskgroup back to node 2 before I can drop it, (may be not in sync since the diskgroup is dismounted from 2 nodes at different times)?
    Does not matter which time or order that diskgroup was dismounted. It's mandatory the diskgroup be mounted in only one Instance before DROP.

    Regards,
    Levi Pereira
  • 6. Re: what is the correct procedure to drop asm diskgroup is rac?
    863526 Newbie
    Currently Being Moderated
    Hi Levi,

    since the diskgroup contains FRA, there is no datafile. so I just want to make sure.
    If I dismount disks on 2 nodes are different times, will I be able to mount it back without error?

    thanks very much again

    andrew
  • 7. Re: what is the correct procedure to drop asm diskgroup is rac?
    Levi-Pereira Guru
    Currently Being Moderated
    Hi,
    860523 wrote:
    Hi Levi,

    since the diskgroup contains FRA, there is no datafile. so I just want to make sure.
    If I dismount disks on 2 nodes are different times, will I be able to mount it back without error?
    Of course yes.

    The same happens when you shutdown one node (or both). You can mount without problem.

    Levi Pereira

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points