使用 WITH REPLCHECK 关键字创建 ifx_replcheck 影子列,Enterprise Replication 将该列用于一致性检查。
ifx_replcheck 列是可见的影子列,因为它们可以被索引且能在系统目录表中查看。创建 ifx_replcheck 影子列之后,必须在主键和 ifx_replcheck 列上创建唯一索引。ifx_replcheck 影子列必须是该索引中的最后一列。Enterprise Replication 使用此索引加速一致性检查。
SELECT * FROM tablename;
SELECT ifx_replcheck FROM customer;
在下列示例中,将 ifx_replcheck 影子列添加到 customer 表中:
CREATE TABLE customer (id int) WITH REPLCHECK;