ITPub博客

首页 > Linux操作系统 > Linux操作系统 > How To Drop and Recreate ASM Diskgroup [ID 563048.1]

How To Drop and Recreate ASM Diskgroup [ID 563048.1]

原创 Linux操作系统 作者:spider0283 时间:2011-08-23 08:38:07 0 删除 编辑
  修改时间 27-FEB-2011     类型 HOWTO     状态 PUBLISHED  

In this Document
  Goal
  Solution
  References


Applies to:

Oracle Server - Enterprise Edition - Version: 10.2.0.2 to 11.1.0.7 - Release: 10.2 to 11.1
Oracle Server - Standard Edition - Version: 10.2.0.2 to 11.1.0.7   [Release: 10.2 to 11.1]
Information in this document applies to any platform.
***Checked for relevance on 27-Feb-2011***

Goal

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 should 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 should 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 should 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.

References

http://download.oracle.com/docs/cd/B19306_01/install.102/b14207/storage.htm#CDEIEBBB

显示相关信息 相关的


产品
  • Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition
  • Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Standard Edition
关键字
DISKGROUP; ASM; DROP DISKGROUP; CREATE DISKGROUP

返回页首返回页首

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/38267/viewspace-705591/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-03-29

  • 博文量
    194
  • 访问量
    627969