高级队列日志

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;
create tablespace tbs_stream datafile 'D:\Oracle\oradata\aluocp\tbs_stream01.dbf'
size 100m autoextend on maxsize unlimited segment space management auto;

create database link alex.world connect to strmadmin identified by strmadmin using 'alex';
begin
dbms_streams_adm.set_up_queue(
queue_table => 'aluocp_queue_table',
queue_name => 'aluocp_queue');
end;
/

begin
dbms_streams_adm.add_schema_rules(
schema_name => 'alex',
streams_type => 'capture',
streams_name => 'capture_alex',
queue_name => 'strmadmin.alex_queue',
include_dml => true,
include_ddl => true,
include_tagged_lcr => false,
source_database => null,
inclusion_rule => true);
end;
/
exp userid=alex/alex@alex file='d:\alex.dmp' object_consistent=y rows=y

imp userid=system/aluocp@aluocp file='d:\alex.dmp' ignore=y commit=y streams_instantiation=y fromuser=alex touser=alex
begin
dbms_streams_adm.add_schema_propagation_rules(
schema_name => 'alex',
streams_name => 'alex_to_aluocp',
source_queue_name => 'strmadmin.alex_queue',
destination_queue_name => 'strmadmin.aluocp_queue@aluocp.world',
include_dml => true,
include_ddl => true,
include_tagged_lcr => false,
source_database => 'alex',
inclusion_rule => true);
end;
/

begin
dbms_aqadm.alter_propagation_schedule(
queue_name => 'alex_queue',
destination => 'aluocp',
latency => 0);
end;
/

begin
dbms_streams_adm.add_schema_rules(
schema_name => 'alex',
streams_type => 'apply',
streams_name => 'apply_aluocp',
queue_name => 'strmadmin.aluocp_queue',
include_dml => true,
include_ddl => true,
include_tagged_lcr => false,
source_database => 'alex',
inclusion_rule => true);
end;
/

begin
dbms_apply_adm.start_apply(
apply_name => 'apply_aluocp');
end;
/

begin
dbms_capture_adm.start_capture(
capture_name => 'capture_alex');
end;
/
CREATE TABLE TTT(id NUMBER PRIMARY KEY, name VARCHAR2(50);

SELECT CAPTURE_NAME, QUEUE_NAME, RULE_SET_NAME, NEGATIVE_RULE_SET_NAME, STATUS FROM DBA_CAPTURE;

SELECT CAPTURE_NAME, QUEUE_NAME, STATUS, CAPTURED_SCN, APPLIED_SCN FROM DBA_CAPTURE;

SELECT apply_name, apply_captured, status, ERROR_NUMBER, ERROR_MESSAGE FROM dba_apply;
begin
dbms_capture_adm.stop_capture(
capture_name => 'capture_alex');
end;
/

begin
dbms_apply_adm.stop_apply(
apply_name => 'apply_aluocp');
end;
/
Trackback

no comment untill now

Add your comment now

切换到手机版