Oracle restores accidentally deleted tables and mistakenly updated tables

Source: Internet
Author: User
Accidentally deleted a table from Oracle. It's really easy to find the recovery method. According to the ORACLE10G features, When I execute DropTable or deleteall,

Accidentally deleted a table from Oracle. It's really easy to find the recovery method. According to the ORACLE10G feature, when I run Drop Table or delete all,

Accidentally deleted a table from Oracle. It's really easy to find the recovery method.

According to ORACLE10G features, When I execute Drop Table or delete all, Oracle will put the deleted Table or data records in the Database Recycle Bin (Database Recyclebin. In this way, we can use the flashback table command to restore the deleted table. Syntax:
Flashback table name to before drop;

SQL @ kokooa> flashback table test003 to before drop;

Flashback complete.

SQL @ kokooa> select * from test003;

NAME STATE PERSON
------------------------
A 1
A 2
A 1
A 1
B 2
B 2

6 rows selected.

Update table

SQL @ kokooa> flashback table a to timestamp to_timestamp ('2017-11-09 11:00:00 ', 'yyyy-mm-dd hh24: mi: ss ');

Generally, an error is reported:

ERROR at line 1:
ORA-08189: cannot flashback the table because row movement is not enabled

You only need:

SQL @ kokooa> alter table a enable row movement;

Table altered.

OK.

SQL @ kokooa> flashback table a to timestamp to_timestamp ('2017-11-09 11:00:00 ', 'yyyy-mm-dd hh24: mi: ss ');

Flashback complete.

SQL @ kokooa> select * from;

NAME NUM
------------------------------
Jim 90
Tom 100
Kate 220
Lili 330


By default, oracle performs 1440 minutes on the submitted data, that is, the "cache" of the day. Therefore, there is a way to retrieve the data within one day.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.