Method of backup and recovery of ASM DISK HEADER in Oracle

Source: Internet
Author: User
Tags reserved valid

Recently encountered a number of ASM data header problems caused disk GROUP can not be normal mount, the database is not working properly, has brought endless trouble, this time thinking, if I did the ASM data header backup How good ah, unfortunately there is no regret medicine, We recommend that you check your own ASM library, ASM HEADER has done a backup, if not please handle it in time. Here the test provides DD and kfed backup and restore ASM headers
Query ASM Related Information

The code is as follows Copy Code
Sql> select Group_number,name,state,total_mb,free_mb from V$asm_diskgroup;





Group_number NAME State TOTAL_MB FREE_MB


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


1 DATA Mounted 2046 1314


2 Xifenfei mounted 6141 4378





Sql> select Group_number,disk_number,path,state from V$asm_disk;





Group_number Disk_number PATH State


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


1 1/dev/oracleasm/disks/vol2 NORMAL


1 0/dev/oracleasm/disks/vol1 NORMAL


2 1/dev/oracleasm/disks/vol4 NORMAL


2 0/dev/oracleasm/disks/vol3 NORMAL


Find the ASM disk corresponding to the partition

The code is as follows Copy Code
[Grid@rac1 ~]$/etc/init.d/oracleasm querydisk-d VOL1


Disk "VOL1" is a valid ASM disk on device [8,33]


[Grid@rac1 ~]$ Ll/dev |grep 8|grep 33


Brw-r-----1 Root disk 8, APR 11:37 SDC1


[Grid@rac1 ~]$/etc/init.d/oracleasm querydisk-d VOL2


Disk "VOL2" is a valid ASM disk on device [8,34]


[Grid@rac1 ~]$ Ll/dev |grep 8|grep 34


Brw-r-----1 Root disk 8, APR 11:37 SDC2


[Grid@rac1 ~]$/etc/init.d/oracleasm querydisk-d VOL3


Disk "VOL3" is a valid ASM disk on device [8,17]


[Grid@rac1 ~]$ ll/dev |grep 8,|grep 17


Brw-r-----1 Root disk 8, APR 11:37 SDB1


[Grid@rac1 ~]$/etc/init.d/oracleasm querydisk-d VOL4


Disk "VOL4" is a valid ASM disk on device [8,18]


[Grid@rac1 ~]$ Ll/dev |grep 8,|grep 18


Brw-r-----1 Root disk 8, APR 11:37 SDB2


Back Up ASM header information (Backup Xifenfei disk group)

The code is as follows Copy Code
--DD Mode Backup


[Root@rac1 backup_asmheader]# dd if=/dev/sdb1 of=vol3header.dd bs=4096 count=1


1+0 Records in


1+0 Records out


4096 bytes (4.1 kB) copied, 0.000143581 seconds, 28.5 MB/s


[Root@rac1 backup_asmheader]# dd if=/dev/sdb2 of=vol4header.dd bs=4096 count=1


1+0 Records in


1+0 Records out


4096 bytes (4.1 kB) copied, 0.000147727 seconds, 27.7 MB/s





--kfed Mode Backup


[Grid@rac1 backup_asmheader]$ kfed read/dev/oracleasm/disks/vol3 text=vol3header.txt


[Grid@rac1 backup_asmheader]$ more Vol3header.txt


Kfbh.endian:1; 0x000:0x01


kfbh.hard:130; 0x001:0x82


Kfbh.type:1; 0x002:kfbtyp_diskhead


Kfbh.datfmt:1; 0x003:0x01


kfbh.block.blk:0; 0x004:blk=0


kfbh.block.obj:2147483648; 0x008:disk=0


kfbh.check:198826195; 0x00c:0x0bd9d8d3


kfbh.fcn.base:0; 0x010:0x00000000


kfbh.fcn.wrap:0; 0x014:0x00000000


kfbh.spare1:0; 0x018:0x00000000


kfbh.spare2:0; 0x01c:0x00000000


kfdhdb.driver.provstr:ORCLDISKVOL3; 0x000:length=12


Kfdhdb.driver.reserved[0]: 860639062; 0x008:0x334c4f56


KFDHDB.DRIVER.RESERVED[1]: 0; 0x00c:0x00000000


KFDHDB.DRIVER.RESERVED[2]: 0; 0x010:0x00000000


KFDHDB.DRIVER.RESERVED[3]: 0; 0x014:0x00000000


KFDHDB.DRIVER.RESERVED[4]: 0; 0x018:0x00000000


KFDHDB.DRIVER.RESERVED[5]: 0; 0x01c:0x00000000


kfdhdb.compat:186646528; 0x020:0x0b200000


kfdhdb.dsknum:0; 0x024:0x0000


Kfdhdb.grptyp:1; 0x026:kfdgtp_external


Kfdhdb.hdrsts:3; 0x027:kfdhdr_member


kfdhdb.dskname:XIFENFEI_0000; 0x028:length=13


Kfdhdb.grpname:XIFENFEI; 0x048:length=8


kfdhdb.fgname:XIFENFEI_0000; 0x068:length=13


Kfdhdb.capname:; 0x088:length=0


kfdhdb.crestmp.hi:32967790; 0x0a8:hour=0xe days=0x3 mnth=0x3 YEAR=0X7DC


kfdhdb.crestmp.lo:2015933440; 0x0ac:usec=0x0 msec=0x22d secs=0x2 mins=0x1e


kfdhdb.mntstmp.hi:32969259; 0X0B0:HOUR=0XB days=0x11 mnth=0x4 YEAR=0X7DC


kfdhdb.mntstmp.lo:2707277824; 0x0b4:usec=0x0 msec=0x372 secs=0x15 mins=0x28


kfdhdb.secsize:512; 0x0b8:0x0200


kfdhdb.blksize:4096; 0x0ba:0x1000


kfdhdb.ausize:1048576; 0x0bc:0x00100000


kfdhdb.mfact:113792; 0x0c0:0x0001bc80


kfdhdb.dsksize:2353; 0x0c4:0x00000931


Kfdhdb.pmcnt:2; 0x0c8:0x00000002


Kfdhdb.fstlocn:1; 0x0cc:0x00000001


Kfdhdb.altlocn:2; 0x0d0:0x00000002


Kfdhdb.f1b1locn:2; 0x0d4:0x00000002


Kfdhdb.redomirrors[0]: 0; 0x0d8:0x0000


KFDHDB.REDOMIRRORS[1]: 0; 0x0da:0x0000


KFDHDB.REDOMIRRORS[2]: 0; 0x0dc:0x0000


KFDHDB.REDOMIRRORS[3]: 0; 0x0de:0x0000


kfdhdb.dbcompat:168820736; 0x0e0:0x0a100000


kfdhdb.grpstmp.hi:32967790; 0x0e4:hour=0xe days=0x3 mnth=0x3 YEAR=0X7DC


kfdhdb.grpstmp.lo:2015746048; 0x0e8:usec=0x0 msec=0x176 secs=0x2 mins=0x1e


kfdhdb.vfstart:0; 0x0ec:0x00000000


kfdhdb.vfend:0; 0x0f0:0x00000000


kfdhdb.spfile:0; 0x0f4:0x00000000


kfdhdb.spfflg:0; 0x0f8:0x00000000


Kfdhdb.ub4spare[0]: 0; 0x0fc:0x00000000


KFDHDB.UB4SPARE[1]: 0; 0x100:0x00000000


KFDHDB.UB4SPARE[2]: 0; 0x104:0x00000000


KFDHDB.UB4SPARE[3]: 0; 0x108:0x00000000


KFDHDB.UB4SPARE[4]: 0; 0x10c:0x00000000


KFDHDB.UB4SPARE[5]: 0; 0x110:0x00000000


KFDHDB.UB4SPARE[6]: 0; 0x114:0x00000000


KFDHDB.UB4SPARE[7]: 0; 0x118:0x00000000


KFDHDB.UB4SPARE[8]: 0; 0x11c:0x00000000


KFDHDB.UB4SPARE[9]: 0; 0x120:0x00000000


KFDHDB.UB4SPARE[10]: 0; 0x124:0x00000000


KFDHDB.UB4SPARE[11]: 0; 0x128:0x00000000


KFDHDB.UB4SPARE[12]: 0; 0x12c:0x00000000


KFDHDB.UB4SPARE[13]: 0; 0x130:0x00000000


KFDHDB.UB4SPARE[14]: 0; 0x134:0x00000000


KFDHDB.UB4SPARE[15]: 0; 0x138:0x00000000


KFDHDB.UB4SPARE[16]: 0; 0x13c:0x00000000


KFDHDB.UB4SPARE[17]: 0; 0x140:0x00000000


KFDHDB.UB4SPARE[18]: 0; 0x144:0x00000000


KFDHDB.UB4SPARE[19]: 0; 0x148:0x00000000


KFDHDB.UB4SPARE[20]: 0; 0x14c:0x00000000


KFDHDB.UB4SPARE[21]: 0; 0x150:0x00000000


KFDHDB.UB4SPARE[22]: 0; 0x154:0x00000000


KFDHDB.UB4SPARE[23]: 0; 0x158:0x00000000


KFDHDB.UB4SPARE[24]: 0; 0x15c:0x00000000


KFDHDB.UB4SPARE[25]: 0; 0x160:0x00000000


KFDHDB.UB4SPARE[26]: 0; 0x164:0x00000000


KFDHDB.UB4SPARE[27]: 0; 0x168:0x00000000


KFDHDB.UB4SPARE[28]: 0; 0x16c:0x00000000


KFDHDB.UB4SPARE[29]: 0; 0x170:0x00000000


KFDHDB.UB4SPARE[30]: 0; 0x174:0x00000000


KFDHDB.UB4SPARE[31]: 0; 0x178:0x00000000


KFDHDB.UB4SPARE[32]: 0; 0x17c:0x00000000


KFDHDB.UB4SPARE[33]: 0; 0x180:0x00000000


KFDHDB.UB4SPARE[34]: 0; 0x184:0x00000000


KFDHDB.UB4SPARE[35]: 0; 0x188:0x00000000


KFDHDB.UB4SPARE[36]: 0; 0x18c:0x00000000


KFDHDB.UB4SPARE[37]: 0; 0x190:0x00000000


KFDHDB.UB4SPARE[38]: 0; 0x194:0x00000000


KFDHDB.UB4SPARE[39]: 0; 0x198:0x00000000


KFDHDB.UB4SPARE[40]: 0; 0x19c:0x00000000


KFDHDB.UB4SPARE[41]: 0; 0x1a0:0x00000000


KFDHDB.UB4SPARE[42]: 0; 0x1a4:0x00000000


KFDHDB.UB4SPARE[43]: 0; 0x1a8:0x00000000


KFDHDB.UB4SPARE[44]: 0; 0x1ac:0x00000000


KFDHDB.UB4SPARE[45]: 0; 0x1b0:0x00000000


KFDHDB.UB4SPARE[46]: 0; 0x1b4:0x00000000


KFDHDB.UB4SPARE[47]: 0; 0x1b8:0x00000000


KFDHDB.UB4SPARE[48]: 0; 0x1bc:0x00000000


KFDHDB.UB4SPARE[49]: 0; 0x1c0:0x00000000


KFDHDB.UB4SPARE[50]: 0; 0x1c4:0x00000000


KFDHDB.UB4SPARE[51]: 0; 0x1c8:0x00000000


KFDHDB.UB4SPARE[52]: 0; 0x1cc:0x00000000


KFDHDB.UB4SPARE[53]: 0; 0x1d0:0x00000000


kfdhdb.acdb.aba.seq:0; 0x1d4:0x00000000


kfdhdb.acdb.aba.blk:0; 0x1d8:0x00000000


kfdhdb.acdb.ents:0; 0x1dc:0x0000


kfdhdb.acdb.ub2spare:0; 0x1de:0x0000


[Grid@rac1 backup_asmheader]$ kfed read/dev/oracleasm/disks/vol4 text=vol4header.txt


Destroy VOL3 ASM Disk

The code is as follows Copy Code
[Root@rac1 backup_asmheader]# dd If=/dev/zero of=/dev/sdb1 bs=4096 count=1


1+0 Records in


1+0 Records out


4096 bytes (4.1 kB) copied, 0.00165264 seconds, 2.5 MB/s





[Grid@rac1 backup_asmheader]$ kfed read/dev/oracleasm/disks/vol3


kfbh.endian:0; 0x000:0x00


kfbh.hard:0; 0x001:0x00


kfbh.type:0; 0x002:kfbtyp_invalid


kfbh.datfmt:0; 0x003:0x00


kfbh.block.blk:0; 0x004:blk=0


kfbh.block.obj:0; 0x008:file=0


kfbh.check:0; 0x00c:0x00000000


kfbh.fcn.base:0; 0x010:0x00000000


kfbh.fcn.wrap:0; 0x014:0x00000000


kfbh.spare1:0; 0x018:0x00000000


kfbh.spare2:0; 0x01c:0x00000000


B4bfe200 00000000 00000000 00000000 00000000 [...]......


Repeat 255 Times


Kfed-00322:invalid content encountered during block traversal: [kfbttraverseblock][invalid OSM block type][][0]


Start ASM

The code is as follows Copy Code
[Grid@rac1 backup_asmheader]$ Sqlplus/as Sysoper

Sql*plus:release 11.2.0.3.0 Production on Tue Apr 17 12:29:42 2012

Copyright (c) 1982, Oracle. All rights reserved.

Connected to a idle instance.

Sql> Startup
ASM instance started
Ora-15032:not all alterations performed
Ora-15017:diskgroup "Xifenfei" cannot be mounted
Ora-15063:asm discovered a insufficient number of disks for DiskGroup
"Xifenfei"

Restore ASM DATE HEADER

  code is as follows copy code
--dd recovery
[ ROOT@RAC1 backup_asmheader]# dd if=vol3header.dd of=/dev/sdb1 bs=4096 count=1
1+0 Records in
1+0 records out
4 096 bytes (4.1 kB) copied, 0.00197913 seconds, 2.1 mb/s
 
--kfed restore
[Grid@rac1 backup_asmheader]$, kfed me Rge/dev/oracleasm/disks/vol3 text=vol3header.txt
Mount DiskGroup
sql> alter DiskGroup Mount;
& nbsp
DiskGroup altered.
Related Article

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.