Summary of 10 GB flash back in Oracle

Source: Internet
Author: User

Summary of 10 GB flash back in Oracle
 
1. flashback query (undo)
Select current_scn from v $ database;
Select * from t as of scn;
Time and scn conversion functions:
Scn_to_timestamp ()
To_timestamp ()
Timestamp_to_scn ()
 
2. flashback table (undo)
Select row_movement from dba_tables where table_name = 'T' and owner = 'test ';
Alter table t enable row movement;
Flashback table t to scn number;
 
3. flashback versions query (undo)
Select * from t versions between scn minvalue and maxvlaue
Order by versions_startscn;
 
4. flashback transaction query (undo)
Select * from flashback_transaction_query where xid = 'transaction id ';
The transaction id corresponds to versions_xid In the flashback versions query. In this way, undo_ SQL can be found and the misoperation is revoked.
 
5. flashback drop
Drop table t;
Show recyclebin
Select * from dba_recyclebin;
Flashback table t to before drop;
Select * from dba_indexes where table_name = 'T ';
If an index exists, the index will also be flashed back, but the index name will change.
Alter index old_index_name rename to new_index_name; change the index name.
The triggers on the t table are also similar.
 
Permanently delete a table
Drop table t purge;
Clear Recycle Bin
Purge recyclebin;

Enable recyclebin?
Show parameter recyclebin;

  • 1
  • 2
  • Next Page

Related Article

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.