Oracle Truncate表恢復(ODU)

chenoracle發表於2017-12-29

Oracle Truncate表恢復(ODU)



3.0.7版本開始,恢復Truncate表更方便,只需要執行下面的步驟:

·    (1)OFFLINE表所在的表空間

·    (2)生成資料字典:unload dict

·    (3)掃描資料:scan extent

·    (4)恢復表:unload table username.tablename object auto

create table tt1 as select * from dba_objects;

create table tt2 as select * from tt1;

select * from dba_objects where object_name='TT1';  ---OBJECT_ID 87295  ---DATA_OBJECT_ID 87295

---object_id: Dictionary object number of the object.

---Data_object_id: Dictionary object number of the segment that contains the object.

truncate table tt1;

select *from tt1;


一:OFFLINE表所在的表空間

select * from dba_objects where object_name='TT1'; ---OBJECT_ID 87290  ---DATA_OBJECT_ID 87297

select tablespace_name from user_tables where table_name='T1'; ---USERS

alter tablespace USERS offline;

alter system checkpoint;


二:ODU 版本3.0.9


三:生成資料字典

四:掃描資料

五:恢復表

自動生成以下三個檔案

六:通過sqlldr載入資料到資料庫


七:驗證資料

select count(*) from tt1;  ---86155

select * from tt1;

..........


原文連結如下:

http://www.laoxiong.net/category/odu

http://www.laoxiong.net/odu_recover_drop_table.html#more-95

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

相關文章