Oracle Flashback Database Introduction

Source: Internet
Author: User
Tags dba log log backup

The flashback technology is based on the contents of the undo segment and is therefore limited by the Undo_retenton parameters. To use the Flashback attribute, you must enable the automatic undo management table space.

In Oracle 10g, the Flash back family is divided into the following members: Flashback Database, Flashback Drop,flashback Query (sub flashback query,flashback Version Q Uery, Flashback Transaction Query three) and flashback Table.

First, Flashback Database

The Flashback database feature is very similar to the incomplete recovery of Rman, which can retreat the entire database back to a point in the past, which relies on the Flashback log log. Faster and more efficient than Rman. Therefore flashback Database can be considered as an alternative technique for incomplete recovery. But it also has certain limitations:

1. Flashback Database does not resolve media failure, this error Rman recovery is still the only option

2. If you delete the data file or use shrink technology to reduce the size of the data file, you can not use the Flashback database technology back to the change before the state, this time you must first use Rman to delete or shrink before the file backup restore, Then use the flashback Database to perform the remaining flashback datbase.

3. If the control file is recovered from a backup, or is a rebuilt control file, you cannot use the flashback Database.

4. The earliest SCN that can be recovered using the flashback database lock depends on the earliest SCN recorded in flashback log.

Second, Flashback Database architecture

Flashback database The entire architecture includes a process recover Writer (RVWR) background process, flashback database log log and Flash Recovery area. Once the database is enabled for flashback, the RVWR process starts, and the process writes flashback database log to the Flash Recovery area, which includes a "front mirror" of the data block (before Image) ", which is why flashback Database Technology does not fully recover the block.

[Oracle@dba ~]$ Ps-ef|grep rvw

Oracle 12620 12589 0 13:21 pts/1 00:00:00 grep rvw

Third, enable flashback Database

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

The Flashback database feature of the databases is turned off by default, and the following configuration is required to enable this feature.

1. Configure Flash Recovery Area

To use the flashback database, you must use the Flash Recovery area, because the Flashback database log can only be saved here. The 2 parameters to configure are as follows, one is the size, and the other is the location. If the database is Rac,flash recovery area must be in shared storage. The database must be in Archivelog mode.

Enable Flash Recovery Area:

Sql>alter SYSTEM SET db_recovery_file_dest_size=20g scope=both;

Sql>alter SYSTEM SET db_recovery_file_dest= '/dba/fb ' Scope=both;

Disabling Flash Recovery area:

Sql>alter SYSTEM SET db_recovery_file_dest= ';

For Flash Recovery area,oracle is recommended, the larger the Flash Recovery area set, the more flashback database restores, so it is recommended that the Flash Recovery area be able to place all Data files, incremental backups, and all archived files that have not yet been backed up, and, of course, the flashback logs that it generates.

Oracle automatically writes files to the zone when the database is running, and when the remaining space is less than 15%, it adds a warning to alert, prompting you to be out of space. But at this time does not affect the normal operation of the database, until all the space is used, Oracle first attempt to delete the search for outdated files, redundant files or backed-up files, if these finished, or no free space, the database will be hang live.

For the processing of database hang caused by flash Recovery area, refer to the documentation later.

2. Enable database Flashback features

(1) database boot to Mount state

sql> startup Mount;

(2) Check the Flashback function, the default function is off.

Sql> select Name, CURRENT_SCN, flashback_on from V$database;

NAME CURRENT_SCN flashback_on

--------    -----------          ------------------

DBA 945715 NO

(3) Start Flashback function

Sql> ALTER DATABASE flashback on;

The database has changed.

Sql> select Name, CURRENT_SCN, flashback_on from V$database;

NAME CURRENT_SCN flashback_on

--------- ----------- ------------------

DBA 0 YES

(4) Set initialization parameters: Db_flashback_retention_target:

Sql>alter system set db_flashback_retention_target=1440 Scope=both;

This parameter is used to control the time that the Flashback log data is retained, or the earliest point in time that you want the flashback database to recover. The default value is 1440, the unit is minute, that is, 24 hours, it should be noted that although the parameter does not directly specify the flash recovery area size, but is subject to its constraints, for example, if the database every day about 10% of the data changes, if the initialization parameter value is set to 1440, The flash recovery area size is at least 10% of the actual capacity of the current database, and if the initialization parameter is set to 2880, the size of the flash recovery area is at least 20% of the capacity of the database.

(5) Start the database

Sql>alter database open;

Author: 51cto Blog Oracle Little Bastard

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.