Use database replication definition and subcription to replicate the entire primary database.
% isql -Usa -P -Ssunak1502i
use pubs2 go
sp_reptostandby pubs2, βallβ
sp_config_rep_agent pubs2,send_warm_standby_xacts,true go Parameter_Name Default_Value Config_Value Run_Value ------------- --------- ----------------- --------- send warm standby xacts false true true (1 row affected) RepAgent configuration changed for database pubs2. The changes will take effect the next time the RepAgent thread is started. (return status = 0)
sp_stop_rep_agent pubs2 go sp_start_rep_agent pubs2 go
create database replication definition name with primary at pds.pdb replicate DDL
create database replication definition pubs2_repdef with primary at sunak1502i.pubs2 replicate DDL go Database replication definition pubs2_repdef for sunak1502i.pubs2 is created.
create subscription pubs2_sub for database replication definition pubs2_repdef with primary at sunak1502i.pubs2 with replicate at sunak1505i.pubs2 without materialization subscribe to truncate table go
check subscription pubs2_sub for database replication definition pubs2_repdef with primary at sunak1502i.pubs2 with replicate at sunak1505i.pubs2 go
Subscription pubs2_sub is VALID at the replicate. Subscription pubs2_sub is VALID at the primary.The database is now ready for replication
drop subscription pubs2_sub for database replication definition pubs2_repdef with primary at sunak1502i.pubs2 with replicate at sunak1505i.pubs2 without purgeThe replicate connection must be available before you can drop a subscription.