Introduction to flash back statements for oracle databases

Source: Internet
Author: User

1 \ flash the table back to a certain time point:

Enable the row movement function before the flash back operation

SQL code
Alter table emp enable row movement;

Execute the flash back statement:
SQL code
Flashback table emp to timestamp to_timestamp ('000000', 'yyyymmddhh24: MI: ss ');

2 \ flash back to recycle bin:
Java code
SQL> show recyclebin;
SQL> drop table emp;
SQL> show recyclebin;
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
Emp bin $ B + XkkO1RS5K10uKo9BfmuA ===$ 0 TABLE 2012-11-07: 15: 30: 47

SQL> flashback table emp to before drop; or
SQL> flashback table "BIN $ B + XkkO1RS5K10uKo9BfmuA = $0" to before drop;

Clear Recycle Bin:
Clear a single table in the recycle bin: purge table emp
Clear the entire recycle bin: purge recyclebin
Clear different object recycle bin: purge user_recyclebin or purge dba_recyclebin
Permanently delete a table: SQL> drop table emp purge; -- the table cannot be recovered.

3 \ flash back transaction Query:
SQL code
Select * from flashback_transaction_query where TABLE_NAME = 'emp'

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.