2010-06-08

How to extract datafiles from the ASM

https://twiki.cern.ch/twiki/bin/viewfile/PSSGroup/HAandPerf?rev=1.4&filename=ASM_metadata_30012006.html

1. We find the disk group and file number of the database spfile:
sys@+ASM1> select GROUP_NUMBER,FILE_NUMBER,BYTES from v$asm_file where type='PARAMETERFILE';

GROUP_NUMBER FILE_NUMBER      BYTES
------------ ----------- ----------
           1         267       3584
2. We find the number and location of the extents where the spfile is written:
sys@+ASM1> select DISK_KFFXP,AU_KFFXP,PXN_KFFXP,XNUM_KFFXP,LXN_KFFXP from x$kffxp where GROUP_KFFXP=1 and NUMBER_KFFXP=267;

DISK_KFFXP   AU_KFFXP  PXN_KFFXP XNUM_KFFXP  LXN_KFFXP
---------- ---------- ---------- ---------- ----------
        24       3820          0          0          0
         0        176          1          0          1

3. From steps 1. and 2. above we know that the spfile is 3584 bytes long and is stored in 2 mirrored extents: one on disk 0, the other on disk 24 (on disk group). We can find the OS path of the disks with the following query (note the test system used was on Linux using asmlib):
sys@+ASM1> select failgroup,disk_number,path from v$asm_disk where GROUP_NUMBER=1 and DISK_NUMBER in (0,24);    
FAILGROUP  DISK_NUMBER PATH
---------- ----------- --------------------
FG1                 24 ORCL:ITSTOR08_2_EXT
FG2                  0 ORCL:ITSTOR11_10_EXT

4.  We can now confirm with OS commands that the mapping is correct. ‘dd’ allows the sysadmin to read the disks directly (bs=1M is the block size, while skip=176 means that the command starts reading at the offset 176M) . Using the disk name found in step 3 (only disk 0 demonstrated here) and the offsets found in step 2 we can confirm that the spfile data is at the expected physical location.
$ dd if=/dev/oracleasm/disks/ITSTOR11_10_EXT bs=1M count=1 skip=176|strings|head -4
test12.__db_cache_size=1476395008
test11.__db_cache_size=1476395008
test12.__java_pool_size=16777216
test11.__java_pool_size=16777216

Niciun comentariu:

Trimiteți un comentariu