Six flashback technologies: flashback database

Source: Internet
Author: User


Flashback six major technologies: flashback database environment: [SQL] sys @ ORCL> select * from v $ version where rownum = 1; BANNER ---------------------------------------------------------------- Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Prod sys @ ORCL>! Uname-a Linux localhost. localdomain 2.6.18-308. el5xen #1 SMP Fri Jan 27 17:59:00 EST 2012 i686 i686 i386 GNU/Linux www.2cto.com 1 Operating Principle RVWR flush the before image of the data block to the flashback log at every delta t, A valid rowid set is formed. The base is dynamically maintained forward by RVWR to make the rowid set method valid. In the flashback database, a large step is taken back to the base, and a small step is taken forward. With flashback log, you can only restore the database to a State at a specified time point. The State may not be consistent, and archive log must be used again, fill in the gaps between the two Delta t time planes to restore the database to a consistent state. In a word, flashback database actually uses undo to sort it out. Its features, with Jay Chou's song "back to the past", "Go back to the past and try to let the story continue ...". 2 prerequisites ① archive mode ② the larger the flash recovery area setting, the stronger the flashback database recovery capability. Controlled by the following two initialization parameters: www.2cto.com 1) db_recovery_file_dest: storage Path 2) db_recovery_file_dest_size: maximum available space [SQL] sys @ ORCL> show parameter db_recover NAME TYPE VALUE ----------- mongodb_recovery_file_dest string/u01/app/oracle/flash_recovery _ area too big integer 2G 3 Start flashback database to enable this mode, you must have two prerequisites: 1) archive Mode 2) mount phase Syntax: www. 2cto.com alter database flashback on/off; verify whether to enable: select flashback_on from v $ database ④ enable force logging force all operations generate redo entries Syntax: alter database force logging; verify whether the switch is Enabled: select force_logging from v $ database 3 constraint factors (I) Control File reconstruction (ii) Data File shrunk (iii) tablespace deletion (iv) Media damage to the above changes, in essence, this will cause invalid rowid on the base. It becomes the constraint factor 4. Add ① db_flashback_retention_target to control the retention time of flashback log data, or the earliest time point you want flashback database to recover. The default value is one day. Www.2cto.com [SQL] sys @ ORCL> show parameter db_flashback NAME TYPE VALUE ------------- mongodb_flashback_retention_target integer 1440 ② there are two options after executing flashback database: a) alter database open resetlogs. Once resetlogs is enabled, no data generated after the specified scn is lost. B) First alter database open read only; then expdp exports the data of the tables with misoperations, then execute recover database, and finally import impdp. ③ to enable flashback on, 10% of resources need to be consumed. DBAs should balance the advantages and disadvantages. ④ Difference between the prefix to and until: Example: to 20: including 20 until 20: Not including 20, that is, the end of 19. 5 test lab (I) Check required conditions for [SQL] sys @ ORCL> show parameter db_recover www.2cto.com NAME TYPE VALUE =----------- mongodb_recovery_file_dest string/u01/app/oracle/flash_recovery _ area too big integer 2G sys @ ORCL> archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 13 Next log sequence to archive 15 Current log sequence 15 sys @ ORCL> select force_logging, flashback_on from v $ database; FOR FLASHBACK_ON --- ------------------ YES (ii) test [SQL] hr @ ORCL> select distinct from dual; GET_SYSTEM_CHANGE_NUMBER limit 731867 hr @ ORCL> truncate table t2; www.2cto.com Table truncated. hr @ ORCL> conn/as sysdba Connected. sys @ ORCL> shutdown immediate Database closed. database dismounted. ORACLE instance shut down. sys @ ORCL> startup mount ORACLE instance started. total System Global Area 419430400 bytes Fixed Size 1219760 bytes Variable Size 83886928 bytes Database Buffers 331350016 bytes Redo Buffers 2973696 bytes Database mounted. sys @ ORCL> flashback database to scn 731867; Flashback complete. sys @ ORCL> alter database open resetlogs; www.2cto.com Database altered. sys @ ORCL> select count (*) from hr. t2; COUNT (*) ---------- 19

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.