oracle資料庫誤處理恢復

2021-06-25 23:12:02 字數 842 閱讀 6002

今天更新資料的時候忘了加where條件,所以把整個表的資料都更新了,我通過下面的方法恢復了資料:

1、在v$sqlarea 這檢視裡面找到你操作那條sql的時間

select r.first_load_time,r.* from v$sqlarea r order by r.first_load_time desc ;

2、建立一張新的表,一張臨時表, newtablename:新建立的臨時表的表名,oldtablename:要恢復資料的表的表名, 時間是通過第一步的first_load_time

create table newtablename

asselect * from oldtablename

as of timestamp to_timestamp('2014-09-25/18:26:32','yyyy-mm-dd hh24:mi:ss');

3、驗證新的表中是否是自己想要恢復的資料

select * from newtablename;

4、如果通過了第三步的驗證,刪除想要恢復的表中的資料

delete oldtablename;

5、把新建的表中的資料插入到想要恢復的表中去

insert into oldtablename select * from newtablename;

6、刪除新建的臨時表

drop table newtablename

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 資料庫備份恢復

用資料庫檔案恢復資料庫 1.開啟伺服器終端 2.切換到根目錄下 cd 3.切換到oracle 使用者下 su oracle 可能需要密碼 密碼 oracle 4.以系統管理員身份登入資料庫 sqlplus as sysdba 5.建立資料庫備份檔案對映路徑 可使用 create directory ...

Oracle資料庫恢復案例

當我們在使用oracle資料庫時,突然斷電,造成很多問題,致使舊資料丟失,影響了資料的正確性,破壞了資料庫。此時,使用者急切需求恢復資料。本文以此為例,講述資料庫資料恢復。一 案例描述 資料庫因突然斷電,資料庫啟庫報 system01.dbf zxfg 使用者下的資料。二 恢復流程 1 資料庫的故障...