alter table sanjay.TENDER_HDR_TBL add supplemental log data(all) columns;
alter table sanjay.TENDER_DTL_TBL add supplemental log data(all) columns;
alter table sanjay.VENDORS_TRADE_GP add supplemental log data(all) columns;
alter table sanjay.TRADEGRP add supplemental log data(all) columns;
alter table sanjay.VENDORS add supplemental log data(all) columns;
alter table scott.emp add supplemental log data(all) columns;
alter table scott.dept add supplemental log data(all) columns;
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_
table_name => ‘SCOTT.EMP,
streams_type => 'capture',
streams_name => 'STREAMS_CAPTURE',
queue_name => 'strmadmin.STREAMS_QUEUE_ORCL_
include_dml => true,
include_ddl => true,
inclusion_rule => true);
END;
/
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_
table_name => ‘SCOTT.DEPT’,
streams_type => 'capture',
streams_name => 'STREAMS_CAPTURE',
queue_name => 'strmadmin.STREAMS_QUEUE_ORCL_
include_dml => true,
include_ddl => true,
inclusion_rule => true);
END;
/
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_
table_name => 'sanjay.TENDER_HDR_TBL',
streams_type => 'capture',
streams_name => 'STREAMS_CAPTURE',
queue_name => 'strmadmin.STREAMS_QUEUE_ORCL_
include_dml => true,
include_ddl => true,
inclusion_rule => true);
END;
/
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_
table_name => 'sanjay.TENDER_DTL_TBL',
streams_type => 'capture',
streams_name => 'STREAMS_CAPTURE',
queue_name => 'strmadmin.STREAMS_QUEUE_ORCL_
include_dml => true,
include_ddl => true,
inclusion_rule => true);
END;
/
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_
table_name => 'sanjay.VENDORS_TRADE_GP',
streams_type => 'capture',
streams_name => 'STREAMS_CAPTURE',
queue_name => 'strmadmin.STREAMS_QUEUE_ORCL_
include_dml => true,
include_ddl => true,
inclusion_rule => true);
END;
/
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_
table_name => 'sanjay.TRADEGRP',
streams_type => 'capture',
streams_name => 'STREAMS_CAPTURE',
queue_name => 'strmadmin.STREAMS_QUEUE_ORCL_
include_dml => true,
include_ddl => true,
inclusion_rule => true);
END;
/
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_
table_name => 'sanjay.TRADEGRP',
streams_type => 'capture',
streams_name => 'STREAMS_CAPTURE',
queue_name => 'strmadmin.STREAMS_QUEUE_ORCL_
include_dml => true,
include_ddl => true,
inclusion_rule => true);
END;
/
--By default streams retention time is 64 days, set this to a realistic value 7 days.
begin
dbms_capture_adm.alter_
capture_name => 'STREAMS_CAPTURE',
checkpoint_retention_time => 7);
end;
/
--set checkpoint frequency to 1000
begin
DBMS_CAPTURE_ADM.SET_PARAMETER
('STREAMS_CAPTURE', '_checkpoint_frequency','1000'
end;
/
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_
table_name =>’SCOTT.EMP’,
streams_name => 'STREAMS_PROPAGATE',
source_queue_name => 'strmadmin.STREAMS_QUEUE_ORCL_
destination_queue_name => 'strm.STREAMS_QUEUE_ORCL_
include_dml => true,
include_ddl => true,
source_database => 'SANJAY',
inclusion_rule => true);
END;
/
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_
table_name =>’SCOTT.DEPT’,
streams_name => 'STREAMS_PROPAGATE',
source_queue_name => 'strmadmin.STREAMS_QUEUE_ORCL_
destination_queue_name => 'strm.STREAMS_QUEUE_ORCL_
include_dml => true,
include_ddl => true,
source_database => 'SANJAY',
inclusion_rule => true);
END;
/
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_
table_name => 'sanjay.TENDER_HDR_TBL',
streams_name => 'STREAMS_PROPAGATE',
source_queue_name => 'strmadmin.STREAMS_QUEUE_ORCL_
destination_queue_name => 'strm.STREAMS_QUEUE_ORCL_
include_dml => true,
include_ddl => true,
source_database => 'SANJAY',
inclusion_rule => true);
END;
/
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_
table_name => 'sanjay.TENDER_DTL_TBL',
streams_name => 'STREAMS_PROPAGATE',
source_queue_name => 'strmadmin.STREAMS_QUEUE_ORCL_
destination_queue_name => 'strm.STREAMS_QUEUE_ORCL_
include_dml => true,
include_ddl => true,
source_database => 'SANJAY',
inclusion_rule => true);
END;
/
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_
table_name => 'sanjay.VENDORS_TRADE_GP',
streams_name => 'STREAMS_PROPAGATE',
source_queue_name => 'strmadmin.STREAMS_QUEUE_ORCL_
destination_queue_name => 'strm.STREAMS_QUEUE_ORCL_
include_dml => true,
include_ddl => true,
source_database => 'SANJAY',
inclusion_rule => true);
END;
/
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_
table_name => 'sanjay.TRADEGRP',
streams_name => 'STREAMS_PROPAGATE',
source_queue_name => 'strmadmin.STREAMS_QUEUE_ORCL_
destination_queue_name => 'strm.STREAMS_QUEUE_ORCL_
include_dml => true,
include_ddl => true,
source_database => 'SANJAY',
inclusion_rule => true);
END;
/
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_
table_name => 'sanjay.VENDORS',
streams_name => 'STREAMS_PROPAGATE',
source_queue_name => 'strmadmin.STREAMS_QUEUE_ORCL_
destination_queue_name => 'strm.STREAMS_QUEUE_ORCL_
include_dml => true,
include_ddl => true,
source_database => 'SANJAY',
inclusion_rule => true);
END;
/
BEGIN
DBMS_CAPTURE_ADM.PREPARE_
DBMS_CAPTURE_ADM.PREPARE_
DBMS_CAPTURE_ADM.PREPARE_
DBMS_CAPTURE_ADM.PREPARE_
DBMS_CAPTURE_ADM.PREPARE_
DBMS_CAPTURE_ADM.PREPARE_
DBMS_CAPTURE_ADM.PREPARE_
END;
/
DECLARE
iscn NUMBER;
BEGIN
iscn:=DBMS_FLASHBACK.GET_
DBMS_APPLY_ADM.SET_TABLE_
source_object_name => 'SANJAY.TENDER_HDR_TBL',
source_database_name => 'SANJAY',
instantiation_scn => iscn);
DBMS_APPLY_ADM.SET_TABLE_
source_object_name => 'SANJAY.TENDER_DTL_TBL',
source_database_name => 'SANJAY',
instantiation_scn => iscn);
DBMS_APPLY_ADM.SET_TABLE_
source_object_name => 'SANJAY.VENDORS_TRADE_GP',
source_database_name => 'SANJAY',
instantiation_scn => iscn);
DBMS_APPLY_ADM.SET_TABLE_
source_object_name => 'SANJAY.TRADEGRP',
source_database_name => 'SANJAY',
instantiation_scn => iscn);
DBMS_APPLY_ADM.SET_TABLE_
source_object_name => 'SANJAY.VENDORS',
source_database_name => 'SANJAY',
instantiation_scn => iscn);
DBMS_APPLY_ADM.SET_TABLE_
source_object_name => 'SCOTT.EMP',
source_database_name => 'SANJAY',
instantiation_scn => iscn);
DBMS_APPLY_ADM.SET_TABLE_
source_object_name => 'SCOTT.DEPT',
source_database_name => 'SANJAY',
instantiation_scn => iscn);
END;
/
BEGIN
DBMS_CAPTURE_ADM.START_
capture_name =>
'STREAMS_CAPTURE');
END;
/
No comments:
Post a Comment