search
HomeDatabaseOracleHow to recover after accidentally deleting table data in oracle instance parsing delete

This article brings you relevant knowledge about Oracle. When using oracle data, the data in the table was accidentally deleted and submitted. The following is about the oracle delete error. I hope this information is helpful to everyone on how to restore table data after deleting it.

How to recover after accidentally deleting table data in oracle instance parsing delete

## Recommended tutorial: "

Oracle Video Tutorial"

Restore based on time

This method requires us to roughly know the time when the delete statement is executed.

Query the current system time:

select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;

Assume that it is 2022-04- 02 16:27:11 minutes, the delete statement


delete from demo was executed;

At this time, the data cannot be queried in the table. . We know the delete execution time, push forward 1 minute (the delete execution time can be before, the smaller the better, this example takes 1 minute as an 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 there is no data in the current demo table, you can query the data from the demo table one minute ago.

Recovery 1: At this time, you can export the sql file through the export query result function of the plsql tool, and then re-execute the insert statement in the sql file for data recovery.

Recovery 2: Execute the following sql for data recovery:

flashback table DEMO to timestamp to_timestamp(‘2022-04-02 16:26:11',‘yyyy-mm-dd hh24:mi:ss');

If an error is reported ORA-08189: The row movement function is not enabled and the table cannot be flashed back

Execute:

alter table DEMO enable row movement;

After adding the table row movement function, execute the flashback statement for recovery

If an error is reported: ORA-08194: Flashback table operations are not allowed on materialized views; then create a new temporary as described below Table recovery.

Recovery 3 (new temporary table):

Create a new demo1 table and insert the data that needs to be restored

create table DEMO1 as select * from DEMO as of timestamp to_timestamp(‘2022-04-02 16:30:11',‘yyyy-mm-dd hh24:mi:ss');

Restore the data of the demo1 table to the demo table

insert into DEMO select * from DEMO1 where not exists (select * from DEMO where DEMO.id=DEMO1.id);

Recovery 4 (restore based on scn):

Query the current scn number

select current_scn from v$database;

Reduce the scn number by a certain amount and execute the following statement until it can Check until we delete the data

select * from DEMO as of scn 166937913;

Use the appropriate scn number to execute the sql statement for data recovery

flashback table DEMO to scn 166937913;

Recommended tutorial: "

Oracle Video Tutorial"

The above is the detailed content of How to recover after accidentally deleting table data in oracle instance parsing delete. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:脚本之家. If there is any infringement, please contact admin@php.cn delete
MySQL vs. Oracle: A Comparative Analysis of Database SystemsMySQL vs. Oracle: A Comparative Analysis of Database SystemsMay 04, 2025 am 12:13 AM

MySQL and Oracle have their own advantages and disadvantages, and comprehensive considerations should be taken into account when choosing: 1. MySQL is suitable for lightweight and easy-to-use needs, suitable for web applications and small and medium-sized enterprises; 2. Oracle is suitable for powerful functions and high reliability needs, suitable for large enterprises and complex business systems.

MySQL vs. Oracle: Understanding Licensing and CostMySQL vs. Oracle: Understanding Licensing and CostMay 03, 2025 am 12:19 AM

MySQL uses GPL and commercial licenses for small and open source projects; Oracle uses commercial licenses for enterprises that require high performance. MySQL's GPL license is free, and commercial licenses require payment; Oracle license fees are calculated based on processors or users, and the cost is relatively high.

Oracle: From Databases to Cloud ServicesOracle: From Databases to Cloud ServicesMay 02, 2025 am 12:05 AM

Oracle's evolution from database to cloud services demonstrates its strong technical strength and market insight. 1. Oracle originated in the 1970s and is famous for its relational database management system, and has launched innovative functions such as PL/SQL. 2. The core of Oracle database is relational model and SQL optimization, which supports multi-tenant architecture. 3. Oracle cloud services provide IaaS, PaaS and SaaS through OCI, and AutonomousDatabase performs well. 4. When using Oracle, you need to pay attention to the complex licensing model, performance optimization and data security issues in cloud migration.

Oracle and MySQL: Exploring Data Management ApproachesOracle and MySQL: Exploring Data Management ApproachesMay 01, 2025 am 12:13 AM

Oracle is suitable for enterprise-level applications that require high performance and complex queries, and MySQL is suitable for web applications that are rapidly developed and deployed. 1. Oracle supports complex transaction processing and high availability, suitable for financial and large ERP systems. 2.MySQL emphasizes ease of use and open source support, and is widely used in small and medium-sized enterprises and Internet projects.

MySQL vs. Oracle: A Look at the User ExperienceMySQL vs. Oracle: A Look at the User ExperienceApr 30, 2025 am 12:12 AM

The differences in user experience between MySQL and Oracle are mainly reflected in: 1. MySQL is simple and easy to use, suitable for quick access and high flexibility scenarios; 2. Oracle has powerful functions, suitable for scenarios that require enterprise-level support. MySQL's open source and free features attract startups and individual developers, while Oracle's complex features and tools meet the needs of large enterprises.

MySQL and Oracle: Exploring Performance and ScalabilityMySQL and Oracle: Exploring Performance and ScalabilityApr 29, 2025 am 12:12 AM

The difference between MySQL and Oracle in performance and scalability is: 1. MySQL performs better on small to medium-sized data sets, suitable for fast scaling and efficient reading and writing; 2. Oracle has more advantages in handling large data sets and complex queries, suitable for high availability and complex business logic. MySQL extends through master-slave replication and sharding technologies, while Oracle achieves high availability and scalability through RAC.

What Oracle Software Does: Key Functions and FeaturesWhat Oracle Software Does: Key Functions and FeaturesApr 28, 2025 am 12:08 AM

Key features of Oracle software include multi-tenant architecture, advanced analytics and data mining, real-time application clustering (RAC), and automated management and monitoring. 1) A multi-tenant architecture allows for the management of multiple independent databases in one database instance, simplifying management and reducing costs. 2) Advanced analytics and data mining tools such as Oracle Advanced Analytics and OracleDataMining help extract insights from data. 3) Real-time application cluster (RAC) provides high availability and scalability, improving system fault tolerance and performance. 4) Automated management and monitoring tools such as Oracle EnterpriseManager (OEM) to automate daily maintenance tasks and monitor numbers in real time

Oracle's Impact: Data Management and BeyondOracle's Impact: Data Management and BeyondApr 27, 2025 am 12:11 AM

Oracle has a profound impact in the fields of data management and enterprise applications. Its database is known for its reliability, scalability and security, and is widely used in industries such as finance, medical care and government. Oracle's influence has also expanded to middleware and cloud computing fields such as WebLogicServer and OracleCloudInfrastructure (OCI), providing innovative solutions. Despite the competition in the open source database and cloud computing market, Oracle maintains its leading position through continuous innovation.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool