当前位置:网站首页>How to recover after Oracle delete accidentally deletes table data
How to recover after Oracle delete accidentally deletes table data
2022-06-28 20:22:00 【1024 Q】
1、 Recover according to time
In this way, we need to know about the implementation delete The time of the statement .
Query the current system time :select to_char(sysdate,‘yyyy-mm-dd hh24:mi:ss’) from dual;
Suppose that 2022-04-02 16:27:11 minute , Delete statement executed delete from demo ;
At this time, the data in the table cannot be queried . We know delete Execution time , Push forward 1 minute (delete Before the execution time , The smaller the better. , In this example 1 Minutes, for example ), Execute the following statement
select * from DEMO as of timestamp to_timestamp(‘2022-04-02 16:26:11',‘yyyy-mm-dd hh24:mi:ss');
You can see that although the current demo There is no data in the table , But you can find demo Before the table 1 Data in minutes .
recovery 1: At this time, you can use the plsql The export query result function of the tool exports sql file , And then re execute sql In the document insert Statement for data recovery .
recovery 2: Perform the following sql Data recovery :
flashback table DEMO to timestamp to_timestamp(‘2022-04-02 16:26:11',‘yyyy-mm-dd hh24:mi:ss');If you make a mistake ORA-08189: Row movement is not enabled , Cannot flash back table
execute :
alter table DEMO enable row movement;After adding the table row movement function , It's going on flashback Statement to recover
If you make a mistake : ORA-08194: Flashback table operations are not allowed on materialized views ; Restore by creating a new temporary table as described below .
recovery 3( Create a new temporary table ):
newly build demo1 surface , Insert the data to be recovered
create table DEMO1 as select * from DEMO as of timestamp to_timestamp(‘2022-04-02 16:30:11',‘yyyy-mm-dd hh24:mi:ss');take demo1 The data of the table is restored to demo In the table
insert into DEMO select * from DEMO1 where not exists (select * from DEMO where DEMO.id=DEMO1.id);recovery 4( according to scn recovery ):
Check the current scn Number
select current_scn from v$database;
take scn The number is reduced by a certain number , Execute the following statement , Until we can see delete Up to the data
select * from DEMO as of scn 166937913;Through the right scn Number , Under execution sql Statement for data recovery
flashback table DEMO to scn 166937913;summary
This is about oracle delete This is the end of the article on how to recover from accidentally deleting table data , More about oracle delete Please search the previous articles of the software development network or continue to browse the following related articles. I hope you can support the software development network in the future !
边栏推荐
- Configuration du mode tcwind
- 2022年T电梯修理考试题库模拟考试平台操作
- rsync远程同步
- 2022茶艺师(中级)考试模拟100题及模拟考试
- Analysis of variance
- 522. 最长特殊序列 II(贪心&双指针)
- How strong a mathematical foundation does deep learning need?
- 还在付费下论文吗?快来跟我一起白piao知网
- with torch.no_grad():的使用原因
- Resilience4j retry source code analysis and retry index collection
猜你喜欢

Day88.七牛云: 房源图片、用户头像上传

Visualization of neural network structure in different frames

学习太极创客 — MQTT 第二章(八)ESP8266 MQTT 用户密码认证

How strong a mathematical foundation does deep learning need?

Lucene构建索引的原理及源代码分析

Markdown Mermaid Grass (1) Introduction à Mermaid
![[324. swing sequence II]](/img/4f/dbbc28c7c13ff94bd0956f2ccf9603.png)
[324. swing sequence II]

方 差 分 析

Rsync remote synchronization

【学习笔记】主成分分析法介绍
随机推荐
2022茶艺师(中级)考试模拟100题及模拟考试
各种类型长
Comparisonchain file name sort
Grep text search tool
head、tail查看文件
2837. The total number of teams
03.hello_rust
方 差 分 析
员工薪资管理系统
Various types of long
2837. The total number of teams
Employee salary management system
Risc-v instruction set
社招两年半10个公司28轮面试面经
The principle and source code analysis of Lucene index construction
Shell reads the value of the JSON file
2022 t elevator repair test question bank simulation test platform operation
Real number operation
Lecture 30 linear algebra Lecture 4 linear equations
resilience4j 重试源码分析以及重试指标采集