Professional Documents
Culture Documents
Table of Contents
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. Understanding Flashback Database. Restore Points Flashback Logs Logging for Guaranteed Restore Points Guaranteed Restore Points and FRA Space Usage Limitations of Flashback Database Manage Flashback via Enterprise Manager Command and Usage Flashback views and Troubleshooting Manage Flashback via Enterprise Manager Future Services of Flashback Questions
Oracle Flashback Database and restore points are related data protection features that enable you to rewind data back in time to correct any problems caused by logical data corruption or user errors within a designated time window. These features provide a more efficient alternative to point-in-time recovery and does not require a backup of the database to be restored first. Flashback Database and restore points are not only effective in traditional database recovery situations but can also be useful during database upgrades, application deployments and testing scenarios when test databases must be quickly created and recreated. Restore points provide capabilities related to Flashback Database and other media recovery operations. In particular, a guaranteed restore point created at an system change number (SCN) ensures that you can use Flashback Database to rewind the database to this SCN. You can use restore points and Flashback Database independently or together.
Presentatie Oracle Restore Points Senior Oracle DBA Gino DAlfonso
(Normal)Restore Points
There are two types of restore points Normal and Guaranteed
Normal restore point assigns a restore point name to an SCN or specific point in time. Thus, a restore point functions as a bookmark or alias for this SCN. Before performing any operation that you may have to reverse, you can create a normal restore point. The control file stores the name of the restore point and the SCN.
Creating a normal restore point eliminates manually recording an SCN in advance or determine the correct SCN after the fact by using features such as Flashback Query.
Normal restore points are lightweight. The control file can maintain a record of thousands of normal restore points with no significant effect on database performance. Normal restore points eventually age out of the control file if not manually deleted, so they require no ongoing maintenance.
(Guaranteed)Restore Points
Guaranteed restore point serves as an alias for an SCN in recovery operations. A principal difference is that guaranteed restore points never age out of the control file and must be explicitly dropped. A guaranteed restore point ensures that you can use Flashback Database to rewind a database to its state at the restore point SCN, even if the generation of flashback logs is disabled. If flashback logging is enabled, then a guaranteed restore point enforces the retention of flashback logs required for Flashback Database to any SCN after the earliest guaranteed restore point. Thus, if flashback logging is enabled, you can rewind the database to any SCN in the continuum rather than to a single SCN only. If the recovery area has enough disk space to store the needed logs, then you can use a guaranteed restore point to rewind a whole database to a known good state days or weeks ago.
Flashback Logs
Logging for Flashback Database and guaranteed restore points involves capturing images of data file blocks before changes are applied. The FLASHBACK DATABASE command can use these images to return the data files to their previous state. If flashback logging is disabled, then you cannot FLASHBACK DATABASE directly to SCNs between the guaranteed restore points and the current time. You can, however, flashback to the guaranteed restore point first and then recover to SCNs between the guaranteed restore point and current time.
This method of logging has the following important consequences: FLASHBACK DATABASE can re-create the data file contents at the time of a guaranteed restore point by using the block images. For workloads that repeatedly modify the same data, disk space usage can be less than normal flashback logging. Less space is needed because each changed block is only logged once. Applications with low volume inserts may benefit from this disk space saving. This advantage is less likely for applications with high volume inserts or large batch inserts. The performance overhead of logging for a guaranteed restore point without flashback database logging enabled can also be lower.
Presentatie Oracle Restore Points Senior Oracle DBA Gino DAlfonso 7
If the fast recovery area has enough space, then a flashback log is created whenever necessary to satisfy the flashback retention target. If a flashback log is old enough that it is no longer needed to satisfy the flashback retention target, then a flashback log is reused. If the database must create a flashback log and the fast recovery area is full or there is no disk space, then the oldest flashback log is reused instead. Reusing the oldest flashback log shortens the flashback database window. If enough flashback logs are reused due to a lack of disk space, then the flashback retention target may not be satisfied. If the fast recovery area is full, then an archived redo log that is reclaimable according to the fast recovery area rules may be automatically deleted by the fast recovery area to make space for other files. In this case, any flashback logs that would require the use of that redo log file for the use of FLASHBACK DATABASE are also deleted. No file in the fast recovery area is eligible for deletion if it is required to satisfy a guaranteed restore point. Thus, retention of flashback logs and other files required to satisfy the guaranteed restore point, in addition to files required to satisfy the backup retention policy, can cause the fast recovery area to fill completely. When you create a guaranteed restore point, with or without enabling full flashback database logging, you must monitor the space available in your fast recovery area. Managing Space for Flashback Logs in the Fast Recovery Area explains how to monitor fast recovery area disk space usage.
Presentatie Oracle Restore Points Senior Oracle DBA Gino DAlfonso 9
You cannot use Flashback Database alone to retrieve a dropped data file
You cannot use FLASHBACK DATABASE to return to a point in time before the restore or re-creation of a control file.
10
You must have a fast recovery area enabled, because flashback logs can only be stored in the fast recovery area.
For Oracle Real Application Clusters (Oracle RAC) databases, the fast recovery area must be in a clustered file system or in ASM (FRA diskgroup).
11
Ensure that the database is open or mounted. If the database is mounted, then it must have been shut down cleanly (unless it is physical standby which is out of scope of this document) To create a normal restore point SQL> CREATE RESTORE POINT before_deployment To create a guaranteed restore point SQL> CREATE RESTORE POINT before_deployment GUARANTEE FLASHBACK DATABASE;
12
To see a list of all currently defined restore points (normal and guaranteed), use the V$RESTORE_POINT control file view with the following query:
SQL> SELECT NAME, SCN, TIME, DATABASE_INCARNATION#, GUARANTEE_FLASHBACK_DATABASE,STORAGE_SIZE FROM V$RESTORE_POINT; One can also use RMAN command to list the restore points RMAN> LIST RESTORE POINT ALL;
13
To drop one of the defined restore points (after you are absolutely sure!)
SQL> DROP RESTORE POINT before_deployment; If you drop a guaranteed restore point with flashback logging enabled, it DOES not delete the flashback logs. Only after turning off the Flashback, it deletes the flashback logging. Normal restore points eventually age out of the control file, even if not explicitly dropped.
14
1. 2. 3.
15
V$FLASHBACK_DATABASE_LOG view shows information about how far back you can flash back the database. It can also help in estimating how much space to add toflash recovery area for flashback logs.
16
17
18
19
20
References http://docs.oracle.com/cd/E11882_01/backup.112/e10642/flashdb.htm#BRADV71000 Flashback Database Best Practices & Performance [ID 565535.1] Master Note For Oracle Flashback Technologies [ID 1138253.1] http://docs.oracle.com/cd/E11857_01/em.111/e16285/rac_database.htm#BABHFEGE Presentatie Oracle Restore Points Senior Oracle DBA Gino DAlfonso 22
The following services of flashback can be explored in the future: Flashback anytime within the retention period Flashback to SCN Snapshot standby
Presentatie Oracle Restore Points Senior Oracle DBA Gino DAlfonso
23
Question?
24
End of Presentation
25