Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Filter data in Oracle Streams

Filter data in Oracle Streams

From: Ravi Gaur <ravigaur1_at_gmail.com>
Date: Fri, 27 Jul 2007 10:22:15 -0500
Message-ID: <289232290707270822n5d34ca88hbefdbb1ebef3eff6@mail.gmail.com>


I've a question for streams folks that have used data filtering during capture. We are using a downstream configuration and the logs from the source (living on a different host) are shipped and registered to the downstream db and changes captured.

I'm trying to apply a rule to filter data based on a column value. Specifically, this is the condition I want to apply in capture rules --

           substr(SSBSECT_TERM_CODE,6,1) in ('2','6','9')

I'm using "DBMS_STREAMS_ADM.ADD_SUBSET_RULES" (per Oracle Support's suggestion) but it errors out on capture (we use an Archive Log Downstream Capture architecture). It appears that this procedure looks for the existence of the table which doesn't really exist in the downstream database.
GCSTRDEV_SQL > BEGIN
2 DBMS_STREAMS_ADM.ADD_SUBSET_RULES(
3 table_name => 'SATURN.SSBSECT',
4 dml_condition => ' substr(SSBSECT_TERM_CODE,6,1) in (''2'',''6'',''9'') ', 5 streams_type => 'CAPTURE',
6 streams_name => 'STRM_CAPTURE_GC',
7 queue_name => 'STRM_CAPTURE_Q_GC');
8 END;
9 /
BEGIN
*
ERROR at line 1:

ORA-00942: table or view does not exist
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 1032
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 1181
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 1073
ORA-06512: at line 2

On the apply however it creates fine (since that is the target and the table exists there) --
GCDEV_SQL > BEGIN
2 DBMS_STREAMS_ADM.ADD_SUBSET_RULES(
3 table_name => 'SATURN.SSBSECT',
4 dml_condition => ' substr(SSBSECT_TERM_CODE,6,1) in (''2'',''6'',''9'') ', 5 streams_type => 'APPLY',
6 streams_name => 'STRM_APPLY_GC',
7 queue_name => 'STRM_APPLY_Q_GC');
8 END;
9 /

PL/SQL procedure successfully completed.

This adds 3 new rules to the list of rules for this table.

Questions:
1) How do I make this work for the capture side (so that we filter capture itself)?
2) Why is it adding 3 rules there (can be seen in dba_streams_table_rules)?

TIA

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Jul 27 2007 - 10:22:15 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US