ADHU (ASM Disk Header Utility)-asm disk header backup and recovery tool in oracle

Source: Internet
Author: User
Tags reserved syslog zip oracle database sqlplus

Adhu (ASM Disk Header Utility) is one of the three major restoration artifacts of oracle asm, kfed, and amdu, which are not vigorously promoted by oracle (an internal tool ), with the enhancement of the kfed function and the improvement of the automatic backup function of asm disk headers, adhu oracle basically stops development support and can be used as a disk header protection tool of the asm version before 10.2.0.5.
Adhu preview
Utildhu encapsulated by shell can be used to call the adhu program for more user-friendly and automated operations. It contains three command parameters: install, check, and repair.
[Root @ xff1 tmp] # su-grid
Xff1:/home/grid> cd/tmp/adhu/
Xff1:/tmp/adhu> ls-l
Total 68
-Rwxr-xr-x 1 grid oinstall 18902 Nov 1 2008 adhu
-Rw-r -- 1 grid oinstall 1970 Nov 1 2008 README
-Rwxr-xr-x 1 grid oinstall 6964 Mar 21 utildhu
-Rw-r -- 1 root 12634 Mar 21 16:05 utildhu.zip
Xff1:/tmp/adhu>./utildhu
Usage: utildhu install/check/repair [device name]
 
$ Utildhu install
Will gather a list of member ASM disks and create
The backup directory./HeaderBackup
The./HeaderBackup directory will contain in
Backup header of every asm disk in this database
 
$ Utildhu check
Will run/tmp/adhu for every disk discovered
$ Utildhu install and will email recipients configured
In RECIPIENTS if there are errors in the disk header
 
It is wrongly ed that the user will enter valid RECIPIENT
Email addresses, and will place this utility in $ ORA_ASM_HOME
 
$ Utildhu repair <device name>
Will repair the device provided using the backup
Header blocks that have been copied previusly.
This does assume that you have backup header blocks
In./HeaderBackup
 
Sample crontab entry to run a check every 5 minutes
# Minute (0-59) Hour (0-23) Day of Month (1-31)
Month (1-12 or Jan-Dec) Day of Week (0-6 or Sun-Sat) Command
, 20, 25, 30, 35, 40, 45, 50, 55 ***** utildhu check
 
Please read the README for more information
Adhu install
Install is mainly used to generate the utildhu. config configuration file and perform the first backup of the asm disk header.
Xff1:/tmp/adhu>./utildhu install
Xff1:/tmp/adhu> ls-l
Total 64
-Rwxr-xr-x 1 grid oinstall 18902 Nov 1 2008 adhu
Drwxr-xr-x 2 grid oinstall 4096 Mar 21 HeaderBackup
-Rw-r -- 1 grid oinstall 1117 Mar 21 persistent-log.utildhu
-Rw-r -- 1 grid oinstall 1970 Nov 1 2008 README
-Rwxr-xr-x 1 grid oinstall 6964 Mar 21 utildhu
-Rw-r -- 1 grid oinstall 243 Mar 21 utildhu. config
-Rw-r -- 1 grid oinstall 710 Mar 21 utildhu. out
-Rw-r -- 1 root 12634 Mar 21 16:05 utildhu.zip
Xff1:/tmp/adhu> cd HeaderBackup/
Xff1:/tmp/adhu/HeaderBackup> ls-ltr
Total 12
-Rw-r -- 1 grid oinstall 4096 Mar 21 oradata1p1
-Rw-r -- 1 grid oinstall 4096 Mar 21 oradata2p1
-Rw-r -- 1 grid oinstall 4096 Mar 21 ocrvotep1
Xff1:/tmp/adhu/HeaderBackup> more ../utildhu. config
/Dev/mapper/oradata1p1
/Dev/mapper/oradata2p1
/Dev/mapper/ocrvotep1
Xff1:/tmp/adhu> more ../persistent-log.utildhu
Mon Mar 21 16:23:29 CST 2016
ASM Disk Header Check Utility Installed on
Devices configured are:
/Dev/mapper/oradata1p1
/Dev/mapper/oradata2p1
/Dev/mapper/ocrvotep1
ADHU:/dev/mapper/oradata1p1: Status 0x01 Mon Mar 21 16:23:29 2016
ADHU:/dev/mapper/oradata1p1: Diskgroup: DATA Disk: DATA_0000 #0
ADHU:/dev/mapper/oradata1p1: valid disk header found
ADHU:/dev/mapper/oradata1p1: backup block updated
 
### ADHU check run at Mon Mar 21 16:23:29 CST 2016 NO ERRORS FOUND
 
Xff1:/tmp/adhu> ls-l HeaderBackup/
Total 16
-Rw-r -- 1 grid oinstall 4096 Mar 21 ocrvotep1
-Rw-r -- 1 grid oinstall 4096 Mar 21 oradata1p1
-Rw-r -- 1 grid oinstall 4096 Mar 21 oradata1p1. Duplicate UPT
-Rw-r -- 1 grid oinstall 4096 Mar 21 oradata2p1
Adhu check
For normal asm disks, it is mainly used to generate a new backup of the disk header.
Xff1:/tmp/adhu> ls-l HeaderBackup/
Total 16
-Rw-r -- 1 grid oinstall 4096 Mar 21 ocrvotep1
-Rw-r -- 1 grid oinstall 4096 Mar 21 oradata1p1
-Rw-r -- 1 grid oinstall 4096 Mar 21 oradata1p1. Duplicate UPT
-Rw-r -- 1 grid oinstall 4096 Mar 21 oradata2p1
Xff1:/tmp/adhu>./utildhu check
Xff1:/tmp/adhu> ls-l HeaderBackup/
Total 16
-Rw-r -- 1 grid oinstall 4096 Mar 21 ocrvotep1
-Rw-r -- 1 grid oinstall 4096 Mar 21 oradata1p1
-Rw-r -- 1 grid oinstall 4096 Mar 21 oradata1p1. Duplicate UPT
-Rw-r -- 1 grid oinstall 4096 Mar 21 oradata2p1
Adhu repair
Repair mainly repairs the disk header. When the asm disk header is damaged, you can use this command to fix the disk header.
Xff1:/tmp/adhu> dd if =/dev/zero of =/dev/mapper/oradata1p1 bs = 4096 count = 1
1 + 0 records in
1 + 0 records out
4096 bytes (4.1 kB) copied, 0.000282838 s, 14.5 MB/s
Xff1:/tmp/adhu>./utildhu check
Xff1:/tmp/adhu> tail-f persistent-log.utildhu
 
### ADHU check run at Mon Mar 21 23:04:04 CST 2016 ERRORS FOUND
ADHU:/dev/mapper/oradata1p1: Status 0x08 Mon Mar 21 23:04:04 2016
ADHU:/dev/mapper/oradata1p1: Diskgroup: DATA Disk: DATA_0000 #0
ADHU:/dev/mapper/oradata1p1: snapshot UPT disk header encountered
ADHU:/dev/mapper/oradata1p1: valid backup block found
ADHU:/dev/mapper/oradata1p1: upt header not retried Red
 
Xff1:/tmp/adhu> kfed read/dev/mapper/oradata1p1
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; 0x10: 0x00000000
Kfbh. fcn. wrap: 0; 0x014: 0x00000000
Kfbh. spare1: 0; 0x018: 0x00000000
Kfbh. spare2: 0; 0x01c: 0x00000000
7F6BD9981400 00000000 00000000 00000000 00000000 [......]
Repeat 255 times
KFED-00322: Invalid content encountered during block traversal: [kfbtTraverseBlock] [Invalid OSM block type] [] [0]
 
Xff1:/tmp/adhu> sqlplus/as sysasm
 
SQL * Plus: Release 11.2.0.4.0 Production on Mon Mar 21 23:07:25 2016
 
Copyright (c) 1982,201 3, Oracle. All rights reserved.
 
 
Connected:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit Production
With the Real Application Clusters and Automatic Storage Management options
 
SQL> alter diskgroup data dismount;
Alter diskgroup data dismount
*
ERROR at line 1:
ORA-15032: not all alterations saved Med
ORA-15027: active use of diskgroup "DATA" precludes its dismount
 
 
SQL> alter diskgroup data mount;
Alter diskgroup data mount
*
ERROR at line 1:
ORA-15032: not all alterations saved Med
ORA-15017: diskgroup "DATA" cannot be mounted
ORA-15013: diskgroup "DATA" is already mounted.
 
 
SQL> alter diskgroup data dismount force;
 
Diskgroup altered.
 
SQL> alter diskgroup data mount;
Alter diskgroup data mount
*
ERROR at line 1:
ORA-15032: not all alterations saved Med
ORA-15017: diskgroup "DATA" cannot be mounted
ORA-15040: diskgroup is incomplete.
 
 
Xff1:/tmp/adhu>./utildhu repair/dev/mapper/oradata1p1
DEVICE/dev/mapper/oradata1p1 retries red AT Mon Mar 21 23:06:06 CST 2016
ADHU:/dev/mapper/oradata1p1: Status 0x04 Mon Mar 21 23:06:06 2016
ADHU:/dev/mapper/oradata1p1: Diskgroup: DATA Disk: DATA_0000 #0
ADHU:/dev/mapper/oradata1p1: snapshot UPT disk header encountered
ADHU:/dev/mapper/oradata1p1: valid backup block found
ADHU:/dev/mapper/oradata1p1: disk header retries Red
 
Xff1:/tmp/adhu> sqlplus/as sysasm
 
SQL * Plus: Release 11.2.0.4.0 Production on Mon Mar 21 23:08:48 2016
 
Copyright (c) 1982,201 3, Oracle. All rights reserved.
 
 
Connected:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit Production
With the Real Application Clusters and Automatic Storage Management options
 
SQL> alter diskgroup data mount;
 
Diskgroup altered.
Direct use of adhu
Adhu [-dir dirname] [-repair] [-quiet] [-readonly] [-syslog mask] devname
By default, adhu backs up the disk header as a backup file in the current directory. You can use the-dir option to specify the directory to store.
Use the-repair option when you need to use adhu to fix a corrupted asm disk header.
-The quiet option filters all normal output information. If the execution is successful, no output is printed.
-The readonly option enables the disk device in read-only mode, so that the backup block will not be written, and the backup file will be written whenever possible.
-The syslog option controls whether to write results to system logs and standard output.
Devname indicates the device file of the asm disk. The backup file in the asm header is based on the device name and stored in the current directory or the directory specified by-dir.

From: http://www.xifenfei.com/2016/04/adhu-asm-disk-header-utility.html

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.