How to drop and recreate ASM diskgroup

Source: Internet
Author: User

 

 

This article describe how we can drop and recreate ASM diskgroup when its not possible to perform this through SQL command.

When a member disk in external redundancy diskgroup is no longer present (or destroyed beyond repair) and you want to drop the diskgroup completely and recreate it or add the disks of the diskgroup to other diskgroups. the diskgroup can not be mounted, because one of the disks is missing, hence the "Drop diskgroup" command will not work.

In 10g you can use a workaround by erasing the header of the disk using the DD command.

In 11g, the diskgroup can be dropped when its dismounted with force option:

Oracle Database storage Administrator's Guide-11g Release 1 (11.1)
Administering ASM disk groups
Dropping disk groups
Http://download.oracle.com/docs/cd/B28359_01/server.111/b31107/asmdiskgrps.htm#i1020539


Erasing the header using "DD" command is very dangerous operation and need to be done under support supervision and when it confirmed by support that fixing the header is impossible.

In all cases and before the erasing operation you shoshould gather the following information:

1. Alert. log file from all ASM instances going back to last successful mount for diskgroup.
2. OS logs.
3. backup disk header for all member disks in diskgroup:

dd if=/dev/raw/raw13 of=/tmp/raw13.txt bs=1048576 count=100

 

Solution

1. Erase ASM metadata information for disk using OS command:

!!! You have to be careful when typing disk name !!!

For UNIX platforms using 'dd' Unix Command.
========================================

Example:

dd if=/dev/zero of=/dev/raw/raw13 bs=1048576 count=50

 

The dd utility copies the specified input file to the specified output.

Description for used options:

'if=file'
    Read from file/device.
'of=file'
    Write to file/device.
'bs=bytes'
    Set both input and output block sizes to bytes.
'count=blocks'
    Copy blocks 'ibs'-byte blocks from the input file


This puts zeroes to the first 50 MB of Disk/dev/raw/raw13, erasing all information.

For MS Windows platforms using 'asmtool' (command line) or 'asmtoolg' (GUI)
========================================================== ================================

Example:

C:/>asmtool -delete //./ORCLDISKASM7


2. Connect to ASM instance to check the current disk status:

SQL> select header_status,path from v$asm_disk;


You shoshould see the header_status for the cleared disks as "candidate" which means that disk's metadata erased and it can be used again.

select GROUP_NUMBER,NAME,HEADER_STATUS,TOTAL_MB,FREE_MB from V$ASM_DISK;

GROUP_NUMBER NAME                           HEADER_STATU   TOTAL_MB    FREE_MB
------------ ------------------------------ ------------ ---------- ----------
           0                                CANDIDATE         10000          0
           1 DATA_0000                      MEMBER            10000       9933
           1 DATA_0003                      MEMBER            10000       9933


If you dropped all diskgroup member disks, you shoshould not see the diskgroup any more because all its member disks were cleared.

SQL> select name,STATE from v$asm_diskgroup;


3. Now, you can use the erased disk (s) to create a new disk group or add the disk to existing diskgroup.

 

 

 

 

From Oracle

Bytes -------------------------------------------------------------------------------------------------------

Blog: http://blog.csdn.net/tianlesoftware

Email: dvd.dba@gmail.com

Dba1 group: 62697716 (full); dba2 group: 62697977 (full) dba3 group: 62697850 (full)

Super DBA group: 63306533 (full); dba4 group: 83829929 dba5 group: 142216823

Chat group: 40132017 chat 2 group: 69087192

-- Add the group to describe the relationship between Oracle tablespace and data files in the remarks section. Otherwise, the application is rejected.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.