- 论坛徽章:
- 0
|
请问:1、我的replication 12.5 用RS_INIT配置 在replication server interfaces information处为什么不能配置?
2、 以下示例讲的都是单表复制,如果要多表复制怎么写?
在win2000上安装配置sybase复制服务器
一、安装前的准备工作
在两台服务器上,装好win2000,而且可以相互Ping通。试验环境:
计算机名 IP ASE server name
Test1 192.168.0.10 Test1
Test2 192.168.0.11 Test2
在test1上安装好Sybase ASE及PC Client和 Replication Server,ASE Server name为test1并创建dbtest1数据库;在test2上安装好Sybase ASE及PC Client,ASE Server name为test2并创建dbtest2数据库。
二、安装复制服务器
1、启动Dsedit,Add Server:test2,TCP/IP:192.168.0.11,5000
2、启动Rs_init,选中Configure a Server product和Replication Server,然后选中Install a new Replication Server
3、在Replication Server Information中,参数为:
Replication Server Name: rep1
(注意:复制服务器命名不要用S开头,S是关键字)
Is this Replication Server the ID Server? Yes
Replication Server error log: c:\sybase\REP-12_5\install\rep1.log
Replication Server config file: c:\sybase\REP-12_5\install\rep1.cfg
在Replication Server Interfaces Information中,Add Service:
MASTER TCP Winsock TCP/IP test1,8888
QUERY TCP Winsock TCP/IP test1,8888
4、在Replication Server System Database中,参数为:
RSSD SQL Server name:test1,RSSD name:rep1_RSSD
Create RSSD:Yes
SA user:sa, SA Password:
5、在RSSD Device Information中,参数为:
RSSD device name:rssd_dev,Create the RSSD device:Yes
RSSD device physical name:c:\sybase\data\rssd_dev.dat
RSSD log device name:rssd_log,Create the RSSD log device:Yes
RSSD log device physical name:c:\sybase\data\rssd_log.dat
6、在Disk Partition中,参数为:
Disk Partiton path:c:\sybase\data\disk_dev.dat
Logical Identifier for Disk Partiton:disk_dev
以下是添加数据库到复制系统中:
7、选中Add a database to the replication system,在Replication Server information中,参数为:
Replication Server name:rep1
RS SA user:sa, RS SA password:
8、在Database information中,参数为:
SQL Server name:test1
SA user:sa,SA password:
Database name:dbtest1
Will the database be replicated:Yes
9、重复第7步。
10、在Database information中,参数为:
SQL Server name:test2
SA user:sa,SA password:
Database name:dbtest2
Will the database be replicated:No
至此,复制服务器的安装基本完成,通过如下的方法可以检测安装是否成功:
isql –Usa –P –Srep1
1>admin health
2>go
若输出结果中Status为HEALTHY则表示成功,否则便为失败,可以使用命令admin who及admin who_is_down以便查找原因,根据经验,失败大多数是由于大小写错误。
11、修改复制服务器的sa口令,执行如下命令:
alter user sa set password '12345678'
然后停止rep1 Server,再启动rep1 Server。
三、定义复制和订购
1、在test1的dbtest1中,执行如下命令:
isql –Usa –P –Stest1
1>use dbtest1
2>go
①、create table test(c1 int, c2 char( )
②、sp_setreptable test, true
③、grant all on test to public
2、在test2的dbtest2中,执行如下命令:
isql –Usa –P –Stest2
1>use dbtest2
2>go
①、create table test(c1 int, c2 char( )
②、grant all on test to public
3、定义复制:在rep1上执行如下命令:
isql –Usa –P –Srep1
1>create replication definition test_rep
2>with primary at test1.dbtest1
3>with all tables named 'test'
4>(c1 int,c2 char( ) primary key(c1)
isql –Usa –P –Stest1
1>use rep1_RSSD
2>go
1>rs_helprep
2>go
可以通过执行rs_helprep命令判断复制定义是否成功,失败大多是由于数据库的权限设置不当以及大小写错误和网络连接问题等。
4、订购:在rep1上执行如下命令:
isql –Usa –P –Srep1
1>create subscription test_sub for test_rep
2>with replicate at test2.dbtest2
四、测试复制服务器
1、在test1的dbtest1中,插入数据:
insert test values(8,'88888888')
2、在test2的dbtest2中,查询复制数据:
select * from test
一般情况下,只要前面的步骤都成功了,数据复制是不成问题的。 |
|