For data assets fetched via agent, freshness alerts rely on the Last Modified timestamp. Configure Oracle Flashback on your database to accurately track table modifications and enable precise freshness alert monitoring.
Note: You need the following privileges on
your Oracle database:
FLASHBACKto run flashback queries such as VERSIONSSELECTon the table to read from the table (access to the base table is required)FLASHBACK ARCHIVEorFLASHBACK ARCHIVE ADMINISTERto enable or manage Flashback Data Archive (FDA). This privilege is required only if you are setting up FDA.
Configure Oracle Flashback to track table modifications and
enable freshness alert monitoring.
Check if Flashback is enabled on your database.
SELECT flashback_on FROM v$database;
An output of YES means Flashback is enabled. NO means it is not.
To check the log mode, run:
SELECT LOG_MODE FROM V$DATABASE;
Output:
NOARCHIVELOG: Flashback is not enabledARCHIVELOG: Flashback is enabled
Enable Flashback on Oracle
Enable Oracle Flashback Data Archive (FDA) to track
historical changes to your tables. Flashback must not already be
enabled on your database. If Flashback is already enabled,
proceed to the next task to enable it on specific
tables.
If Flashback is not enabled, follow these steps to set it
up.
Create a Flashback Data Archive.
create flashback archive fda1 tablespace users retention 1 month;
The retention period can be adjusted based on your business requirements.
Expected output:
Flashback archive created
Flashback Data Archive is now created. Proceed to enable
Flashback on your tables.
Enable Flashback on Oracle tables
You must have created a Flashback Data Archive before
enabling Flashback on tables.
Flashback is now enabled on your table and tracking
modifications. The system can now capture freshness
metrics.
Capture freshness metrics from Oracle
Query historical data to capture the freshness metric for your monitored tables. Flashback must be enabled on your table before you can capture freshness metrics.
Use this query to extract the Last Modified timestamp for
freshness alert monitoring.
Execute the freshness metric query.
SELECT CASE WHEN NOT EXISTS (SELECT 1 FROM dba_flashback_archive_tables WHERE table_name = '<table_name>') THEN NULL WHEN (SELECT MAX(versions_startscn) FROM "<schema_name>"."<table_name>" VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE) IS NULL THEN NULL ELSE TO_CHAR(FROM_TZ(CAST(SCN_TO_TIMESTAMP((SELECT MAX(versions_startscn) FROM "<schema_name>"."<table_name>" VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE)) AS TIMESTAMP), SESSIONTIMEZONE) AT TIME ZONE 'UTC', 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZH:TZM') END AS PRECISELY_VALUE, CASE WHEN NOT EXISTS (SELECT 1 FROM all_tables WHERE table_name = '<table_name>' AND owner = '<schema_name>') THEN 'TABLE NOT FOUND' WHEN (SELECT COUNT(*) FROM dba_flashback_archive_tables WHERE table_name = '<table_name>') = 0 THEN 'FLASHBACK FEATURE NOT ENABLED' WHEN (SELECT MAX(versions_startscn) FROM "<schema_name>"."<table_name>" VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE) IS NULL THEN 'NO VERSIONED SCN DATA FOUND' ELSE NULL END AS PRECISELY_COMMENT FROM dual;
Example output:
PRECISELY_VALUE | PRECISELY_COMMENT
2025-06-16 23:06:00 |
The freshness metric is now captured. The system uses this
Last Modified timestamp to generate accurate freshness alerts
for your data assets.