You can create a subscription for a function replication definition in one of two ways:
Use the create subscription command and the no-materialization method.
Use this method if primary data is already loaded at the replicate, and updates are not in progress.
Use the define subscription, activate subscription, and validate subscription commands and the bulk materialization method.
Use this method if you are coordinating loading data with updates.
Examples of both methods follow.
This script creates a subscription at the replicate Replication Server using the no-materialization method for the replication definition defined at the primary Replication Server.
-- Execute this script at Sydney Replication Server -- Creates subscription using no-materialization -- for upd_publishers_pubs2_repdef create subscription upd_publishers_pubs2_sub for upd_publishers_pubs2_repdef with replicate at SYDNEY_DS.pubs2 without materialization go /* end of script */
This script defines, activates, and validates a subscription at the replicate Replication Server for the replication definition defined at the primary Replication Server.
-- Execute this script at Sydney Replication Server -- Creates subscription using bulk materialization -- for upd_publishers_pubs2_repdef define subscription upd_publishers_pubs2_sub for upd_publishers_pubs2_repdef with replicate at SYDNEY_DS.pubs2 go
activate subscription upd_publishers_pubs2_sub for upd_publishers_pubs2_repdef with replicate at SYDNEY_DS.pubs2 go /* Load data. If updates are in progress,use activate subscription with the “with suspension” clause and resume connection after the load. */
validate subscription upd_publishers_pubs2_sub for upd_publishers_pubs2_repdef with replicate at SYDNEY_DS.pubs2 go /* end of script */