Realize recovery of deleted table or table data content in Oracle

1. Description of requirements

        In the process of our project development or operation and maintenance, due to improper operation, the data content of the Oracle database table or the specified table is accidentally deleted, causing the program to malfunction; and we have not backed up the database. At this time, if we cannot restore it in time Database content can cause serious accidents. We need a remedial method to recover the loss and restore the table or table data content that was deleted by mistake.

2. Problem analysis

        The Oracle database table or table data is accidentally deleted due to improper operation; if you want to reduce the loss, restore the deleted table or data in time.

3. Implementation method

        Note: The following recovery methods have a time limit. If you fail to recover in time after misoperation, and the waiting time is too long, the data will not be rolled back. Therefore, once the misoperation causes data problems, you must immediately perform recovery operations.

3.1. Method of recovering table data that has been deleted by mistake

"1" Query the data content statement of the table that was accidentally deleted after the specified time period


select * from 表名称 as of timestamp to_timestamp('2023-04-23 22:00:00', 'yyyy-mm-dd hh24:mi:ss');

"2" Export the queried accidentally deleted data as an insert statement and execute it to restore 

3.2. Method of recovering table data that was updated by mistake

 《1》Query the table data content updated after the specified time period </

Guess you like

Origin blog.csdn.net/xiaochenXIHUA/article/details/130332344