Explanation of oracle flash back table

Source: Internet
Author: User

--- Indicates flashing back to the database

--- Use a flashback table to restore the table content to a specific time point in the past

--- Restore from the deleted table

--- Use the flashback query to view the database content at any point in time

--- Use flashback version query to view versions of a row within a period of time

--- Use flashback transaction query to view transaction processing history or rows

Advantages:

Flash back technology can only process and change data, so it fundamentally changes the recovery technology. When this technology is used, the time taken to recover from an error is equal to the time taken to create an error. When flash back technology is used, it has obvious advantages in ease of use, availability, and restoration time compared with media restoration.

The flash back database uses the flash back log to execute the flash back. Flash back to delete the recycle bin. All other functions use restoration data.

 

Flash Back table ----- when this function is used, data in the table and its associated objects (such as indexes, constraints, triggers, and so on) will be restored.

The so-called flashback table is to roll back the data in the table to a certain time point in history, such as the time point before the user accidentally deletes the data, so as to recover the accidentally deleted data, during this operation, the database is still available and no additional space is required.

The flash back table uses the value before the data recorded in the UNDO tablespace is changed. Therefore, if the undo data is required during the flash back table, because the retention time exceeds the value specified by the initialization parameter undo_retention, the undo database data cannot be restored to the specified time if it is overwritten by other transactions, unless the retention guarantee option is specified on the UNDO tablespace.

You can use a flashback table to restore a group of tables to a specific time point without performing the traditional restoration operation.

When the database is online, you can roll back the changes made to the specified table and its related objects.

The flashback TABLE statement can be executed as a single transaction. All tables must be flashed back. Otherwise, the entire transaction will be rolled back.

· You can use a flashback table to restore one or more tables to a specific time point without restoring the backup.

· You can perform the flashback Operation After retrieving data from the tablespace In the rollback segment.

· The flashback table permission is required for the flashback table operation.

· You must start row movement for the table to be flashed back

//Because the data in the table is modified by the flash-back operation, data rows may be moved. For example, if A row of data is currently in block A and the table is flashed back to A previous time point, the row of data is located in Block B at that time, therefore, in the flashback table operation, the data row is transferred from the current A data block to the B data block. Therefore, the data row movement feature must be enabled before the flashback table.

Flashback table: Considerations

· The entire flashback table statement is executed in a transaction. It may flash back to the specified table, or it may not flash back to any specified table.

·During the operation, the flashback table obtains the data operation language (DML) mutex lock for all tables specified by this statement.

·The statistics of the affected objects are not flashed back. (The statistical information of this object is not flashed back)

·All existing indexes are retained. The deleted index is not re-created. The related materialized views are automatically retained during submission.

·The flashback table statement writes the warning log file.

·As long as it does not violate any TABLE constraints, it will flash back to the TABLE specified in the flashback table statement. If any constraints are violated during FLASHBACK execution, the operation is aborted. The TABLE status is the same as that before the flashback table statement is called.

·(Flashback cannot span DDL data. For example, if you have deleted a field before flashback data, then it cannot be flashed back .) The table cannot be flashed back to a specific time before the execution of the Data Definition Language (DDL) operation.

·The system table, remote table, and fixed table cannot be flashed back.

1. Experiment: flashback table usage

SYS @ ORCL> conn tyger/tyger
Connected.
TYGER @ ORCL> create table tyger as select * from scott. emp;


Table created.


TYGER @ ORCL> select count (*) from tyger;


COUNT (*)
----------
14


TYGER @ ORCL> select dbms_flashback.get_system_change_number from dual; // view the current system SCN


GET_SYSTEM_CHANGE_NUMBER
------------------------
1045621


TYGER @ ORCL> delete from tyger where rownum <5;


4 rows deleted.


TYGER @ ORCL> commit;


Commit complete.


TYGER @ ORCL> select count (*) from tyger;


COUNT (*)
----------
10


TYGER @ ORCL> alter table tyger enable row movement; // enables row movement of table tyger


Table altered.


TYGER @ ORCL> flashback table tyger to scn 1045621;


Flashback complete.


TYGER @ ORCL> select count (*) from tyger;


COUNT (*)
----------
14


TYGER @ ORCL>

Detailed explanation about flash back database: http://blog.csdn.net/wanghui5767260/article/details/20993843

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.