For data assets fetched via agent, freshness alerts rely on the Last Modified timestamp. Configure Change Data Capture (CDC) on your Microsoft SQL Server database to accurately track table modifications and enable precise freshness alert monitoring.
Run these SQL commands to grant permissions to your database
user:
- Grant SELECT on CDC system views:
GRANT SELECT ON sys.cdc.change_tables TO [UserName]; - Grant EXECUTE on CDC functions:
GRANT EXECUTE ON sys.fn_cdc_get_all_changes_YourCaptureInstance TO [UserName]; GRANT EXECUTE ON sys.fn_cdc_get_net_changes_YourCaptureInstance TO [UserName]; - Grant permissions to your database user.Note: You need the following permissions on your Microsoft SQL Server database:
SELECTonsys.cdc.change_tablesand other CDC system viewsEXECUTEonsys.fn_cdc_get_all_changes_andsys.fn_cdc_get_net_changesSELECTon the source tables you want to monitorSELECTon CDC change tables (optional; if you want to access CDC data through functions)
Enable CDC at the schema level
Enable Change Data Capture at the database schema level to prepare for table-level CDC configuration.
Before you can enable CDC on individual tables, you must
enable it at the schema level for your database.
CDC is now enabled at the schema level. You can proceed to
enable CDC on individual tables.
Enable CDC at the table level
Enable Change Data Capture on specific tables to begin
tracking data modifications. You must complete the schema-level
CDC enablement before enabling CDC on individual
tables.
When CDC is enabled at the table level, a change table is
created with the naming convention
<cdc>.<schemaName>_<tableName>_CT.
This change table stores all modifications to the source
table.CDC is now enabled on your table and capturing changes. The
system will track all modifications and store them in the change
table for freshness alert generation.
Troubleshoot CDC if data is not being captured
If CDC is enabled but not capturing changes, the SQL Server
Agent (CDC scheduler) may not be running or CDC jobs may be
disabled.
CDC should now be capturing changes. If issues persist,
verify that the SQL Server Agent is running and CDC jobs are
enabled.