在ttactive上创建AWT Cache Group,先不要Load数据
ttisql ttactive
Command> call ttcacheuidpwdset(’test’,'test’);
Command> call ttcachestart;
Command> create asynchronous writethrough cache group cg_student_course
from student (
student_id char(8) not null primary key,
student_name char(12) not null,
enroll_date date not null),
student_course (
course_id char(8) not null,
student_id char(8) not null,
mark int not null,
primary key (course_id,student_id),
foreign key (student_id) references student(student_id));
Command>
找几个空闲的端口,给Replication用,通过netstat确定是否为空闲
[ttactive@west-mountain info]$ netstat |grep 20000
[ttactive@west-mountain info]$ netstat |grep 21000
[ttactive@west-mountain info]$ netstat |grep 22000
创建Replication
Command>create active standby pair ttactive on “west-mountain”,ttstandby on “west-mountain”
return receipt subscriber ttdisaster on “west-mountain”
store ttactive on “west-mountain” port 20000 timeout 30
store ttstandby on “west-mountain” port 21000 timeout 30
store ttdisaster on “west-mountain” port 22000 timeout 30;
Command> repschemes;
Replication Scheme Active Standby:
Master Store: TTACTIVE on WEST-MOUNTAIN
Master Store: TTSTANDBY on WEST-MOUNTAIN
Master Return Service: Return Receipt
Subscriber Store: TTDISASTER on WEST-MOUNTAIN
…….
1 replication scheme found.
Command>
启动Replication Agent,并置为Active状态
Command> call ttrepstart;
Command> call ttRepStateSet(’ACTIVE’);
从Oracle往ttactive Load 数据
Command> load cache group cg_student_course commit every 10 rows;
6 cache instances affected.
Command>
至此,ttactive上的工作已经完成,剩下的任务就是构建ttstandby和ttdisaster了。