当前位置:网站首页>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 !
边栏推荐
- 3. integrate listener
- 圆球等的相关计算
- 学习太极创客 — MQTT 第二章(八)ESP8266 MQTT 用户密码认证
- 2022 welder (elementary) special operation certificate examination question bank and answers
- 还在付费下论文吗?快来跟我一起白piao知网
- 【学习笔记】因子分析
- Past blue bridge cup test questions ants catch cold
- 2022年P气瓶充装考试练习题及在线模拟考试
- C # connect to the database to complete the operation of adding, deleting, modifying and querying
- Day88.七牛云: 房源图片、用户头像上传
猜你喜欢

Windows 64 bit download install my SQL

Are you still paying for your thesis? Come and join me

【算法篇】刷了两道大厂面试题,含泪 ”重学数组“

5g NR MBS architecture introduction

rsync远程同步

计网 | 一文解析TCP协议所有知识点

Leetcode 36. 有效的数独(可以,一次过)

ThreadLocal principle

Flatten of cnn-lstm

C # application interface development foundation - form control
随机推荐
[graduation season · advanced technology Er] hard work can only pass, hard work can be excellent!
ref属性,props配置,mixin混入,插件,scoped样式
ComparisonChain-文件名排序
How to "calculate" in the age of computing power? The first mover advantage of "convergence of computing and networking" is very important!
2788.Cifera
03.hello_ rust
Resilience4j retry source code analysis and retry index collection
CSDN salary increase technology selenium automated test stack summary
Comparisonchain file name sort
TcWind 模式设定
Ali open source (easyexcel)
Are you still paying for your thesis? Come and join me
Win 10 create a gin framework project
Analysis of all knowledge points of TCP protocol in network planning
28 rounds of interviews with 10 companies in two and a half years
怎么理解云原生数据库的快速迭代?
30讲 线性代数 第四讲 线性方程组
Database learning notes (sql04)
算力时代怎么「算」?「算网融合」先发优势很重要!
The severity code indicates that the project file line prohibits the display of status errors. C1047 object or library file ".Lib" is different from other objects (such as "x64\release\main.obj")