oracle 表誤刪或者資料誤改修復解決方案

2021-07-13 23:01:48 字數 785 閱讀 3507

oracle 表誤刪或者資料誤改修復解決方案。

1,表誤刪:

--查詢刪除的表相關資訊

select * from user_recyclebin;

假如誤刪表名為user,執行以下操作即可恢復刪除user表

flashback table user to before drop;

2,資料誤改/誤刪:

如果我們誤刪除了表資料或者誤修改了表資料,我們可以先執行以下sql命令查詢出在之前某個時間點的資料,

例子:恢復5小時前user表的記錄,然後記錄存到user_old表

create table user_old as select * from user as of timestamp sysdate-5/24;

3,恢復user表中某誤修改的某個字段(user_name)內容

update user us

set us.user_name =(select  uso.user_name from sys_user_old uso

where us.id = uso.id)

3、批量把錶2中的字段值資料寫入表1中的字段

merge into multiple_diag_t table1

using country_code table2

on (table1.country_code = table2.country_code)

when matched then

update set table1.country_name = table2.country_cn

ORACLE誤刪或者誤改資料後恢復資料四步驟!!!

今天61節,天氣特別不好,外面下暴雨,心情也跟著天氣一樣,沒什麼狀態,導致我錯誤操作一堆資料,遇到這個問題先別慌,辦法總會有的,可能我這個辦法比較基礎,但也是辦法之一哈。第一步是查詢指定時間裡的資料,例如我是在2020年6月1號15 30左右誤改資料,那麼這條語句就是可以根據時間查詢你誤改前的表裡的...

oracle資料庫刪除誤刪資料恢復(已經誤刪)

1 select current scn from v database 查詢當前的scn的例如 9048068977098 2 select from ss 表名 as of scn 9048068975698 scn可以 1,直到找到自己有資料的scn 某個scn的前個節點是有資料的。3 sel...

oracle表資料誤刪還原

一 如果是剛剛刪除,那麼有兩方法 首先用show parameter undo 命令檢視當時的資料庫引數undo retention設定。顯示如下 undo management string auto undo retention integer 10800 undo suppress error...