---- primary database de
sp_setreptable mytable,"true"
go
sp_addlogin PEKTAS_maint,PEKTAS_maint_ps
grant role sa_role to PEKTAS_maint
grant role replication_role to PEKTAS_maint
isql -Usa -SPEKTAS -DPEKTAS -i rs_install_primary.sql
--- rep server da
create connection to PEKTAS.PEKTAS
set error class to rs_sqlserver_error_class
set function string class to rs_sqlserver_function_class
set username to PEKTAS_maint
set password to ******
with log transfer on --- connection primary db ye ise olmalı.WS da ise iki tarafta da olmalı
create user rep_user_PEKTAS set password *******
go
grant connect source to rep_user_PEKTAS
go
create replication definition repdef_PEKTAS
with primary at PEKTAS.PEKTAS
with all tables named mytable(id int, a varchar(15) ,b varchar(15) )
primary key (id)
create connection to sPEKTAS.PEKTAS
set error class to rs_sqlserver_error_class
set function string class to rs_sqlserver_function_class
set username to PEKTAS_maint
set password to *****
with log transfer on
create subscription sub_PEKTAS
for repdef_PEKTAS
with replicate at sPEKTAS.PEKTAS
admin who_is_down
---prim database
sp_configure "enable rep agent threads",1
sp_config_rep_agent PEKTAS,enable,'PRS','rep_user_PEKTAS','*******'
------secondary database de
sp_addlogin PEKTAS_maint,******
go
sp_addalias "PEKTAS_maint","dbo"
go
sp_start_rep_agent PEKTAS
--------------------------****bittiiii********-------------
--subscription drop
drop subscription sub_name
for repdef_name
with replicate at ds.db
with purge --secondary tabloyu truncate eder
without purge --secondary ve primary tabloyu aynen birakir
--checking subscription
check subscription sub_name
for repdef_name
with replicate at ds.db
create connection to peliste.pdb
set error class to rs_sqlserver_error_class
set function string class to rs_sqlserver_function_class
set username to PEKTAS_maint
set password to *******
with log transfer on --- connection primary db ye ise olmalı.WS da ise iki tarafta da olmalı
GO
----AFET çalısma
create database replication definition DATABASEYONET_rep_def
with primary at DATABASEYONET.DATABASEYONET
replicate ddl
replicate system procedures
create connection to raporAFET.DATABASE_NAME
SET error class to rs_sqlserver_error_class
set function string class to rs_sqlserver_function_class
set username to DATABASE_NAME_maint
set password to *******
define subscription DATABASE_NAME_konya_sub
for database replication definition DATABASE_NAME_repdef
with primary at SERVERNAME.DATABASE_NAME
with replicate at raporAFET.DATABASE_NAME
use dump marker
Hiç yorum yok:
Yorum Gönder