sybase复制服务
来源:互联网 发布:台达plc编程教学视频 编辑:程序博客网 时间:2024/05/22 06:39
Sybase复制服务器表的单向复制和双向复制定义语句
单向复制
一、在hn01_db上新建表tab1
isql -Usa -P -Shn01
1> use hn01_db
2> create table tab10(a int, b char(10), c int)
3> go
1> sp_setreplicate tab10, true
2> go
The replication status for 'tab10' is set to true.
(return status = 0)
1> grant all on tab10 to public
2> go
1>
二、在hn02_db上新建表tab1
isql -Usa -P -Shn02
1> use hn02_db
2> create table tab10(a int, b char(10), c int)
3> go
1> sp_setreplicate tab10, true
2> go
The replication status for 'tab10' is set to true.
(return status = 0)
1> grant all on tab10 to public
2> go
1>
三、在HN01_REP建立复制关系
isql -Usa -P -SHN01_REP
1> create replication definition rep_tab10 with primary at hn01.hn01_db
2> with all tables named 'tab10' (a int, b char(10), c int) primary key(a)
3> go
Replication definition 'rep_tab10' is created.
1> create subscription sub_tab10 for rep_tab10 with replicate at hn02.hn02_db
2> go
Subscription 'sub_tab10' is in the process of being created.
1>
四、测试
1、在hn01_db里tab1表中插入一条数据
1> insert into tab10 values(1, "AAAAA", 1)
2> go
(1 row affected)
1> select * from tab10
2> go
a b c
----------- ---------- -----------
1 AAAAA 1
(1 row affected)
1>
2、检查hn02_db里tab1表,看是否相应增加一条数据
1> select * from tab10
2> go
a b c
----------- ---------- -----------
1 AAAAA 1
(1 row affected)
1>
五、注意
1、建表时不要把多条命令放到一起写在运行GO,会把表写到master库中去
双向复制
一、hn01添加表
isql -Usa -P -Shn01
1> use hn01_db
2> go
1> create table tab4 (a int, b char(10), c int)
2> go
1> sp_setreplicate tab4, true
2> go
The replication status for 'tab4' is set to true.
(return status = 0)
1> grant all on tab4 to public
2> go
二、hn02添加表
isql -Usa -P -Shn02
1> use hn02_db
2> go
1> create table tab4 (a int, b char(10), c int)
2> go
1> sp_setreplicate tab4, true
2> go
The replication status for 'tab4' is set to true.
(return status = 0)
1> grant all on tab4 to public
2> go
三建议双向复制关系
isql -Usa -P -SHN01_REP
1> create replication definition hn01_tab4 with primary at hn01.hn01_db
2> with all tables named 'tab4'(a int, b char(10), c int)
3> primary key (a) searchable columns (a)
4> go
Replication definition 'hn01_tab4' is created.
1> create subscription sub_hn01_tab4 for hn01_tab4
2> with replicate at hn02.hn02_db
3> go
Subscription 'sub_hn01_tab4' is in the process of being created.
1> create replication definition hn02_tab4 with primary at hn02.hn02_db
2> with all tables named 'tab4'(a int, b char(10), c int)
3> primary key (a) searchable columns (a)
4> go
Replication definition 'hn02_tab4' is created.
1> create subscription sub_hn02_tab4 for hn02_tab4
2> with replic
ate at hn01.hn01_db
3> go
Subscription 'sub_hn02_tab4' is in the process of being created.
1>
四、测试
1、检查hn01上tab4表空,插入一条数据
1> select * from tab4
2> go
a b c
----------- ---------- -----------
(0 rows affected)
1> insert into tab4 values(1, "AAAAA", 1)
2> go
(1 row affected)
1>
2、检查hn02上tab4表是否相应追加了一条数据
1> select * from tab4
2> go
a b c
----------- ---------- -----------
1 AAAAA 1
(1 row affected)
1>
3、在hn02上tab4插入一条数据
1> insert into tab4 values(2, "AAAAA", 1)
2> go
(1 row affected)
1> select * from tab4
2> go
a b c
----------- ---------- -----------
1 AAAAA 1
2 AAAAA 1
(2 rows affected)
1>
2、检查hn01上tab4表是否相应追加了一条数据
1> select * from tab4
2> go
a b c
----------- ---------- -----------
1 AAAAA 1
2 AAAAA 1
(2 rows affected)
1>
- sybase复制服务
- Sybase服务无法启动
- Sybase 服务无法启动
- sybase启动停止服务
- Sybase整库复制步骤
- Sybase复制:基于整库复制(warm standby)
- 恢复注册表中的sybase服务信息
- sybase ase:windows 无法启动sysam服务
- sybase ASE 如何卸载和删除服务
- 解决windows无法启动sybase服务
- Windows无法启动Sybase服务,错误1067
- SYBASE
- sybase
- sybase
- SYBASE
- sybase
- sybase
- sybase
- iOS 常用三方库
- 互联网&IT技术一周大事件汇总
- 电路啸叫的原因????!!!!!
- LightOJ 1213 Fantasy of a Summation
- python获取指定路径下的所有文件
- sybase复制服务
- xml解析
- ViewPager 调用 notifyDataSetChanged()无刷新
- webpack~关于使用包详解(随时更新)
- entrySet() ,keySet()的区别
- BZOJ3307 雨天的尾巴 (树链剖分 线段树合并 dfs相关)
- Java length、length()、size()区别
- 删除用户时提示“数据库主体在该数据库中拥有架构”无法删除解决办法
- Js控制文本框只能输入数字或小数点