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;