Custom Querying: CHECKCACHE Command

Version 24.2.8969


Custom Querying: CHECKCACHE Command

Version 24.2.8969


The CheckCache command repairs the destination copy of the data after you run a REPLICATE command.

CHECKCACHE Syntax

CHECKCACHE DestinationTable 
  AGAINST { SourceTable | ( SelectStatement )}
  [ WITH REPAIR ] 
  [ SKIP { MODIFIED | DELETED }]
  [ START {Datetime | DatetimeFunction}] 
  [ END {Datetime | DatetimeFunction}]

Common CheckCache Queries

Use the following statement to validate and repair the destination table. This command queries both the source and destination tables, inserts any missing records in the destination, updates any outdated records in the destination, and removes any records that are missing in the source.

CHECKCACHE DestinationTable AGAINST SourceTable WITH REPAIR;

Use the following statement to repair the cache only within the specified date range.

CHECKCACHE DestinationTable AGAINST SourceTable WITH REPAIR START '2018-01-01' END '2019-01-01'

Use the following statement to repair certain columns in the cache that are only within the specified date range.

CHECKCACHE DestinationTable AGAINST (SELECT Id, Name, DateModified FROM SourceTable) WITH REPAIR START '2018-01-01' END '2019-01-01'

Use the following statement to repair the cache database only by removing deleted records over the previous month.

CHECKCACHE DestinationTable AGAINST SourceTable WITH REPAIR SKIP MODIFIED START LAST_MONTH()