Chinaunix首页 | 论坛 | 博客
  • 博客访问: 979069
  • 博文数量: 584
  • 博客积分: 2293
  • 博客等级: 大尉
  • 技术积分: 3045
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-28 11:15
文章分类

全部博文(584)

文章存档

2012年(532)

2011年(47)

2009年(5)

我的朋友

分类:

2012-03-27 11:00:00

Configure flashback database [ID 249319.1]
 
 
 
修改时间25-MAY-2011     类型 BULLETIN     状态 ARCHIVED
 
Applies to:
Enterprise Manager for RDBMS
Oracle Server - Enterprise Edition
Oracle Server - Personal Edition
Oracle Server - Standard Edition
Information in this document applies to any platform.
***Checked for relevance on 25-May-2011***
Purpose
- What is Flashback Database?
- How to Configure a Flashback Database?
Scope and Application
This feature can be used by DBA's and Support Analysts to understand and
configure Flashback database.
Configure flashback database
Flashback database
-----------------------------
- This a new feature introduced in 10g.
- Flashbacking a database means going back to a previous database state.
- The Flashback Database feature provides a way to quickly revert entire
   Oracle database to the state it was in at a past point in time.
- This is different from traditional point in time recovery.
- A new background process RVWR introduced which is responsible for writing
  flashback logs which stores pre-image(s) of data blocks
 - One can use Flashback Database to back out changes that:
 - Have resulted in logical data corruptions.
    - Are a result of user error.
- This feature is not applicable for recovering the database in case of media
  failure.
- The time required for flashbacking a database to a specific time in past is
  DIRECTLY PROPORTIONAL to the number of changes made and not on the size
   of the database.
How to Configure Flashback database
------------------------------------
Prerequisites
--------------
a) Database must be in archivelog mode.
b) Last clean shutdown.
c) Enterprise and Personal Edition required
Configuration: -
---------------
Initialization Parameters required: -
a) DB_RECOVERY_FILE_DEST (dynamically modifiable) --> Physical location where RVWR background process
    writes flashback logs.
b) DB_RECOVERY_FILE_DEST_SIZE (dynamically modifiable) --> Maximum size flashback logs can occupy in
   DB_RECOVERY_FILE_DEST.
c) DB_FLASHBACK_RETENTION_TARGET (dynamically modifiable) --> upper limit in minutes on how far back
    one can flashback the database.
 After setting these parameters in parameter file(init.ora) or spfile.
Note:- Clean shutdown is mandatory.

SQL> Startup mount;
SQL> Alter database flashback on;
SQL> Alter database open;
SQL> select flashback_on from v$database;
FLASHBACK_ON
------------
YES

To see the background process :-
$ ps -eaf | grep rvwr
oracle 10302 1 0 10:58:09 ? 0:00 ora_rvwr_db10g
oracle 22353 12428 1 13:31:16 pts/tL 0:00 grep rvwr

The above two output confirms that the datbase has its flashback feature ON.

How to Flashback the database to the previous state on basis of :
----------------------------------------------------------------
a) SCN
b) Timestamp
c) Log Sequence Number
State 1              State 2
 -------             -------
|       |   >--------------- |        |
|       |     flashback       |        |
 -------               -------
SCN=100             SCN=150
Timestamp=12-09-2003:10:00:00    Timestamp=12-09-2003:12:00:00
Log Sequence Number= 50        Log Sequence Number= 55
Using SCN :-
----------
SQL> shutdown immediate
SQL> startup mount
SQL> flashback database to SCN 100;
Flashback complete.
SQL> alter database open resetlogs;
Database altered.

Note:- This feature can be used with RMAN or Enterprise Manager also.
Using Timestamp :-
---------------
SQL> shutdown immediate
SQL> startup mount
SQL> flashback database to TIMESTAMP(sysdate - 2/24);
Flashback complete.
SQL> alter database open resetlogs;
Database altered.

Using Log sequence Number and RMAN
----------------------------------
RMAN> flashback database to sequence=50 thread=1;
RMAN> alter database open resetlogs;
 
RELATED DOCUMENTS
-----------------
Oracle Database 10g: Maximize Availability
 
 
 
 相关的

产品
Enterprise Management > Enterprise Manager Consoles, Packs, and Plugins > Managing Databases using Enterprise Manager > Enterprise Manager for RDBMS
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Personal Edition
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Standard Edition
关键字
FLASHBACK

 
阅读(204) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~