I recently encountered a customer question related to when Flashback logs are deleted vs reused. We changed our documentation to resolve the confusion, but I also learned something new during this process, which I thought I would share with the broader Oracle Database community.
Before we dive into the actual concept of flashback logs management, let’s do a brief refresher of Flashback itself. Flashback is one of the best inherent high availability features of the Oracle Database because of its simplicity. It allows an Oracle Database user to rollback changes without employing complex recovery procedures. It can be used to rewind a database, table, or transaction back to correct problems in various scenarios such as human error, database upgrades, application deployments, testing scenarios, logical corruptions, etc.
There are two kinds of Flashback Technologies available for the Oracle Database as below.
Flashback Database (a component of Physical Flashback) uses its own logging mechanism to create flashback logs in the fast recovery area (FRA). Flashback Database can only be used if flashback logs are available. Additionally, you must configure the fast recovery area and set a flashback retention target to use Flashback Database. The retention target signals the database to copy images of each altered block in every data file into the flashback log at regular intervals. These images are later used to reconstruct a previous incarnation of the database on demand. Any remaining changes are recovered using online and archived redo logs if available.
We always advise customers to size the fast recovery area so that there is enough space available for flashback logs. The four operations for managing flashback logs in the fast recovery area are as below:
Now let’s return to our original point about the confusion over deletion vs reuse of flashback logs. The descriptions of each operation and rules stated above should resolve that confusion now. Moreover, automatic clearing of flashback logs has been introduced for the Oracle Database in 19c and that means the Oracle Database will now automatically manage flashback logs in the fast recovery area. The flashback logs will be managed as per the defined rules and the Oracle Database will decide whether to delete or reuse a particular flashback log. However, it is still important for an Oracle Database user to be aware when these operations occur to avoid any surprises. It should also be noted that flashback logs cannot be managed in the fast recovery area other than setting the flashback retention target and creating guaranteed restore points. All in all, as long as the sizing of the fast recovery area is appropriate and you configure your restore points with reasonable timeframes and storage in mind, the Oracle database will take care of the rest.
For more details on Flashback Technologies refer to our official documentation here. If you wish to learn more about other high availability features for the Oracle Database, please visit our Maximum Availability Architecture page.
You can also follow us on Twitter at @OracleMAA for new updates.