Trigger中有一種Dead Trigger,用法較多,可以參考其定義,其中一個就是恢複單向同步的表的初始負載。也就是說要發起一次初始負載,就是要建立一個Dead Trigger。
1. 建立一個channel
insert intosym_channel
(channel_id,processing_order, max_batch_size, enabled, description)
values('sale_transaction', 1, 100000, 1,'sale_transactional data from register and back office');
2. 建立一個Dead Trigger,将想要初始負載的表加入到channel中,初始負載的方向是單向的
insert intosym_trigger
(trigger_id,source_table_name,channel_id,sync_on_insert, sync_on_update, sync_on_delete, last_update_time,create_time)
values('sale_transaction_dead','sale_transaction','sale_transaction',0,0,0,current_timestamp,current_timestamp);
insert intosym_router
(router_id,source_node_group_id,target_node_group_id,router_type,create_time,last_update_time)
values('store_2_corp', 'store', 'corp','default',current_timestamp, current_timestamp);
insert intosym_trigger_router
(trigger_id,router_id,initial_load_order,last_update_time,create_time)
values('sale_transaction_dead','store_2_corp', 200,current_timestamp, current_timestamp);
../bin/symadmin --engine corp-000reload-node 001