Custom Querying: CHECKCACHE Command

Version 23.4.8843


Custom Querying: CHECKCACHE Command

Version 23.4.8843


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

CHECKCACHE Syntax

CHECKCACHE <em>CachedTableName</em>  
  [ AGAINST { TableName | ( 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 REP_Table AGAINST Table WITH REPAIR;

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

CHECKCACHE REP_Table AGAINST Table 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 REP_Table AGAINST (SELECT Id, Name, DateModified FROM Table) 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 REP_Table AGAINST Table WITH REPAIR SKIP MODIFIED START LAST_MONTH()