Flash back database and restore origin are two types of data recovery-related functions, they are used to replace restoration by time point to Cancel Changes to the database. Flash back to the database allows you to change the entire database
Flash back database and restore origin are two types of data recovery-related functions, they are used to replace restoration by time point to Cancel Changes to the database. Flash back to the database allows you to change the entire database
Flash back database and restore origin are two types of data recovery-related functions, they are used to replace restoration by time point to Cancel Changes to the database. Flashback allows you to roll back the entire database and use a specified time window to undo changes to the database. This is similar to database restoration by time point.
Restore Point provides the ability to flash back to the database. It is another recovery operation. The protected Restore Point provides a complete function to flash back to the database under specific circumstances, allowing you to select an SCN and forcibly require the database to flash back to be available for this SCN.
Recovery points and flash back databases can be used separately or together. In both cases, the flashback database command or flashback database Statement of RMAN actually restores the database to the state corresponding to a specified SCN. For example:
Flashback database to restore point 'before _ upgrade ';
Flashback databasae to scn 202381;
Flash back database
Flash back to the database, which can be completed through the flashback database command of RMAN and the flashback database Statement of SQL * Plus. The ability to quickly restore the database from logical data errors or user errors.
It is similar to the traditional restoration by time point, and can restore the database to a certain time point in the past. Flash back database recovery is much faster than by time point, because flash back database does not need to restore data files from the backup and apply the corresponding changes from the archived redo log files.
The flashback database can be used to cancel unnecessary changes to the database. The data file is intact. This includes restoring the database to the status corresponding to the previous database avatar. This will cancel the open resetlogs operation.
The flashback database uses its own log mechanism, which creates a flashback log in the flashback area. You can use the flashback database only when the flashback log is available. Therefore, if you want to use this function, you must set the database so that it can create the relevant flash log.
In order to enable the flashback database, you need to set the flashback zone and the flashback retention policy target to specify the ability to restore the database to a certain time point in the past.
Starting from enabling the flashback database, the database will copy the changed data blocks in each data file to the flashback log at regular intervals. These data block images can be used to reconstruct the data file content later.
When the database uses a flash back database to restore the database to some previous target time points ,, each data block that changes since the restoration time point will copy the data block corresponding to the target time point from the flash back log. Then, redo logs starting from the time when the data block is copied to the Flash log are applied.
Note: The redo logs corresponding to the Flash log must be available throughout the time span.
Flash back database window
There is enough flashback log data between the SCN within a certain range to support the flashback database command. This is called the flashback to the database window. If the space in the flash back area is too small, you may delete expired flash back logs by setting a retention policy to allocate space for new flash back log files. Based on the size of the flash back area, other backup files that must be retained and the required flash back log data may cause a shorter time to flash back to the Database window than the flash back retention target.
Note: The flashback retention goal is a goal, not an absolutely protected target that can be used to perform the flashback database.
If the size of the flash back area cannot store the flash back logs and other files required to meet the retention policy, such as archiving and redo logs and other backups. In order to store the flash back logs of other files starting from the earliest SCN, they may be deleted due to space problems.
In the flash back database window, the earliest SCN in the available flash back log cannot be expanded forward. Flash back logs cannot be backed up to directories outside the flash back area. Therefore, in order to add available flash back logs to meet the requirements of the flash back data window, the maximum storage space available in the flash back area is required.
There are also some operations, such as deleting tablespaces or shrinking data files, which cannot be undone by flashing back data. After these operations are performed, the flashback window will immediately re-calculate from these operations.
If the flash-back database window does not meet the requirements of the flashback database, you can restore the database by time point to perform similar tasks to the maximum extent.
Using Protected restore points is the only method that ensures that you can use the flash back database to restore the database to a specified time point or flash back window.
Restore Origin
You can specify a time point or SCN as the restore point name to create a restore point. This label or alias is used to specify the SCN when executing a command with a restore point clause.
If you may cancel any operations you perform, you can create a normal restore point. The Restore Point name and SCN are recorded in the control file. If you need to use a flashback database, a flashback table, or a restoration by time point, you can use a Restore Point name to indicate the target time to replace a time expression or SCN. Define a normal restore point before executing a possible Undo operation to eliminate the need to manually record SCN, or find the correct SCN when executing a flash query.
Normal recovery is very lightweight. The control file can contain thousands of normal recovery points without affecting the database performance. Normal restore points are eventually removed from the control file rather than manually deleted, so they do not need to be maintained.
Restore the origin
In the following context, the Restore point is used to specify the target SCN:
1. RMAN recover database and flashback database commands
2. flashback database statement in SQL * Plus
Note: Generally, protected restore points can be used as the SCN alias in any operation that uses normal restore points. Unless otherwise specified, the use of normal restore points also applies to protected restore points.
Protected Restore Point
Like normal restoration, protected restoration points can also be used as the SCN alias in restoration operations. However, they also provide specific features for the flash back database.
Creating a protected restore point in a specific SCN can force the database to be restored to the state of the SCN by executing the flash back database, even if the database does not enable the flash back log. If the flashback log is enabled, the policy of creating a protected restore point to force the flashback Log retention policy can meet any time point after the database is flashed back to the protected Restore Point.
Protected recovery points can be used to restore the entire database to a known good time point, provided that there is sufficient space in the flash back area to store the flash back log. When a database is flashed back, direct path insertion that is affected by nologging can also be restored using protected restore points.
Protected restore points replace storage snapshots
In practice, protected restore points can effectively replace storage snapshots. They are usually used to protect databases before some dangerous operations, such as large-scale updates and application patching, or upgrade. Compared with creating a snapshot or copying a database to perform these operations, you can create a protected restore point and then perform these dangerous operations, as long as only necessary flash logs are retained.
Logs that flash back to the database and are protected for recovery
Logs that flash back to the database and are protected for restore are based on the data block image captured before the application is changed, therefore, these images can be used to restore the data file to the status corresponding to the previous time point when the flashback database command is executed.
The main difference between a normal flash log and a protected restore point is whether the log is deleted due to the pressure on the available space in the flash back area. These differences affect log space usage and database performance.
Whether or not to enable logs for the flash back database and protected restore points depends on your recovery objectives, as well as the impact on performance and the space usage of these functions.