Difference: ASM_utilities (1 vs. 15)

Revision 152015-06-23 - LucaCanali

Line: 1 to 1
 
META TOPICPARENT name="HAandPerf"
<!--  
Line: 173 to 173
 

BBED

BBED is an Oracle internal utility to do BLOCKEDIT. It is extensively discussed at http://www.orafaq.com/papers/dissassembling_the_data_block.pdf BBED doesn't work on ASM by default. A work-around has been studied by http://oracleprof.blogspot.com/2009/06/asm-and-bbed.html
Changed:
<
<
An example to get started (BTW make of bbed does not seem to work on 11gR2)
>
>
An example to get started can be found here below.
Note that bbed does not build out of the box on 11g and 12c, as there are a few files missing in the Oracle binaries distribution to properly build bbed. There is a simple workaround, that consists on copying the relevant files from 10g binaries before running make. More details at this blog entry by Laurent Leturgez http://laurent-leturgez.com/2011/06/29/bbed-in-oracle-11g/
 
cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed
Line: 181 to 183
 Dump an extent or an ASM file with the methods described above, for example: amdu -dis '/dev/mapper/itsto*p1' -extract TEST4_DATADG1.555
Changed:
<
<
Edit: vi bbed.par (or rather follow the explample in the ASMBBED link above)
>
>
Edit: vi bbed.par (or rather follow the example in the ASMBBED link above)
 blocksize=8192 datafile=/ORA/dbs01/oracle/home/work/amdu_2010_02_01_17_22_39/TEST2_DATADG1_555.f mode=browse

Revision 142014-11-20 - TWikiAdminUser

Line: 1 to 1
 
META TOPICPARENT name="HAandPerf"
<!--
Changed:
<
<
  • Set DENYTOPICVIEW =
>
>
 
  
-->

Revision 132014-05-29 - LucaCanali

Line: 1 to 1
 
META TOPICPARENT name="HAandPerf"
<!-- 
  • Set DENYTOPICVIEW =
Line: 89 to 89
 READ: kfed read /dev/mapper/itstor741_11p1 aunum=3 blknum=3 text=/tmp/a EDIT: vi /tmp/a and change attribute value (for example change smart_scan_enable from TRUE to FALSE to disable exadata smart scans in this particular diskgroup, note update length field too)
Changed:
<
<
WRITE PRMARY EXTENT: kfed write /dev/mapper/itstor741_11p1 aunum=3 blknum=3 text=/tmp/a WRITE SECODARY extents:
>
>
Example: 'cell.smart_scan_capable'='FALSE'; kfede[0].name: smart_scan_capable ; 0x034: length=18 kfede[0].value: FALSE ; 0x074: length=5 kfede[0].length: 5 ; 0x174: 0x0005

'cell.smart_scan_capable'='TRUE'; kfede[0].name: smart_scan_capable ; 0x034: length=18 kfede[0].value: TRUE ; 0x074: length=4 kfede[0].length: 4 ; 0x174: 0x0004

WRITE PRIMARY EXTENT: kfed write /dev/mapper/itstor741_11p1 aunum=3 blknum=3 text=/tmp/a WRITE SECONDARY extents:

  kfed write /dev/mapper/itstor739_10p1 aunum=3 blknum=3 text=/tmp/a kfed write /dev/mapper/itstor740_9p1 aunum=2 blknum=3 text=/tmp/a

SQL> (dismount) and mount the group again to see the chagen in v$asm_attribute

Added:
>
>
Note after changing the parameter you may need to explicitly turn smart scans off on the RDBMS alter system set cell_offload_processing=FALSE scope=both sid='*';

Example: how to undrop ASM diskgroup and/or recover files from dropped diskgroups
  • method 1: use amdu to recover the files: amdu -dis '/dev/mapper/devstor4_1p1' -former -extract RDTEST2_TESTDROP.256
  • method 2: use kfed to change the disk headers back to member
    kfed read /dev/mapper/devstor4_1p1 aunum=0 blknum=0 text=devstor4_1p1.txt
    
    vi devstor4_1p1.txt and change
    from:
    kfdhdb.hdrsts:                        4 ; 0x027: KFDHDR_FORMER
    to:
    kfdhdb.hdrsts:                        3 ; 0x027: KFDHDR_MEMBER
    
    kfed write /dev/mapper/devstor4_1p1 aunum=0 blknum=0 text=devstor4_1p1
      

Example: how to rename an ASM disk

  • In the case of ASM 12c, the procedure is:
    • alter diskgroup .. mount restricted
    • alter diskgropu rename disk '...' to 'new path';
  • This is an undocumented and unsupported procedure that can be used in 11g (at your own risk):
    1) Identify all the mirror extents of ASM file N.2 for the relevant diskgroup (i.e. the disk directory). Example:
    select disk_kffxp,au_kffxp, path from x$kffxp x,v$asm_disk_stat v
    where x.group_kffxp=2 and number_kffxp=2
          and x.group_kffxp=v.group_number and x. disk_kffxp=v.disk_number
    order by x.pxn_kffxp;
    2) dismount the diskgroup
    3) Read the first copy of the disk header and update it with the new disk name and length. Example:
    kfed read /dev/mapper/disk1name_p1 aunum=0 blknum=0 text=disk1name_p1_au0blk0
    make a backup copy of the file disk1name_p1_au0blk0
    vi disk1name_1p1_au0blk0
    update -> kfddde[0].dskname:              NEWNAME ; 0x038: length=7
    
    kfed write /dev/mapper/disk1name_p1 aunum=0 blknum=0 text=disk1name_1p1_au0blk0
    Note: it does not seem to be necessary to update the other copies of the disk header, ASM seems to take care of that when we will mount the diskgroup.
    
    4) Use kfed to read, modify and then write the new disk name in the relevant entry of the directory. 
    This is similar to point N.3 with the notable minor differences that: 
    - From step (1) above we know in which aunum and disk we will find the directory but not necessarily in which blknum. It's just a matter of trying blknum=0, then blknum=1, etc. It won't take long.
    - For diskgroups in normal or high redundancy it's advisable to update all the mirror copies.
    5) mount the diskgroup, monitor the ASM alert log and hope for the best :)
    6) Some tips to recover from errors: 
    - dismount the diskgroup
    - copy back the previous values of the modified blocks with using from the backup files
    - mount the diskgroup
    - the affected disks will probably be offline, online them back.
 
Added:
>
>
 

How to use KFED and AMDU in 10g

kfed and amdu are available by default in 11g in $ORACLE_HOME/bin. In 10g one needs
  • For kfed a link operation needs to be run:
Line: 129 to 192
 
Revisions:
First version, Jan 2010, Luca.Canali@cernNOSPAMPLEASE.ch
Added:
>
>

Additional examples for amdu and kfed, May 2014, Luca.Canali@cernNOSPAMPLEASE.ch
 
<!-- Put the Wiki contents here -->

Revision 122014-05-27 - LucaCanali

Line: 1 to 1
 
META TOPICPARENT name="HAandPerf"
<!-- 
  • Set DENYTOPICVIEW =
Line: 18 to 18
 
  • Allows to dump ASM contents without opening diskgroups, allows to check ASM file mirroring when using normal redundancy
  • powerful tool for troubleshooting, introduced in 11g, usable in 10g too.
Changed:
<
<
  • amdu run creates a directory with a report.tx file and the .map (and .img dump files (for metadata nad data, output dependson switches in the commandline )
>
>
  • amdu run creates a directory with a report.tx file, plus optionally the and the .map and .img dump files (for metadata and data, the actual output depends on the switches specified in the commandline )
 
  • a few examples of interest:
Line: 42 to 42
  $ amdu -dis '/dev/mapper/itsto*p1' -print TEST4_DATADG1.F267.X1.B1.C10
Changed:
<
<
Example: how to retrieve DB files from an unmounted diskgroup
>
>
Example: how to retrieve DB files from a dismounted diskgroup
 
  • extract file 256 from the data diskgroup as it often the first copy of controlfile
  • (or use a diskgroup dump as above to find files list. db alert log and RMAN catalog are other sources to check)
  • use strings command to find the list of files to be retrived and extract them with amdu

Revision 112013-02-28 - LucaCanali

Line: 1 to 1
 
META TOPICPARENT name="HAandPerf"
<!--
* Set DENYTOPICVIEW = 

Revision 102013-02-28 - LucaCanali

Line: 1 to 1
 
META TOPICPARENT name="HAandPerf"
<!--
Changed:
<
<
>
>
* Set DENYTOPICVIEW =
 
  
-->

Revision 92013-02-28 - LucaCanali

Line: 1 to 1
 
META TOPICPARENT name="HAandPerf"
Changed:
<
<
>
>
<!--  
-->
 

ASM support utilities

Some examples and comments on the use of ASM support utilies, in particular kfed and amdu.

Revision 82013-02-28 - PeterJones

Line: 1 to 1
 
META TOPICPARENT name="HAandPerf"
Changed:
<
<
<!--  
-->
>
>
 

ASM support utilities

Some examples and comments on the use of ASM support utilies, in particular kfed and amdu.

Revision 72012-10-29 - LucaCanali

Line: 1 to 1
 
META TOPICPARENT name="HAandPerf"
Added:
>
>
<!--  
-->
 

ASM support utilities

Some examples and comments on the use of ASM support utilies, in particular kfed and amdu. These utilities allow troubleshooting of ASM diskgroups also with unmounted diskgroups. Beware, kfed in write mode can corrupt your ASM config too.

Revision 62010-09-22 - LucaCanali

Line: 1 to 1
 
META TOPICPARENT name="HAandPerf"

ASM support utilities

Some examples and comments on the use of ASM support utilies, in particular kfed and amdu.
Line: 10 to 10
 

AMDU

Changed:
<
<
  • Allows to dump ASM contents without opening diskgroups, allows to check ASM file mirroring
>
>
  • Allows to dump ASM contents without opening diskgroups, allows to check ASM file mirroring when using normal redundancy
  • powerful tool for troubleshooting, introduced in 11g, usable in 10g too.
 
  • amdu run creates a directory with a report.tx file and the .map (and .img dump files (for metadata nad data, output dependson switches in the commandline )
Changed:
<
<
  • a few examples of interest
>
>
  • a few examples of interest:
 
# displays online help for the utility
Line: 98 to 99
 make -f ins_rdbms.mk kfed
  • for amdu, one needs to download it from support. See note note ID 553639.1
Changed:
<
<
* in alternative an installation of of a dual ORACLE_HOME with 11gR2 binaries should also work
>
>
  • in alternative an installation of and additional ORACLE_HOME with 11gR2 binaries should also work for the purposes of using amdu
 

BBED

BBED is an Oracle internal utility to do BLOCKEDIT. It is extensively discussed at http://www.orafaq.com/papers/dissassembling_the_data_block.pdf

Revision 52010-02-05 - LucaCanali

Line: 1 to 1
 
META TOPICPARENT name="HAandPerf"

ASM support utilities

Some examples and comments on the use of ASM support utilies, in particular kfed and amdu.
Line: 100 to 100
 
  • for amdu, one needs to download it from support. See note note ID 553639.1 * in alternative an installation of of a dual ORACLE_HOME with 11gR2 binaries should also work
Added:
>
>

BBED

BBED is an Oracle internal utility to do BLOCKEDIT. It is extensively discussed at http://www.orafaq.com/papers/dissassembling_the_data_block.pdf BBED doesn't work on ASM by default. A work-around has been studied by http://oracleprof.blogspot.com/2009/06/asm-and-bbed.html An example to get started (BTW make of bbed does not seem to work on 11gR2)
cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed

Dump an extent or an ASM file with the methods described above, for example:
amdu -dis '/dev/mapper/itsto*p1' -extract TEST4_DATADG1.555
 
Added:
>
>
Edit: vi bbed.par (or rather follow the explample in the ASMBBED link above) blocksize=8192 datafile=/ORA/dbs01/oracle/home/work/amdu_2010_02_01_17_22_39/TEST2_DATADG1_555.f mode=browse

Finally: $ORACLE_HOME/rdbms/lib/bbed parfile=bbed.par

 
Revisions:
First version, Jan 2010, Luca.Canali@cernNOSPAMPLEASE.ch

Revision 42010-02-03 - LucaCanali

Line: 1 to 1
 
META TOPICPARENT name="HAandPerf"

ASM support utilities

Changed:
<
<
Some examples and comments on the use of ASM support utilies, in particular kfed and amdu. Thiese utilities allow troubleshooting of ASM diskgroups without having to mount the diskgroups. They can also do damage (kfed has a write mode). When ASM diskgroups can be mounted info are available in X$ tables as shown in ASM_Internals.
>
>
Some examples and comments on the use of ASM support utilies, in particular kfed and amdu. These utilities allow troubleshooting of ASM diskgroups also with unmounted diskgroups. Beware, kfed in write mode can corrupt your ASM config too. Note: when ASM diskgroups can be mounted similar info are available in X$ tables as shown in ASM_Internals.
 Oracle support note ID 553639.1 has useful info on amdu and kfed.
Added:
>
>
 

AMDU

  • Allows to dump ASM contents without opening diskgroups, allows to check ASM file mirroring
Line: 32 to 35
  $ amdu -dis '/dev/mapper/itsto*p1' -print TEST4_DATADG1.F267.X1.B1.C10
Changed:
<
<
Example: how to retrieve DB files from a unmounted diskgroup
>
>
Example: how to retrieve DB files from an unmounted diskgroup
 
  • extract file 256 from the data diskgroup as it often the first copy of controlfile
  • (or use a diskgroup dump as above to find files list. db alert log and RMAN catalog are other sources to check)
  • use strings command to find the list of files to be retrived and extract them with amdu

Revision 32010-02-01 - LucaCanali

Line: 1 to 1
 
META TOPICPARENT name="HAandPerf"

ASM support utilities

Some examples and comments on the use of ASM support utilies, in particular kfed and amdu. Thiese utilities allow troubleshooting of ASM diskgroups without having to mount the diskgroups. They can also do damage (kfed has a write mode). When ASM diskgroups can be mounted info are available in X$ tables as shown in ASM_Internals.
Changed:
<
<
Metalink note ID 553639.1 has useful info on amdu and kfed.
>
>
Oracle support note ID 553639.1 has useful info on amdu and kfed.
 

AMDU

Line: 15 to 15
 # displays online help for the utility $ amdu -help
Changed:
<
<
# extracts a file 267 from ASM diskgroup TEST4_DATADG1 (works as asmcmd cp but of on dismounted disk groups!
>
>
# extracts file 267 from ASM diskgroup TEST4_DATADG1 # Note: works as asmcmd cp but olso on dismounted disk groups!
  $ amdu -dis '/dev/mapper/itsto*p1' -extract TEST4_DATADG1.267
Changed:
<
<
# compares primary and mirror extents in normal redundancy disk groups (hunts for potential corruption)
>
>
# compares primary and mirror extents in normal redundancy disk groups # Useful to check for potential corruption issues
 # results in the report.txt file $ amdu -dis '/dev/mapper/itsto*p1' -compare -extract TEST4_DATADG1.267 -noextract
Line: 32 to 34
 
Example: how to retrieve DB files from a unmounted diskgroup
  • extract file 256 from the data diskgroup as it often the first copy of controlfile
Added:
>
>
  • (or use a diskgroup dump as above to find files list. db alert log and RMAN catalog are other sources to check)
 
  • use strings command to find the list of files to be retrived and extract them with amdu
  • -fullscan, -baddisks and/or -former can be of help for some cases

Line: 47 to 50
 # displays online help for the utility $ kfed -help
Added:
>
>
# reads the disk header to stdout $ kfed op=read dev=/dev/mapper/itstor741_11p1
 # reads the specified AU and block into file /tmp/a $ kfed op=read dev=/dev/mapper/itstor741_11p1 aunum=3 blknum=3 text=/tmp/a
Line: 81 to 87
 SQL> (dismount) and mount the group again to see the chagen in v$asm_attribute
Added:
>
>

How to use KFED and AMDU in 10g

kfed and amdu are available by default in 11g in $ORACLE_HOME/bin. In 10g one needs
  • For kfed a link operation needs to be run:
cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk kfed
  • for amdu, one needs to download it from support. See note note ID 553639.1 * in alternative an installation of of a dual ORACLE_HOME with 11gR2 binaries should also work
 
Revisions:

Revision 22010-02-01 - LucaCanali

Line: 1 to 1
 
META TOPICPARENT name="HAandPerf"

ASM support utilities

Some examples and comments on the use of ASM support utilies, in particular kfed and amdu. Thiese utilities allow troubleshooting of ASM diskgroups without having to mount the diskgroups. They can also do damage (kfed has a write mode). When ASM diskgroups can be mounted info are available in X$ tables as shown in ASM_Internals. Metalink note ID 553639.1 has useful info on amdu and kfed.
Changed:
<
<

amdu

>
>

AMDU

 
  • Allows to dump ASM contents without opening diskgroups, allows to check ASM file mirroring
  • amdu run creates a directory with a report.tx file and the .map (and .img dump files (for metadata nad data, output dependson switches in the commandline )
Line: 15 to 15
 # displays online help for the utility $ amdu -help
Changed:
<
<
# extracts a file from ASM storage (works as asmcmd cp but of on dismounted disk groups! $ amdu -dis '/dev/mapper/itsto*p1' -extract 'TEST4_DATADG1.267.698172709'
>
>
# extracts a file 267 from ASM diskgroup TEST4_DATADG1 (works as asmcmd cp but of on dismounted disk groups! $ amdu -dis '/dev/mapper/itsto*p1' -extract TEST4_DATADG1.267
  # compares primary and mirror extents in normal redundancy disk groups (hunts for potential corruption)
Changed:
<
<
$ amdu -dis '/dev/mapper/itsto*p1' -compare -extract 'TEST4_DATADG1.267.698172709' -noextract
>
>
# results in the report.txt file $ amdu -dis '/dev/mapper/itsto*p1' -compare -extract TEST4_DATADG1.267 -noextract
 
Changed:
<
<
# dump contents of a given diskgroup $ amdu -dis '/dev/mapper/itsto*p1' -dump TEST4_DATADG1
>
>
# dump contents of a given diskgroup and does not create image file # the .map file reports on all files found (column number 5 prefixed by the letter F) $ amdu -dis '/dev/mapper/itsto*p1' -noimage -dump TEST4_DATADG1

# print 10 blocks for the first extent of file 267 $ amdu -dis '/dev/mapper/itsto*p1' -print TEST4_DATADG1.F267.X1.B1.C10

Example: how to retrieve DB files from a unmounted diskgroup
  • extract file 256 from the data diskgroup as it often the first copy of controlfile
  • use strings command to find the list of files to be retrived and extract them with amdu
  • -fullscan, -baddisks and/or -former can be of help for some cases
     $ amdu -dis '/dev/mapper/itsto*p1' -extract TEST4_DATADG1.256
     $ strings TEST4_DATADG1.256|grep TATEST4_DATADG1|less # find list of <FILENUM>
     $ amdu -dis '/dev/mapper/itsto*p1' -extract TEST4_DATADG1.<FILENUM> 
 
Changed:
<
<

kfed

  • kfed can be used to read and also write (!) ASM metadata in an ASM diskgroup for support issues
>
>

KFED

  • kfed can be used to read and write ASM metadata. In particular disk headers and ASM (hidden) metadata files.
  • note: kfed in write mode is a powerful but potentially dangerous tool
 
Changed:
<
<
kfed -help # displays online help for the utility kfed read /dev/mapper/itstor741_11p1 aunum=3 blknum=3 text=/tmp/a # reads the specified AU and block into file /tmp/a kfed write /dev/mapper/itstor741_11p1 aunum=3 blknum=3 text=/tmp/a # writes from /tmp/a into the specified AU and block (block checksum is computed and written together with data)
>
>
# displays online help for the utility $ kfed -help

# reads the specified AU and block into file /tmp/a $ kfed op=read dev=/dev/mapper/itstor741_11p1 aunum=3 blknum=3 text=/tmp/a

# writes from /tmp/a into the specified AU and block #block checksum is computed and written together with data $ kfed op=write dev=/dev/mapper/itstor741_11p1 aunum=3 blknum=3 text=/tmp/a

 
Added:
>
>
Example: how to change an ASM diskgroup parameter on a dismounted disk group
  • the parameter is in ASM (hidden) file #9
  • find AUs that contain that information (can be up to 3 mirrored copies in a normal redundancy diskgroup with 3 or more failgroups)
  • read current value into a flat file, update the file and write the updated file with checksum using kfed
  • dismount and mount diskgroup to see change (query v$asm_attribute)
SQL> select DISK_KFFXP,AU_KFFXP,LXN_KFFXP,SIZE_KFFXP  from x$kffxp where NUMBER_KFFXP=9 and GROUP_KFFXP=1;

   DISK_NUMBER PATH
-------------- ----------------------------------------
            41 /dev/mapper/itstor741_11p1
            22 /dev/mapper/itstor739_10p1
            34 /dev/mapper/itstor740_9p1

READ: kfed read /dev/mapper/itstor741_11p1 aunum=3 blknum=3 text=/tmp/a
EDIT: vi /tmp/a  and change attribute value (for example change smart_scan_enable from TRUE to FALSE 
         to disable exadata smart scans in this particular diskgroup, note update length field too)
WRITE PRMARY EXTENT: kfed write /dev/mapper/itstor741_11p1 aunum=3 blknum=3 text=/tmp/a
WRITE SECODARY extents: 
  kfed write /dev/mapper/itstor739_10p1 aunum=3 blknum=3 text=/tmp/a
  kfed write /dev/mapper/itstor740_9p1 aunum=2 blknum=3 text=/tmp/a

SQL> (dismount) and mount the group again to see the chagen in v$asm_attribute


Revisions:
First version, Jan 2010, Luca.Canali@cernNOSPAMPLEASE.ch
 
<!-- Put the Wiki contents here -->

Revision 12010-02-01 - LucaCanali

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="HAandPerf"

ASM support utilities

Some examples and comments on the use of ASM support utilies, in particular kfed and amdu. Thiese utilities allow troubleshooting of ASM diskgroups without having to mount the diskgroups. They can also do damage (kfed has a write mode). When ASM diskgroups can be mounted info are available in X$ tables as shown in ASM_Internals. Metalink note ID 553639.1 has useful info on amdu and kfed.

amdu

  • Allows to dump ASM contents without opening diskgroups, allows to check ASM file mirroring
  • amdu run creates a directory with a report.tx file and the .map (and .img dump files (for metadata nad data, output dependson switches in the commandline )
  • a few examples of interest

# displays online help for the utility
  $ amdu -help   

# extracts a file from ASM storage (works as asmcmd cp but of on dismounted disk groups!
  $ amdu -dis '/dev/mapper/itsto*p1' -extract 'TEST4_DATADG1.267.698172709'  

# compares primary and mirror extents in normal redundancy disk groups (hunts for potential corruption)
  $ amdu -dis '/dev/mapper/itsto*p1' -compare -extract 'TEST4_DATADG1.267.698172709' -noextract 

# dump contents of a given diskgroup
 $ amdu -dis '/dev/mapper/itsto*p1' -dump TEST4_DATADG1

kfed

  • kfed can be used to read and also write (!) ASM metadata in an ASM diskgroup for support issues
kfed -help  # displays online help for the utility
kfed read /dev/mapper/itstor741_11p1 aunum=3 blknum=3 text=/tmp/a # reads the specified AU and block into file /tmp/a
kfed write /dev/mapper/itstor741_11p1 aunum=3 blknum=3 text=/tmp/a # writes from /tmp/a into the specified AU and block (block checksum is computed and written together with data)

<!-- Put the Wiki contents here -->

<!-- DO NOT DELETE - Google Analytics statistics - miguel.anjo@cernNOSPAMPLEASE.ch -->
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback