Oracle Flashback flash back Mechanism

Source: Internet
Author: User

The purpose of Flashback is to roll back the data if you have misperformed the data and submitted it. Some people may say that the backup can be used to restore the system to a previous error, but the correct operation data is also lost. The only possible method is log mining, but log mining is complicated and difficult to locate. Therefore, Oracle has launched the Flashback Technology to restore misoperation. Flashback: Flashback Database
Table Level: Flashback Drop and Flashback Table, Flashback Data Archive
Record level: Flashback Version Query and Flashback Transaction Query

Flashback family Flashback Log
Tablespace Recycle Bin
UNDO Function
Flashback Database
Yes     Roll back a database
Flashback Drop
  Yes   Restore tables accidentally deleted
Flashback Version Query
    Yes Recover misoperation data
Flashback Transaction Query
    Yes Same as above
Flashback Table
    Yes Same as above

Flashback Technology Development History Flashback Version/Transaction Query and Flashback TableFlashback Query and Flashback Table both use undo to implement rollback. When you need to flash back to a previous time point, use Flashback Query to Query, confirm the SCN or Timestamp of the Flashback, and then use the Flashback Table to implement the Flashback.
1. 9i Flashback Query
9i Flashback Query can Query the object status at a certain time point in the past. The test is as follows:
The current system time is:
A105024 @ O02DMS1> alter session set nls_date_format = 'yyyy-mm-dd: hh24: mi: ss ';
A105024 @ O02DMS1> select sysdate from dual;

SYSDATE
-------------------
2011-12-16: 02: 51: 16
There is a data entry in the test table:
A105024 @ O02DMS1> select * from test;

ID
----------
1
Delete the data:
A105024 @ O02DMS1> delete from test;
A105024 @ O02DMS1> commit;
In this case, the test table has no data:
A105024 @ O02DMS1> select * from test;

No rows selected

However, you can use the Flashback Query to Query the deleted data:
A105024 @ O02DMS1> select * from test as of timestamp to_timestamp ('2017-12-16: 02: 51: 16', 'yyyy-mm-dd: hh24: mi: ss ');

ID
----------
1

Data can also be restored if necessary:
A105024 @ O02DMS1> insert into test select * from test as of timestamp to_timestamp ('2017-12-16: 02: 51: 16', 'yyyy-mm-dd: hh24: mi: ss ');
A105024 @ O02DMS1> commit;
  • 1
  • 2
  • 3
  • 4
  • Next Page

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.