TOMSYAN 发表于 2011-12-22 08:54

Configure flashback database [ID 249319.1]

<DIV>Configure flashback database </DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;<BR>修改时间25-MAY-2011&nbsp;&nbsp;&nbsp;&nbsp; 类型 BULLETIN&nbsp;&nbsp;&nbsp;&nbsp; 状态 ARCHIVED<BR>&nbsp;</DIV>
<DIV>Applies to:<BR>Enterprise Manager for RDBMS<BR>Oracle Server - Enterprise Edition<BR>Oracle Server - Personal Edition<BR>Oracle Server - Standard Edition<BR>Information in this document applies to any platform.<BR>***Checked for relevance on 25-May-2011*** <BR>Purpose<BR>- What is Flashback Database?</DIV>
<DIV>- How to Configure a Flashback Database?<BR>Scope and Application<BR>This feature can be used by DBA's and Support Analysts to understand and<BR>configure Flashback database.<BR>Configure flashback database<BR>Flashback database<BR>-----------------------------<BR>- This a new feature introduced in 10g.<BR>- Flashbacking a database means going back to a previous database state.<BR>- The Flashback Database feature provides a way to quickly revert entire<BR>&nbsp;&nbsp; Oracle database to the state it was in at a past point in time.<BR>- This is different from traditional point in time recovery.<BR>- A new background process RVWR introduced which is responsible for writing<BR>&nbsp; flashback logs which stores pre-image(s) of data blocks<BR>&nbsp;- One can use Flashback Database to back out changes that:<BR>&nbsp;- Have resulted in logical data corruptions.<BR>&nbsp;&nbsp;&nbsp; - Are a result of user error.<BR>- This feature is not applicable for recovering the database in case of media<BR>&nbsp; failure.<BR>- The time required for flashbacking a database to a specific time in past is<BR>&nbsp; DIRECTLY PROPORTIONAL to the number of changes made and not on the size<BR>&nbsp;&nbsp; of the database.</DIV>
<DIV>How to Configure Flashback database<BR>------------------------------------<BR>Prerequisites<BR>--------------<BR>a) Database must be in archivelog mode.<BR>b) Last clean shutdown.<BR>c) Enterprise and Personal Edition required</DIV>
<DIV>Configuration: -<BR>---------------<BR>Initialization Parameters required: -<BR>a) DB_RECOVERY_FILE_DEST (dynamically modifiable) --&gt; Physical location where RVWR background process<BR>&nbsp;&nbsp;&nbsp; writes flashback logs.<BR>b) DB_RECOVERY_FILE_DEST_SIZE (dynamically modifiable) --&gt; Maximum size flashback logs can occupy in<BR>&nbsp;&nbsp; DB_RECOVERY_FILE_DEST.<BR>c) DB_FLASHBACK_RETENTION_TARGET (dynamically modifiable) --&gt; upper limit in minutes on how far back<BR>&nbsp;&nbsp;&nbsp; one can flashback the database.</DIV>
<DIV>&nbsp;After setting these parameters in parameter file(init.ora) or spfile.</DIV>
<DIV>Note:- Clean shutdown is mandatory.</DIV>
<DIV><BR>SQL&gt; Startup mount;</DIV>
<DIV>SQL&gt; Alter database flashback on;</DIV>
<DIV>SQL&gt; Alter database open;</DIV>
<DIV>SQL&gt; select flashback_on from v$database;<BR>FLASHBACK_ON<BR>------------<BR>YES</DIV>
<DIV><BR>To see the background process :-<BR>$ ps -eaf | grep rvwr<BR>oracle 10302 1 0 10:58:09 ? 0:00 ora_rvwr_db10g<BR>oracle 22353 12428 1 13:31:16 pts/tL 0:00 grep rvwr</DIV>
<DIV><BR>The above two output confirms that the datbase has its flashback feature ON.</DIV>
<DIV><BR>How to Flashback the database to the previous state on basis of :<BR>----------------------------------------------------------------<BR>a) SCN<BR>b) Timestamp<BR>c) Log Sequence Number</DIV>
<DIV>State 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; State 2<BR>&nbsp;-------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -------<BR>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp; &gt;--------------- |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<BR>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; flashback&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<BR>&nbsp;-------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -------<BR>SCN=100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SCN=150</DIV>
<DIV>Timestamp=12-09-2003:10:00:00&nbsp;&nbsp;&nbsp; Timestamp=12-09-2003:12:00:00</DIV>
<DIV>Log Sequence Number= 50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Log Sequence Number= 55</DIV>
<DIV>Using SCN :-<BR>----------<BR>SQL&gt; shutdown immediate<BR>SQL&gt; startup mount<BR>SQL&gt; flashback database to SCN 100;</DIV>
<DIV>Flashback complete.</DIV>
<DIV>SQL&gt; alter database open resetlogs;</DIV>
<DIV>Database altered.</DIV>
<DIV><BR>Note:- This feature can be used with RMAN or Enterprise Manager also.</DIV>
<DIV>Using Timestamp :-<BR>---------------<BR>SQL&gt; shutdown immediate<BR>SQL&gt; startup mount<BR>SQL&gt; flashback database to TIMESTAMP(sysdate - 2/24);</DIV>
<DIV>Flashback complete.</DIV>
<DIV>SQL&gt; alter database open resetlogs;</DIV>
<DIV>Database altered.</DIV>
<DIV><BR>Using Log sequence Number and RMAN<BR>----------------------------------<BR>RMAN&gt; flashback database to sequence=50 thread=1;</DIV>
<DIV>RMAN&gt; alter database open resetlogs;</DIV>
<DIV>&nbsp;</DIV>
<DIV>RELATED DOCUMENTS<BR>-----------------<BR>Oracle Database 10g: Maximize Availability</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;相关的</DIV>
<DIV><BR>产品</DIV>
<DIV>Enterprise Management &gt; Enterprise Manager Consoles, Packs, and Plugins &gt; Managing Databases using Enterprise Manager &gt; Enterprise Manager for RDBMS<BR>Oracle Database Products &gt; Oracle Database &gt; Oracle Database &gt; Oracle Server - Enterprise Edition<BR>Oracle Database Products &gt; Oracle Database &gt; Oracle Database &gt; Oracle Server - Enterprise Edition<BR>Oracle Database Products &gt; Oracle Database &gt; Oracle Database &gt; Oracle Server - Personal Edition<BR>Oracle Database Products &gt; Oracle Database &gt; Oracle Database &gt; Oracle Server - Standard Edition<BR>关键字</DIV>
<DIV>FLASHBACK</DIV>
<DIV><BR>&nbsp;</DIV>
页: [1]
查看完整版本: Configure flashback database [ID 249319.1]