Oracle flashback and oracleflashback

Source: Internet
Author: User

Oracle flashback and oracleflashback
Flash back: fixed a logic error and returned from the current point.
1. There are dedicated flashback logs stored in the FIA, but they are only used in the database.

2. If a full database flash is performed, it is equivalent to an incomplete restoration.



Time Point-based flash back
SQL> flashback table t_wh_prodlib to timestamp to_timestamp ('2017-03-03 12:10:07 ', 'yyyy-mm-dd hh24: mi: ss ');
Returns the database to 20150303 12:10:07.

If an error is returned based on the time point
ERROR at line 1:
ORA-08180: no snapshot found based on specified time

Use time period-based flash back
SQL> flashback table t_wh_prodlib to timestamp extends imestamp-interval '27' minute;
Flash the database back to 27 minutes ago

The above two errors no matter which one reports ERROR at line 1:

ORA-08189: cannot flashback the table because row movement is not enabled


Enter the following command
SQL> alter table t_wh_prodlib enable row movement;

Then execute the above Flash back statement


================================

Others:
1. flash back to delete
After 10 Gbit/s, in addition to putting the superuser in the recycle bin recyle-bin and changing the name to the beginning of bin $
Delete a table and query the table. The file starting with BIN $ is displayed.
> Show recyclebin; view the content in the recycle bin
> Flashback table dodo before drop; flash back to that table

<1 if there are two identical items in the recycle bin, the deleted items will flash back first.
<2 if the same name already exists before the flashback, You need to rename it.
<3 if you do not want to go to the recycle bin during deletion, you can add the truge parameter.

> Purge user_recyclebin; delete users in the recycle bin


2. Flashback query
Flash query is deducted from undo.
> Select * from t as of timestap to_char ('2017-03-03 12:10:07 ', 'yyyy-mm-dd hh24: mi: ss ');


3. Flashback table
It is deducted from undo, and this SYS user cannot use it.
You need to enable row movement. It is required to flash back the table to a certain time point.
> Alter table t enable row movement;
> Flashback table t to timestap to_char ('2017-03-03 12:10:07 ', 'yyyy-mm-dd hh24: mi: ss ');


4. flash back to database DB
Note: You must enable this function, and then use the flash back log in the archive mode.
If this is the first time you set the region flash back settings, you must first set the size, and then set the time. It must be done in the mount status.
> Show parameter recovery
> Show parameter target: view the flash time

> Select FLASHBACK_ON FROM v $ database
At this time, there is a suggestion in the SID under flash to leave this in FRA.
!! During the flash back, you need to mount it.
> Flashback database to timestap to_char ('2017-03-03 12:10:07 ', 'yyyy-mm-dd hh24: mi: ss ');


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.