Basic Oracle Flashback applications

Source: Internet
Author: User

Check whether the user has the Flashback permission
Select * from session_privs where privilege like 'flashback % ';
 
Grant user Flashback permission
Grant flashback any table to test;
 
Restore the deleted data.
Alter database add supplemental log data;
Delete from dept where dname = 'it ';
Commit;
Select * from dept where dname = 'it ';
 
View the operation and restore it using undo_ SQL
Select t. start_timestamp, t. commit_timestamp, t. logon_user, t. operation, t. table_name, t. table_owner, t. undo_ SQL from flashback_transaction_query t where table_name = 'dept ';
 

Time period-based recovery
Update dept set dname = 'China ';
Select * from dept;
Commit;
 
Enable row movement for the corresponding table, and use flashback Based on Time period (10 minutes)
Alter table dept enable row movement;
Flashback table dept to timestamp to_timestamp (sysdate-10/(24*60 ));
 
Restore the deleted table
Drop table dept;
Flashback table dept to before drop;
 
View Recycle Bin
Select * from user_recyclebin order by droptime desc;

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.