Built-In Time Travel for Reports
APEX Interactive Reports have a hidden gem: the Flashback feature. Users can specify a number of minutes and the report re-queries the data as it existed that many minutes ago using Oracle’s Flashback Query technology. This is invaluable for debugging (“what did the data look like before that batch job ran?”) and audit (“what were the values before that user changed them?”).
Enabling Flashback
In the IR Attributes, under the “Flashback” section, enable “Allow Flashback” and set the “Maximum Flashback Minutes” to an appropriate value. A typical setting is 60 to 1440 minutes (1 to 24 hours), depending on your database’s UNDO_RETENTION setting.
Users access Flashback through Actions, then Flashback. They enter the number of minutes to go back, and the report refreshes showing historical data. A banner above the report indicates that Flashback is active.
Use Cases
A data analyst notices unexpected values in a financial report and uses Flashback to check what the data looked like before the morning batch process. A manager suspects an incorrect update and uses Flashback to see the previous values. A developer uses it during testing to compare before-and-after states of a data migration.
Limitations
Flashback depends on Oracle’s undo retention. If the database has purged the undo data for the requested time period, the flashback query fails with ORA-01555. DDL operations (DROP, TRUNCATE) are not reversible through Flashback. The flashback applies to the source tables, not to the APEX application state, so page items and session state reflect current values.
Combining With Export
A powerful workflow: activate Flashback, verify the historical data, then download it as CSV. This gives users an instant snapshot of past data without requiring a separate audit trail or data warehouse. Combined with the current data export, users can compare before-and-after data sets in Excel.
Security Consideration
Flashback lets users see data as it existed at a previous point, which might include data that was subsequently deleted for compliance reasons. Consider whether enabling Flashback is appropriate for your application’s data sensitivity. For highly regulated data, disable Flashback and instead provide a purpose-built audit trail with appropriate access controls.