You can materialize a table where activity to the primary table is going on while the materialization takes place. Use this option when there is a more than a small amount of data to synchronize between the primary and replicate table. This scenario assumes that the table has already been marked using sp_setreptable or sp_setreplicate.
create replication definition t1_repdef with primary at sunak1505x.pri with all tables named t1 (a char(10), b char(10)) primary key (a,b) go Replication definition 't1_repdef' is created
If the replication definition was previously created with replicate minimal columns, alter the replication definition to replicate all columns.
define subscription t1_sub for t1_repdef with replicate at sunak1505x.rep subscribe to truncate table go Subscription t1_sub is in the process of being defined.
admin who go Spid Name State Info ---- ---------- -------------------- -------- 139 DSI EXEC Awaiting Command 104(1) sunak1505x.pri 135 DSI Awaiting Message 104 sunak1505x.pri 129 DIST Awaiting Wakeup 104 sunak1505x.pri 130 SQT Awaiting Wakeup 104:1 DIST sunak1505x.pri 123 SQM Awaiting Message 104:1 sunak1505x.pri 56 SQM Awaiting Message 104:0 sunak1505x.pri 143 REP AGENT Awaiting Command sunak1505x.pri 144 NRM Awaiting Command sunak1505x.pri 156 DSI EXEC Awaiting Command 106(1) sunak1505x.rep 155 DSI Awaiting Message 106 sunak1505x.rep 124 SQM Awaiting Message 106:0 sunak1505x.rep
activate subscription t1_sub for t1_repdef with replicate at sunak1505x.rep with suspension go Subscription 't1_sub' is in the process of being activated.
admin who go Spid Name State Info ---- ---------- --------------- -------- 139 DSI EXEC Awaiting Command 104(1) sunak1505x.pri 135 DSI Awaiting Message 104 sunak1505x.pri 129 DIST Awaiting Wakeup 104 sunak1505x.pri 130 SQT Awaiting Wakeup 104:1 DIST sunak1505x.pri 123 SQM Awaiting Message 104:1 sunak1505x.pri 56 SQM Awaiting Message 104:0 sunak1505x.pri 143 REP AGENT Awaiting Command sunak1505x.pri 144 NRM Awaiting Command sunak1505x.pri 156 DSI EXEC Suspended 106(1) sunak1505x.rep 155 DSI Suspended 106 sunak1505x.rep 124 SQM Awaiting Message 106:0 sunak1505x.rep
% bcp pri..t1 out 't1.bcp' -Usa -P -Ssunak1505x -c Starting copy... 5 rows copied. Clock Time (ms.): total = 9 Avg = 1 (555.56 rows per sec.)
% bcp rep..t1 in 't1.bcp' -Usa -P -Ssunak1505x -c Starting copy... 5 rows copied. Clock Time (ms.): total = 30 Avg = 6 (166.67 rows per sec.
set autocorrection on for t1_repdef with replicate at sunak1505x.rep go autocorrection' is modified for replication definition 't1_repdef' with replicate at 'sunak1505x.rep'.
resume connection to sunak1505x.rep go Connection to 'sunak1505x.rep' is resumed.
isql –Usa –P –SPRS2 admin config, "connection",sunak1505x,rep,"ticket" go Configuration Config Value Run Value -------------- ------------------ ------------ dsi_rs_ticket_report <server default> <server default> Default Value Legal Values Datatype Status -------------- ------------ -------- ------------ on list: on, off string Connection/route restart required
isql –Usa –P –Ssunak1505x use pri go rs_ticket "done t1" go (return status = 0)
use rep go select ticket from rs_ticket_history where h1 = "done t1" go ticket ------------------------------------- V=2;H1=done t1;PDB(pri)=11/30/09 12:14:26.253;EXEC(143)=11/30/09 12:14:26.261;B (143)=19705;DIST(129)=11/30/09 12:14:27.273;DSI(158)=11/30/0912:14:28 294;DSI_T=12;DSI_C=15;RRS=PRS2
set autocorrection off for t1_repdef with replicate at sunak1505x.rep go 'autocorrection' is modified for replication definition 't1_repdef' with replicate at 'sunak1505x.rep'.
validate subscription t1_sub for t1_repdef with replicate at sunak1505x.rep go