您好,登錄后才能下訂單哦!
下面的示例演示如何恢復已刪除的行。當Oracle中的行被刪除時,數據實際上并沒有被刪除。行被簡單地標記為已刪除,空閑空間計數器和指針也相應地進行了調整。行狀態存儲在行頭中,行頭占用每一行的前幾個字節。
行頭由Row Flag、Lock Byte(ITL entry) and Column Count組成。行頭由一個字節大小的 the Row Flag開始,它持有一個位掩碼來顯示行狀態。位掩碼解碼如下:
因此,適合單個塊的列,沒有被鏈接、遷移或集群表的一部分,也沒有被刪除,將具有以下屬性:
SQL> alter system dump datafile 5 block 1551; System altered. Block header dump: 0x0140060f Object id on Block? Y seg/obj: 0x15720 csc: 0x00.111e90 itc: 2 flg: E typ: 1 - DATA brn: 0 bdba: 0x1400608 ver: 0x01 opc: 0 inc: 0 exflg: 0 Itl Xid Uba Flag Lck Scn/Fsc 0x01 0x0002.00a.0000039c 0x00c000fd.00c0.13 --U- 1 fsc 0x0000.00111e92 0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000 bdba: 0x0140060f data_block_dump,data header at 0x7fa17e07f264 =============== tsiz: 0x1f98 hsiz: 0x14 pbl: 0x7fa17e07f264 76543210 flag=-------- ntab=1 nrow=1 frre=-1 fsbo=0x14 fseo=0x1f8d avsp=0x1f79 tosp=0x1f79 0xe:pti[0]nrow=1offs=0 0x12:pri[0]offs=0x1f8d block_row_dump: tab 0, row 0, @0x1f8d tl: 11 fb: --H-FL-- lb: 0x1 cc: 1 col 0: [ 7] 78 78 78 73 74 61 72 end_of_block_dump
BBED> find /c star File: /oradata/epmsn/hsql01.dbf (5) Block: 1551 Offsets: 8184 to 8191 Dba:0x0140060f ------------------------------------------------------------------------ 73746172 0106921e <32 bytes per line> BBED> p *kdbr[0] rowdata[0] ---------- ub1 rowdata[0] @8177 0x2c BBED> d /v dba 5,1551 offset 8177 File: /oradata/epmsn/hsql01.dbf (5) Block: 1551 Offsets: 8177 to 8191 Dba:0x0140060f ------------------------------------------------------- 2c010107 78787873 74617201 06921e l ,...xxxstar.... <16 bytes per line> BBED> d /v dba 5,1551 offset 8177 File: /oradata/epmsn/hsql01.dbf (5) Block: 1551 Offsets: 8177 to 8191 Dba:0x0140060f ------------------------------------------------------- 2c010107 78787873 74617201 06921e l ,...xxxstar.... <16 bytes per line> ************************************************刪除數據 SQL> select * from hsql.test4; CONS_NAME ------------------------------ xxxstar SQL> delete from hsql.test4; 1 row deleted. SQL> commit; Commit complete. SQL> select * from hsql.test4; no rows selected ********************************end 刪除數據 BBED> d /v dba 5,1551 offset 8177 File: /oradata/epmsn/hsql01.dbf (5) Block: 1551 Offsets: 8177 to 8191 Dba:0x0140060f ------------------------------------------------------- 3c020107 78787873 74617201 06a028 l <...xxxstar...( <16 bytes per line> BBED> modify /x 2c offset 8177 File: /oradata/epmsn/hsql01.dbf (5) Block: 1551 Offsets: 8177 to 8191 Dba:0x0140060f ------------------------------------------------------------------------ 2c020107 78787873 74617201 06a028 <32 bytes per line> BBED> sum dba 5,1551 apply Check value for File 5, Block 1551: current = 0x9ec9, required = 0x9ec9 *********************查詢un-delete的數據 SQL> select * from hsql.test4; no rows selected SQL> alter system flush buffer_cache; System altered. SQL> select * from hsql.test4; CONS_NAME ------------------------------ xxxstar SQL>
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。