Oracle數(shù)據(jù)庫ODU的幾種恢復(fù)場景
oracle數(shù)據(jù)庫是一種大型數(shù)據(jù)庫系統(tǒng),oracle數(shù)據(jù)庫操作簡單,操作速度快,贏得了廣大用戶的喜愛,由于ODU命令比較多,特別是關(guān)鍵的unload命令比較復(fù)雜,本文將簡單介紹幾種場景下使用ODU進(jìn)行數(shù)據(jù)恢復(fù)時(shí),使用的命令序列。
場景1. 數(shù)據(jù)庫不能啟動,但是SYSTEM表空間中的數(shù)據(jù)字典是完整的。
生成數(shù)據(jù)字典:unload dict
列出用戶: list user
列出用戶下的所有表: list table username
恢復(fù)表: unload table username.tablename
也可以按用戶恢復(fù): unload user username
場景2. 表被TRUNCATE。
OFFLINE表所在的表空間
生成數(shù)據(jù)字典:unload dict
顯示表的段頭:desc username.tablename
找到實(shí)際的data object id: dump datafile file# block block#
掃描數(shù)據(jù):scan extent
恢復(fù)表:unload table username.tablename object object_id
UPDATE:
從3.0.7版本開始,恢復(fù)Truncate表更方便,只需要執(zhí)行下面的步驟:
OFFLINE表所在的表空間
生成數(shù)據(jù)字典:unload dict
掃描數(shù)據(jù):scan extent
恢復(fù)表:unload table username.tablename object auto
場景3. 表被DROP。
OFFLINE表所在的表空間
使用logminer從日志里面挖掘被drop掉的表其data object id,如果不能挖掘,按下面的場景4進(jìn)行恢復(fù)。
掃描數(shù)據(jù):scan extent
如果沒有表結(jié)構(gòu)信息,需要自動來判斷:unload object data_object_id sample
恢復(fù)表:unload object data_object_id column coltype coltype…
場景4. 系統(tǒng)表空間損壞。
掃描數(shù)據(jù):scan extent
搜索數(shù)據(jù):unload object all sample
從結(jié)果文件sample.txt查找需要的數(shù)據(jù)
恢復(fù)需要的表:unload object data_object_id column coltype coltype…
場景5. 表中數(shù)據(jù)被DELETE。
將參數(shù)unload_deleted設(shè)置為YES
生成數(shù)據(jù)字典:unload dict
恢復(fù)表: unload table username.tablename
oracle數(shù)據(jù)庫ODU的幾種恢復(fù)場景就為大家總結(jié)了上文中的五個(gè),希望對大家能夠有所幫助。