oracle STREAM 单向用户配置流程步骤总结

alter system set aq_tm_processes=2 scope=both;
alter system set global_names=true scope=both;
alter system set job_queue_processes=10 scope=both;
alter system set parallel_max_servers=20 scope=both;
alter system set undo_retention=3600 scope=both;
alter system set nls_date_format='YYYY-MM-DD HH24:MI:SS' scope=spfile;
alter system set streams_pool_size=25M scope=spfile;
alter system set utl_file_dir='*' scope=spfile;
alter system set open_links=4 scope=spfile;

在source与slave主机创建db_link。

主SOURCE stream队列:
begin
dbms_streams_adm.set_up_queue(
queue_table => 'RACDB_queue_table',
queue_name => 'RACDB_queue');
end;
/

主source capture捕获进程:
begin
dbms_streams_adm.add_schema_rules(
schema_name => 'STREAM',
streams_type => 'capture',
streams_name => 'capture_RACDB',
queue_name => 'strmadmin.RACDB_queue',
include_dml => true,
include_ddl => true,
include_tagged_lcr => false,
source_database => null,
inclusion_rule => true);
end;
/

主source propagation传播进程:
begin
dbms_streams_adm.add_schema_propagation_rules(
schema_name => 'STREAM',
streams_name => 'RACDB_to_ORAPRI',
source_queue_name => 'strmadmin.RACDB_queue',
destination_queue_name => 'strmadmin.ORAPRI_queue@ORAPRI',
include_dml => true,
include_ddl => true,
include_tagged_lcr => false,
source_database => 'RACDB',
inclusion_rule => true);
end;
/
从slave receive 接收队列:
begin
dbms_streams_adm.set_up_queue(
queue_table => 'ORAPRI_queue_table',
queue_name => 'ORAPRI_queue');
end;
/

从slave APPLY进程:
begin
dbms_streams_adm.add_schema_rules(
schema_name => 'STREAM',
streams_type => 'apply',
streams_name => 'apply_ORAPRI',
queue_name => 'strmadmin.ORAPRI_queue',
include_dml => true,
include_ddl => true,
include_tagged_lcr => false,
source_database => 'RACDB',
inclusion_rule => true);
end;
/

从slave start:
begin
dbms_apply_adm.start_apply(
apply_name => 'apply_ORAPRI');
end;
/

主source start:
begin
dbms_capture_adm.start_capture(
capture_name => 'capture_RACDB');
end;
/

修改LCR实现实时应用(可能报错11g):
begin
dbms_aqadm.alter_propagation_schedule(
queue_name => 'RACDB_queue',
destination => 'ORAPRI',
latency => 0);
end;
/
修改LCR实现实时应用(11g):
begin
dbms_aqadm.alter_propagation_schedule(
queue_name => 'RACDB_queue',
destination => 'ORAPRI',
destination_queue => 'ORAPRI_queue',
latency => 0);
end;
/

 

 

 


主:
begin
dbms_aqadm.alter_propagation_schedule(
queue_name => 'racdb_queue',
destination => 'orapri',
latency => 0);
end;
/
主:
begin
dbms_aqadm.alter_propagation_schedule(
queue_name => 'racdb_queue',
destination => 'orapri',
destination_queue => 'orapri_queue',
latency => 5);
end;
/

 


 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28612416/viewspace-1173991/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/28612416/viewspace-1173991/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值