`

Creating a New ASM Disk Header After Existing One Is Corrupted

 
阅读更多

Doc ID:

Note:417687.1

Type:

BULLETIN

Last Revision Date:

12-FEB-2008

Status:

PUBLISHED

In this Document
Purpose
Scope and Application
***INTERNAL ONLY*** Creating a New ASM Disk Header After Existing One IsCorrupted


@ Oracle Confidential (INTERNAL). Do not distribute tocustomers
@ Reason: This hasthe potential to permanantly destroy a diskgroup if not done right.

@ (AuthWiz 2.5.3)
@Clickheretoeditinwizard.

Applies to:

OracleServer – Enterprise Edition – Version: 10.2.0.2 to 10.2.0.4
Information in this document applies to any platform.
10.2 ASM External Redundancy Diskgroup

Purpose

Thepurpose of this bulletin is to provide steps to create a new ASM disk header ifthe existing one is corrupt.

Scope andApplication

Thisdocumented is INTERNAL ONLY and is intended for individuals with extensive ASMexperience and source code access. This document should only be used as aLAST RESORT if a diskgroup with external redundancy cannot mount due to acorrupt header. It isa much betteroptionto re-createthe diskgroup and restore the data via RMAN. This note should only beused if there are extreme circumstances where it would be nearly impossible torestore (corrupt backup or several TB database). It should also be notedthat this note only addresses the first 4k of the disk (the header) and ifthere are problems with the data itself this note cannot fix or address that.

***INTERNALONLY*** Creating a New ASM Disk Header After Existing One Is Corrupted

Makesure you have the correct kfed version in place:

-If you are on 10.2.0.2, apply the patch forBug 5039964.
- If you are on 10.2.0.3 or above, continue on…

For this test we have 3 ASM disks in an external redundancy diskgroup. For the
test we will wipe out the header for ASM disk 3 (data03): 

/ocfs02/asm/data01
/ocfs02/asm/data02
/ocfs02/asm/data03

1.Make sure all ASM instances are shut down.


2.Make a backup of the first 4k of the bad disk with dd:

dd if=<bad disk> of=<file> bs=4096 count=1


3.Check existing disks and see which one has “file 1 block 1″:

Tofindthe disk with f1b1run:

kfedread <device name> | grep f1b1

Example:
$ kfed read /ocfs02/asm/data01 | grep f1b1
kfdhdb.f1b1locn: 2 ; 0x0d4: 0x00000002
$ kfed read /ocfs02/asm/data02 | grep f1b1 

kfdhdb.f1b1locn: 0 ; 0x0d4: 0x00000000

Sincedata01, has a non-zero value, data01 is the disk with “file 1 block 1″. Confirmthis by checking the following to see if you see “KFBTYP_LISTHEAD” in the 2ndallocation unit:

kfedread <device name> aunum=2 | grep kfbh.type

Also specify the ausize with AUSZ=# if using a non default allocationunit size.

Example:
$ kfed read /ocfs02/asm/data01 aunum=2 | grep kfbh.type
kfbh.type: 5 ; 0x002: KFBTYP_LISTHEAD

If the lost disk is the “file 1block 1″ disk then scan every AU of the bad disk tillyou find a header which claims to be FILE_DIRECTORY (KFBTYP_FILEDIR). Once youfind that you can set f1b1locn to that AU number and continue… If the file directory cannot be found anywhere then we haveno choice but to re-create the diskgroup and restore from a backup.


4.Make a copy of a good disk header with kfed that IS NOT the disk that containsf1b1 and is in the SAME diskgroup as the bad disk. In our example this isdata02:

kfedread <device name> > fix.txt

Example:
$ kfed read /ocfs02/asm/data02 > fix.txt


5.Edit the fix.txt and change the following fields to the proper values (use theASM alert log for reference):

kfdhdb.dsknum
kfdhdb.dskname
kfdhdb.fgname

Example:
Check the alert log for proper names: 

NOTE: cache opening disk 0 of grp 1: DATA_0000 path:/ocfs02/asm/data01

NOTE: cache opening disk 1 of grp 1: DATA_0001 path:/ocfs02/asm/data02
NOTE: cache opening disk 2 of grp 1: DATA_0002 path:/ocfs02/asm/data03
Old values from fix.txt:
kfdhdb.dsknum: 1 ; 0x024: 0x0001
kfdhdb.grptyp: 1 ; 0x026: KFDGTP_EXTERNAL
kfdhdb.hdrsts: 3 ; 0x027:
KFDHDR_MEMBER 

kfdhdb.dskname: DATA_0001 ; 0x028: length=9
kfdhdb.grpname: DATA ; 0x048: length=4
kfdhdb.fgname: DATA_0001 ; 0x068: length=9
New values from fix.txt:

kfdhdb.dsknum: 2 ; 0x024: 0x0002
kfdhdb.grptyp: 1 ; 0x026: KFDGTP_EXTERNAL

kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER 

kfdhdb.dskname: DATA_0002 ; 0x028: length=9
kfdhdb.grpname: DATA ; 0x048: length=4
kfdhdb.fgname: DATA_0002 ; 0x068: length=9


6.Find the disk directory by dumping aunum=2 and blknum=2 for the disk with f1b1:

kfedread<device name>aunum=2 blknum=2 | more

Example:

$ kfed read /ocfs02/asm/data01 aunum=2 blknum=2 | more
kfffde[0].xptr.au: 2 ; 0x4a0: 0x00000002
kfffde[0].xptr.disk: 2 ; 0x4a4:
0x0002
kfffde[0].xptr.flags: 0 ; 0x4a6: L=0 E=0 D=0 S=0
kfffde[0].xptr.chk: 42 ; 0x4a7: 0x2a
kfffde[1].xptr.au: 4294967295
; 0x4a8: 0xffffffff
kfffde[1].xptr.disk: 65535 ; 0x4ac: 0xffff
kfffde[1].xptr.flags: 0 ; 0x4ae: L=0 E=0 D=0 S=0
kfffde[1].xptr.chk: 42 ; 0x4af: 0x2a
After the initial file directory header, you will see the extent map. If the diskgroup is external redundancy
then each entry refers to an extent of the file. For normal redundancy, every pair is a extent set, similarly
for high redundancy
[012] form the extent set. Here we see the disk directory is at au = 2 in disk number = 2. In this example, it
turned out to be in that location on the second AU, but it is not guaranteed that it will always be there.


7.Once the disk directory location is found, find the info for your disk number.

kfedread <device name> aunum=2 blknum=0 | more

Example:

kfed read /ocfs02/asm/data02 aunum=2 blknum=0 | more
kfbh.type: 6 ; 0x002: KFBTYP_DISKDIR
...
kfddde[0].entry.incarn: 1 ;
0x024: A=1 NUMM=0x0
...

kfddde[2].dsknum: 2 ; 0x3b4: 0x0002
kfddde[2].state: 2 ; 0x3b6: KFDSTA_NORMAL
kfddde[2].ub1spare:
0 ; 0x3b7: 0x00
kfddde[2].dskname: DATA_0002 ; 0x3b8: length=9
kfddde[2].fgname: DATA_0002 ; 0x3d8: length=9
kfddde[2].crestmp.hi: 32885842 ; 0x3f8: HOUR=0x12 DAYS=0x2 MNTH=0x3 YEAR=0x7d7
kfddde[2].crestmp.lo: 3860343808 ; 0x3fc: USEC=0x0 MSEC=0x20b SECS=0x21 MINS=0x39
kfddde[2].failstmp.hi: 0 ; 0x400: HOUR=0x0 DAYS=0x0 MNTH=0x0 YEAR=0x0
kfddde[2].failstmp.lo: 0 ; 0x404: USEC=0x0 MSEC=0x0 SECS=0x0 MINS=0x0

Variouskfddde refer to the disk directory entries. Only entries with entry.incarnnumbers should A=1 are allocated entries. You might find entries with dsknamepopulated, but if A=0 then it means that entry was
deleted.


8.Now go back to fix.txt and adjust the crestmp.hi and crestmp.lo to match whatthe disk directory shows. If it is already the same then leave it.

Example:

Before: 

kfdhdb.crestmp.hi: 32879468 ; 0x0a8: HOUR=0xc DAYS=0x1b MNTH=0xc YEAR=0x7d6
kfdhdb.crestmp.lo:
296378368 ; 0x0ac: USEC=0x0 MSEC=0x298 SECS=0x1a MINS=0x4
kfdhdb.mntstmp.hi: 32879468 ; 0x0b0: HOUR=0xc DAYS=0x1b MNTH=0xc YEAR=0x7d6
kfdhdb.mntstmp.lo: 309633024 ; 0x0b4: USEC=0x0 MSEC=0x128 SECS=0x27 MINS=0x4
After: 

kfdhdb.crestmp.hi: 32885842 ; 0x0a8: HOUR=0x12 DAYS=0x2 MNTH=0x3 YEAR=0x7d7
kfdhdb.crestmp.lo: 3860343808 ; 0x0ac: USEC=0x0 MSEC=0x20b SECS=0x21 MINS=0x39 

kfdhdb.mntstmp.hi: 32885842 ; 0x0b0: HOUR=0x12 DAYS=0x2 MNTH=0x3 YEAR=0x7d7 

kfdhdb.mntstmp.lo: 3870944256 ; 0x0b4: USEC=0x0 MSEC=0x27b SECS=0x2b MINS=0x39


9.Do a kfed merge to put the new header into the disk using fix.txt:

kfedmerge <device name> text=fix.txt

Example:

kfed merge /ocfs02/asm/data03 text=fix.txt

If you are using ASMLIB, at this point you will need to run thefollowing to fix the ASMLIB portion of the header:

/etc/init.d/oracleasmforce-renamedisk /dev/sdbg1 <ASMLIB Disk Name>
/etc/init.d/oracleasm scandisks
/etc/init.d/oracleasm listdisks


10.Startup nomount the ASM instance:

SQL> startup nomount;


11.Check v$asm_disk.header_status to verify that the disk header is in a “MEMBER”state.

Example:

SQL> select path, header_status from v$asm_disk where path like '%data03%'; 

PATH 

-------------------------------------------------------------------------------- 

HEADER_STATU
------------
/ocfs02/asm/data03
MEMBER


12.Mount the diskgroup.

alter diskgroup <diskgroup name> mount;

Ifthe diskgroup fails to mount at this point, you may want to either considerre-creating the diskgroup and restoring or engaging BDE to assist. Youmay also want to try clearing the first 4k of the disk with dd then do a kfedmerge again in case there are any extra characters causing problems (MAKE SUREYOU HAVE A BACKUP OF THE FIRST 4K FIRST):

Example:

ddif=<device name> of=<backup file> bs=4096 count=1
dd if=/dev/zero of=<device name> bs=4096 count=1

-------------------------------------------------------------------------------------------------------

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

Weibo: http://weibo.com/tianlesoftware

Email: dvd.dba@gmail.com

DBA1 群:62697716(满); DBA2 群:62697977(满)DBA3 群:62697850(满)

DBA 超级群:63306533(满); DBA4 群:83829929(满) DBA5群: 142216823(满)

DBA6 群:158654907(满) DBA7 群:69087192(满)DBA8 群:172855474

DBA 超级群2:151508914 DBA9群:102954821 聊天 群:40132017(满)

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请

分享到:
评论

相关推荐

    IZO-063-2020版本.docx

    when one of the disks in a disk group is accidentally unplugged D. when one or more file directory paths are accidentally deleted from an ASM disk group E. when all the ASM disk groups for the ASM ...

    Oracle asm 性能监控工具

    DiskPath - Path to ASM disk DiskName - ASM disk name Gr - ASM disk group number Dsk - ASM disk number Reads - Reads Writes - Writes AvRdTm - Average read time (in msec) AvWrTm - Average ...

    ASM实例+ASM数据库安装(Win8+Ora10)

    ASM实例+ASM数据库安装(Win8+Ora10) 1 第一篇 创建未格式化的磁盘分区 1 1.1 打开压缩卷窗口 1 1.2 输入卷大小 3 1.3 选择挂载目录 4 1.4 格式化分区选项 5 1.5汇总信息 6 1.6分区完成后磁盘情况 7 1.7挂载目录...

    AASM远程升级软件资料.rar

    AASM远程升级软件资料,内部包含配药柜的软件开发文件,有远程升级方案研究报告,程序架构,功能手册,用户使用手册,与下位机通讯协议等资料

    oracle asm学习资料

    storage management and provisioning for the ...management to be done using familiar create/alter/drop SQL statements, DBAs do not need to learn a new skill set or make crucial decisions on provisioning.

    asm.jar各个版本

    asm-1.3.3.jar, asm-1.3.4.jar, asm-1.3.5.jar, asm-1.4.1.jar, asm-1.4.2.jar, asm-1.4.3.jar, asm-1.4.jar, asm-1.5.1.jar, asm-1.5.2.jar, asm-1.5.3.jar, asm-2.0.jar, asm-2.1.jar, asm-2.2.1-sources.jar, asm...

    IS868LA固晶机

    IS868LA2是ASM做手机传感器最好的固晶机

    cpu_a.asm

    cpu_a.asm

    汇编工具ASM汇编工具ASM汇编工具ASM汇编工具ASM

    汇编工具ASM汇编工具ASM汇编工具ASM汇编工具ASM汇编工具ASM

    中国人写的ASM、AAM

    中国人写的ASM、AAM,包括最新的一些改进算法,代码规范,值得学习

    Oracle 10.2 ASM 最佳实践 最终版本

    Oracle 10.2 ASM 最佳实践 ASM installation ASM SGA and parameter sizing ASM and privileges ASMLIB Disks ASM and Multipathing DiskGroups Diskgroups and databases ASM redundancy and Failure Groups New ...

    各种oracleasm rpm包(Linux下配置ASM使用)

    包含如下oracleasm包: kmod-oracleasm-2.0.6.rh1-3.el6.x86_64.rpm oracleasm-2.0.8-4.el6_6.src.rpm oracleasm-2.0.8-6.el6_7.src.rpm oracleasm-2.0.8-8.el7.src.rpm oracleasm-2.0.8-15.el7.centos.src.rpm ...

    AASM睡眠分期规则.ppt

    AASM睡眠分期规则AASM睡眠分期规则AASM睡眠分期规则AASM睡眠分期规则AASM睡眠分期规则AASM睡眠分期规则AASM睡眠分期规则AASM睡眠分期规则

    EditPlus(附asm.acp,asm.stx)

    EditPlus是很好用的编辑软件 但网上下的很多EP版本需要自己添加asm.acp,asm.stx,不是很方便 这个里面附带了asm.acp,asm.stx

    开发工具 asm-5.1

    开发工具 asm-5.1开发工具 asm-5.1开发工具 asm-5.1开发工具 asm-5.1开发工具 asm-5.1开发工具 asm-5.1开发工具 asm-5.1开发工具 asm-5.1开发工具 asm-5.1开发工具 asm-5.1开发工具 asm-5.1开发工具 asm-5.1开发工具...

    ASM4使用指南 ASM GUIDE

    ASM4使用指南 ASM GUIDE

    a314.asm

    a314.asm

    A82591.asm

    A82591.asm

    asm5.0.jar

    2013-08-12 14:33:37.672:WARN::Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in URL [file:/E:/cloudwave-core/src/main/...

    ASM1061原理图

    ASM1061 原理图 PCIE转2 port Sata芯片 ASM1061 原理图 PCIE转2 port Sata芯片

Global site tag (gtag.js) - Google Analytics