在alter tablespace_datafile begin backup_offline_oracle block之fileq和ckptq變化

wisdomone1發表於2013-04-19

/*********確認下block fileq與tablespace or datafile offline或alter tablespace backup begin的關係***********/


/******************************insert into t_cr且commit一條記錄*********************************************/
BH (0x000007FF40FF2CC8) file#: 5 rdba: 0x0140bc5d (5/48221) class: 1 ba: 0x000007FF40ED4000
  set: 3 pool 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 990,28
  dbwrid: 0 obj: 72974 objn: 72974 tsn: 5 afn: 5 hint: f
  hash: [0x000007FF40FF3A88,0x000007FF606A7528] lru: [0x000007FF40FF2EE0,0x000007FF40FF2C80]
  obj-flags: object_ckpt_list
 
  -----------fileq即為檔案檢查點,用於alter tablespace or datafile begin backup and offline and online
  ckptq: [0x000007FF40FF2A68,0x000007FF40FF2F28] fileq: [0x000007FF40FF2A78,0x000007FF40FF2F38] objq: [0x000007FF40FF2F08,0x000007FF40FF2CA8]
  st: XCURRENT md: NULL tch: 3
  flags: buffer_dirty redo_since_read
  LRBA: [0xc2.8507.0] LSCN: [0x0.5b4935] HSCN: [0x0.5b4937] HSUB: [1]
  cr pin refcnt: 0 sh pin refcnt: 0
 
/**********表空間熱備**************/
SQL> alter tablespace tbl_bck begin backup;
 
Tablespace altered

/**********表空間熱備開始的block dump**********/

BH (0x000007FF40FF2CC8) file#: 5 rdba: 0x0140bc5d (5/48221) class: 1 ba: 0x000007FF40ED4000
  set: 3 pool 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 985,28
  dbwrid: 0 obj: 72974 objn: 72974 tsn: 5 afn: 5 hint: f
  hash: [0x000007FF40FF3A88,0x000007FF606A7528] lru: [0x000007FF40FF2EE0,0x000007FF40FF2C80]
 
  --表空間熱備模式,fileq檔案檢查點為空
  ckptq: [NULL] fileq: [NULL] objq: [0x000007FF40FF2F08,0x000007FF40FF2CA8]
  st: XCURRENT md: NULL tch: 3
  flags: block_written_once redo_since_read
 
  --表空間熱備模式 lrba也為空
  LRBA: [0x0.0.0] LSCN: [0x0.0] HSCN: [0xffff.ffffffff] HSUB: [1]
  cr pin refcnt: 0 sh pin refcnt: 0
 

 

/***********表空間熱備劃式開始後進行了dml事務的block dump*************/
BH (0x000007FF40FEF758) file#: 5 rdba: 0x0140bc5d (5/48221) class: 1 ba: 0x000007FF40E7A000
  set: 3 pool 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 985,28
  dbwrid: 0 obj: 72974 objn: 72974 tsn: 5 afn: 5 hint: f
  hash: [0x000007FF40FF2D78,0x000007FF606A7528] lru: [0x000007FF40FEF970,0x000007FF607C46F0]
  obj-flags: object_ckpt_list
 
  ----表空間熱備模式下fileq佇列又有值了
  ckptq: [0x000007FF607C7B48,0x000007FF47FCF9E8] fileq: [0x000007FF607C7BE8,0x000007FF607C7BE8] objq: [0x000007FF5C2A33A0,0x000007FF5C2A33A0]
  st: XCURRENT md: NULL tch: 1
  flags: buffer_dirty block_written_once redo_since_read
  LRBA: [0xc2.8ed3.0] LSCN: [0x0.5b4bf7] HSCN: [0x0.5b4bfa] HSUB: [1]
  cr pin refcnt: 0 sh pin refcnt: 0
 
 


/*********結束表空間熱備模式的block dump********/
BH (0x000007FF40FEF758) file#: 5 rdba: 0x0140bc5d (5/48221) class: 1 ba: 0x000007FF40E7A000
  set: 3 pool 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 985,28
  dbwrid: 0 obj: 72974 objn: 72974 tsn: 5 afn: 5 hint: f
  hash: [0x000007FF40FF2D78,0x000007FF606A7528] lru: [0x000007FF40FEF970,0x000007FF41F9EC40]
  obj-flags: object_ckpt_list
  ckptq: [0x000007FF47FD1B28,0x000007FF47FCF9E8] fileq: [0x000007FF607C7BE8,0x000007FF607C7BE8] objq: [0x000007FF5C2A33A0,0x000007FF5C2A33A0]
  st: XCURRENT md: NULL tch: 1
  flags: buffer_dirty block_written_once redo_since_read
  LRBA: [0xc2.8ed3.0] LSCN: [0x0.5b4bf7] HSCN: [0x0.5b4bfa] HSUB: [1]
  cr pin refcnt: 0 sh pin refcnt: 0 
 
小結:1,alter tablespace begin|end backup開始fileq為空,下來和非熱備模式一樣fileq
      2,這個也說明alter tablespace begin backup會發生檢查點把檢查點及檔案佇列的髒資料寫入到資料檔案中
      3,所以ckptq及fileq才會一開始為空


/************表空間離線開始************/     
SQL> alter tablespace TBL_BCK offline;
 
Tablespace altered


BH (0x000007FF40FEF758) file#: 5 rdba: 0x0140bc5d (5/48221) class: 1 ba: 0x000007FF40E7A000
  set: 3 pool 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 985,28
  dbwrid: 0 obj: 72974 objn: 72974 tsn: 5 afn: 5 hint: f
  hash: [0x000007FF40FF2D78,0x000007FF606A7528] lru: [0x000007FF40FEF970,0x000007FF41F9EC40]
  ckptq: [NULL] fileq: [NULL] objq: [0x000007FF40FF2B78,0x000007FF5C2A3390]
  st: XCURRENT md: NULL tch: 1
  flags: block_written_once redo_since_read
  LRBA: [0x0.0.0] LSCN: [0x0.0] HSCN: [0xffff.ffffffff] HSUB: [1]
  cr pin refcnt: 0 sh pin refcnt: 0


/**************表空間離線結束**********************/
BH (0x000007FF40FEF758) file#: 5 rdba: 0x0140bc5d (5/48221) class: 1 ba: 0x000007FF40E7A000
  set: 3 pool 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 984,12
  dbwrid: 0 obj: 72974 objn: 72974 tsn: 5 afn: 5 hint: f
  hash: [0x000007FF40FF2D78,0x000007FF606A7528] lru: [0x000007FF40FF2DB0,0x000007FF41FA86A0]
  lru-flags: moved_to_tail on_auxiliary_list
  ckptq: [NULL] fileq: [NULL] objq: [NULL]
  st: FREE md: NULL tch: 0 lfb: 6
  flags:
  cr pin refcnt: 0 sh pin refcnt: 0
     
     
小結:1,表空間離線和表空間熱備一樣,離線發生馬上把ckptq及fileq寫入到資料檔案


/*************資料檔案離線**********************/     
SQL> alter database datafile 5 offline;
 
Database altered

BH (0x000007FF42F8A4C8) file#: 5 rdba: 0x0140bc5d (5/48221) class: 1 ba: 0x000007FF423D4000
  set: 3 pool 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 984,12
  dbwrid: 0 obj: 72974 objn: 72974 tsn: 5 afn: 5 hint: f
  hash: [0x000007FF41FBFB48,0x000007FF606A7528] lru: [0x000007FF41FABC10,0x000007FF607C46F0]
  ckptq: [NULL] fileq: [NULL] objq: [0x000007FF42FB0A98,0x000007FF41F956C8]
  use: [NULL] wait: [NULL]
  st: XCURRENT md: NULL tch: 2 txn: 0x7ff5ed05358
  flags: private
  LRBA: [0x0.0.0] LSCN: [0x0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]
  cr pin refcnt: 0 sh pin refcnt: 0       
 

小結:資料檔案離線同上,發生ckptq及fileq
       

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-758898/,如需轉載,請註明出處,否則將追究法律責任。

相關文章