Month: September 2014

Oracle Database 12c – RMAN New Features: Part1

Oracle Database 12c has new enhancements and additions in Recovery Manager (RMAN).  The Recovery Manager continues to enhance and extend the reliability, efficiency, and availability of Oracle Database Backup and Recovery. In this article series, I will be explaining the new features and how it will help Oracle community. In this article I will cover: SQL Interface Improvements SYSBACKUP Privilege… Continue Reading →

X$KFDPARTNER视图介绍partner

ASM1和ASM2属于故障组fg1
ASM3属于故障组fg2
使用normal方式冗余
查询v$asm_disk得知磁盘,磁盘号,故障组的对应关系:
SQL> select disk_number,name,failgroup from v$asm_disk where group_number=2;
DISK_NUMBER NAME FAILGROUP
----------- ------------------------------ ------------------------------
          1 ASM1 FG1
          2 ASM2 FG1
          0 ASM3 FG2

查询x$kfdpartner得出partner关系:

SQL> select disk,number_kfdpartner from x$kfdpartner where grp=2;
      DISK NUMBER_KFDPARTNER
---------- -----------------
         0 2    ===>磁盘0的partner是磁盘2
         0 1    ===>磁盘0的partner是磁盘1
         1 0   ===>磁盘1的partner是磁盘0
         2 0

在一个给定ASM Diskgroup,若2个Disk存有同一个extent的镜像拷贝,则将2个disk视作partners。因此partners必须属于同一个diskgroup下的不同的failgroup。

关于ASM disk header(前4KB)的说明

kfbh.endian:                          1 ; 0x000: 0x01
 /* endianness of writer    Little endian = 1|Big endian = 0  1 高字节为0*/ 
kfbh.hard:                          130 ; 0x001: 0x82
kfbh.type:                            1 ; 0x002: KFBTYP_DISKHEAD
 /* metadata block type 此处取值为1.对于我们重构需要的类型有 1.KFBTYP_DISKHEAD  2.KFBTYP_FREESPC 
 3.KFBTYP_ALLOCTBL 4.KFBTYP_FILEDIR 5.KFBTYP_LISTHEAD 6.KFBTYP_DISKDIR   17.KFBTYP_PST_META 等 */ 
kfbh.datfmt:                          1 ; 0x003: 0x01
 /* metadata block data format 取值为1,表示已经格式化*/ 
kfbh.block.blk:                       0 ; 0x004: blk=0
/* block location of this block */
kfbh.block.obj:              2147483648 ; 0x008: disk=0
/* block object id     Disk header 的type为8 ,num表示asm disk在group中的编号,即kfdhdb.dsknum,TYPE=0×8 NUMB=0×0表示为8000000,十进制也就是2147483648 */ 
kfbh.check:                  3643134862 ; 0x00c: 0xd925d38e
/* check value to verify consistency *  通过kfed可自动计算/ 
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:     ORCLDISKVOL1 ; 0x000: length=12
 /* ASMLIB driver reserved block  If no driver is defined “ORCLDISK” is used. 如果没使用ASMlib,默认为 ORCLDISK,否则为ORCLDISK+Name*/
kfdhdb.driver.reserved[0]:    827084630 ; 0x008: 0x314c4f56
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
 /* Comaptible software version   0x0b200000:11.2.0.0.0 */ 
kfdhdb.dsknum:                        0 ; 0x024: 0x0000
 /* This is the disk number.   可以通过kfbh.block.obj获得编号*/ 
kfdhdb.grptyp:                        1 ; 0x026: KFDGTP_EXTERNAL
/* Disk group type 通过PST获得  0:KFDGTP_INVALID 1:KFDGTP_EXTERNAL 2:KFDGTP_NORMAL 3:KFDGTP_HIGH  */ 
kfdhdb.hdrsts:                        3 ; 0x027: KFDHDR_MEMBER
/* Disk header status 
KFDHDR_INVALID           –  Illegal value 
KFDHDR_UNKNOWN     –  Disk header block unreadable 
KFDHDR_CANDIDATE     –  No OSM or OS disk header found 
KFDHDR_MEMBER        –  Normal member of the group 

KFDHDR_FORMER         –  Disk dropped cleanly from group 
KFDHDR_CONFLICT       –  Header conflicts 
KFDHDR_INCOMPAT      –  Written by incompatible software 
KFDHDR_PROVISIONED  –  Disk was prepared beforehand     */ 

kfdhdb.dskname:                    VOL1 ; 0x028: length=4 /* ASM disk name */ 
kfdhdb.grpname:                    DATA ; 0x048: length=4 /* ASM diskgroup name*/ 
kfdhdb.fgname:                     VOL1 ; 0x068: length=4 /* ASM failgroup name*/ 
kfdhdb.capname:                         ; 0x088: length=0
kfdhdb.crestmp.hi:             33007086 ; 0x0a8: HOUR=0xe DAYS=0xf MNTH=0x9 YEAR=0x7de
kfdhdb.crestmp.lo:           3674392576 ; 0x0ac: USEC=0x0 MSEC=0xb2 SECS=0x30 MINS=0x36
kfdhdb.mntstmp.hi:             33007087 ; 0x0b0: HOUR=0xf DAYS=0xf MNTH=0x9 YEAR=0x7de
kfdhdb.mntstmp.lo:           1022893056 ; 0x0b4: USEC=0x0 MSEC=0x207 SECS=0xf MINS=0xf
kfdhdb.secsize:                     512 ; 0x0b8: 0x0200    /* Disk sector size (bytes)  默认取值512*/ 
kfdhdb.blksize:                    4096 ; 0x0ba: 0x1000  /* Metadata block (bytes)  默认取值4096*/ 
kfdhdb.ausize:                  1048576 ; 0x0bc: 0x00100000 /* Allocation Unit (bytes)  默认取值1M*/ 
kfdhdb.mfact:                    113792 ; 0x0c0: 0x0001bc80 /* Stride between phys addr AUs  默认取值113792 */ 
kfdhdb.dsksize:                   40954 ; 0x0c4: 0x00009ffa /* Disk size*/
kfdhdb.pmcnt:                         2 ; 0x0c8: 0x00000002  /* Number of physically addressed allocation units */ 
kfdhdb.fstlocn:                       1 ; 0x0cc: 0x00000001 /* First FreeSpace table blk num  用于记录freespace信息的首个block*/ 
kfdhdb.altlocn:                       2 ; 0x0d0: 0x00000002  /* First Alocation table blk num  用于记录allocation信息的首个block*/ 
kfdhdb.f1b1locn:                      2 ; 0x0d4: 0x00000002 /* File Directory blk 1 AU num  File Directory起始地址 */ 
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  /*Comaptible database version   0x0a100000:10.1.0.0.0 */ 
kfdhdb.grpstmp.hi:             33007086 ; 0x0e4: HOUR=0xe DAYS=0xf MNTH=0x9 YEAR=0x7de
kfdhdb.grpstmp.lo:           3674280960 ; 0x0e8: USEC=0x0 MSEC=0x45 SECS=0x30 MINS=0x36
kfdhdb.vfstart:                       0 ; 0x0ec: 0x00000000
kfdhdb.vfend:                         0 ; 0x0f0: 0x00000000
kfdhdb.spfile:                        0 ; 0x0f4: 0x00000000
kfdhdb.spfflg:                        0 ; 0x0f8: 0x00000000

OOW 2014 Schedule

Here’s a quick rundown of places I plan to be during the week. Date/Time Title Description Sunday 9/28/14 3:30 Expert Oracle Exadata: Then and Now [UGF6626] I’ll be participating in the Exadata Then and Now Panel with Tanel Poder, Andy Colvin, Martin Bach, Karl Arao, Frits Hoogland and anyone else we can drag in. The […]

ASM文件、extent和AU之间的映射关系

X$KFFXP包含了文件、extent和AU之间的映射关系。 从该X$视图可以追踪给定文件的extent的条带化和镜像情况

以下为查询文件号为256的AU分布情况:

SQL> select group_kffxp, disk_kffxp, au_kffxp, xnum_kffxp
  2    from x$kffxp
  3   where group_kffxp = 1
  4     and number_kffxp = 256;
GROUP_KFFXP DISK_KFFXP   AU_KFFXP XNUM_KFFXP
----------- ---------- ---------- ----------
          1          0         29          0
          1          1         33          1
          1          0         30          2
          1          1         34          3
          1          0         31          4
          1          1         35          5
          1          0         32          6
          1          1         36          7
          1          0         33          8
          1          1         37          9
          1          0         34         10
          1          1         38         11
          1          0         35         12
          1          1         39         13
          1          0         36         14
          1          1         40         15
16 rows selected

group_kffxp为组号
disk_kffxp为磁盘号
au_kffxp为AU号
xnum_kffxp为extent号
number_kffxp为文件号

也可以使用x$kfdat来查询:

SQL>  select group_kfdat, number_kfdat, aunum_kfdat, xnum_kfdat
  2     from x$kfdat
  3    where group_kfdat = 1
  4      and fnum_kfdat = 256
  5    order by xnum_kfdat;
GROUP_KFDAT NUMBER_KFDAT AUNUM_KFDAT XNUM_KFDAT
----------- ------------ ----------- ----------
          1            0          29          0
          1            1          33          1
          1            0          30          2
          1            1          34          3
          1            0          31          4
          1            1          35          5
          1            0          32          6
          1            1          36          7
          1            0          33          8
          1            1          37          9
          1            0          34         10
          1            1          38         11
          1            0          35         12
          1            1          39         13
          1            0          36         14
          1            1          40         15
16 rows selected

 

TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569