当前位置:网站首页>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 !
边栏推荐
- Is it safe for CICC fortune to open an account? Let's talk about CICC fortune
- Data standardization processing
- [go language questions] go from 0 to entry 5: comprehensive review of map, conditional sentences and circular sentences
- Compression and decompression commands
- oracle delete误删除表数据后如何恢复
- 数据资产为王,如何解析企业数字化转型与数据资产管理的关系?
- UESTC (shenhengtao team) & JD AI (Mei Tao team) proposed a structured dual stream attention network for video Q & A, with performance SOTA! Better than the method based on dual video representation
- Pipeline | and redirection >
- Configuration du mode tcwind
- return new int[]{i + 1, mid + 1}; return {i + 1, mid + 1};
猜你喜欢

csdn涨薪技术-Selenium自动化测试全栈总结

28 rounds of interviews with 10 companies in two and a half years

Xiaobai's e-commerce business is very important to choose the right mall system!

ref属性,props配置,mixin混入,插件,scoped样式
![[learning notes] Introduction to principal component analysis](/img/24/a760d1cd095a967ef258b623eb465c.png)
[learning notes] Introduction to principal component analysis

How to obtain the coordinates of the aircraft passing through both ends of the radar

方 差 分 析

How strong a mathematical foundation does deep learning need?
oracle delete误删除表数据后如何恢复

SQL server2019 create a new SQL server authentication user name and log in
随机推荐
ThreadLocal principle
Windows 64 bit download install my SQL
Markdown Mermaid planting grass (1)_ Introduction to Mermaid
The principle and source code analysis of Lucene index construction
Markdown mermaid種草(1)_ mermaid簡介
1. 整合 Servlet
TcWind 模式設定
2. 整合 Filter
【学习笔记】因子分析
2280.Cupboards
resilience4j 重试源码分析以及重试指标采集
2022茶艺师(中级)考试模拟100题及模拟考试
Visualization of neural network structure in different frames
2022焊工(初级)特种作业证考试题库及答案
2022 tea master (intermediate) examination simulated 100 questions and simulated examination
ref属性,props配置,mixin混入,插件,scoped样式
Software supply chain security risk guide for enterprise digitalization and it executives
Severity code description project file line suppress status error lnk2038 detected a mismatch of "runtimelibrary": the value "md\u dynamicrelease" does not match the value "mdd\u dynamicde"
裁员真能拯救中国互联网?
Database learning notes (sql04)