-- 建表
create table employee(id int NOT NULL PRIMARY KEY,
name varchar(128))
insert into employee(id, name ) values (1, '小桥')
insert into employee(id, name ) values (3, '流水')
commit
go
-- 建立发布
CREATE PUBLICATION pub_employee (
TABLE employee
)
go
-- 建立同步用户
CREATE SYNCHRONIZATION USER zhou1
go
-- 为zhou1用户建立预定
CREATE SYNCHRONIZATION SUBSCRIPTION
TO pub_employee
FOR zhou1
TYPE 'tcpip'
ADDRESS 'host=localhost'
OPTION sv='version1';
go
四、处理远程数据库zhou2
用dbisql 连接到zhou2,执行以下语句:
create table employee(id int NOT NULL PRIMARY KEY, name varchar(128))
insert into employee(id, name) values (2, '孙红')
commit
-- 建立发布
CREATE PUBLICATION pub_employee (
TABLE employee
)
-- 建立同步用户
CREATE SYNCHRONIZATION USER zhou2
-- 为zhou2用户建立预定
CREATE SYNCHRONIZATION SUBSCRIPTION
TO pub_employee
FOR zhou2
TYPE 'tcpip'
ADDRESS 'host=localhost'
OPTION sv='version1';