1 Reply Latest reply: May 12, 2014 11:45 PM by Renu-Oracle RSS

    Oracle streams: few rows should not replicate

    1365779

      Hello everyone,

       

      I have a requirement that only few rows should not be part of replication.

       

      Example:

      SOurce.                          Target.

      table A.                          Table A

      C1.    C2.                        C1.  C2.

      -----   -------                     ------  ------

      1         A                           1      A

      2         B                           2      B

      3         C                           3      C

       

      In my situation, we are having a bi-directional replication.

      UPdate A where c1=1; this row should never be replicated.

      UPdate A where c1=2; should work

      UPdate A where c1=3;should work


      these updates will be done by the application we are using. 

      I Know the concept of tags.  But as far as I know can we use something similar as the tags in order not to replicate only few specific rows Or do we any specific procedure which will not allows streams to replicate these records or can we set the tag permanently.


      Db version 11.2.0.2.0


      PLease let me know if you need more informatioN.




      THanks in advance,

      harsha



        • 1. Re: Oracle streams: few rows should not replicate
          Renu-Oracle

          Hi Harsha,

           

          You can use set_tag.

           

          Every redo entry in the redo log has a tagassociated with it.

          You can control the value of the tags generated in the redo log in the following ways:

          1. Use the DBMS_STREAMS.SET_TAG procedure to specify the value of the redo tags generated in the current session. When a database change is made in the session, the tag becomes part of the redo entry that records the change. Different sessions can have the same tag setting or different tag settings.

          2. Use the CREATE_APPLY or ALTER_APPLY procedure in the DBMS_APPLY_ADM package to control the value of the redo tags generated when an apply process runs. All sessions coordinated by the apply process coordinator use this tag setting. By default, redo entries generated by an apply process have a tag value that is the hexadecimal equivalent of '00' (double zero).


          You may also configure DML handlers to discard any changes at apply.


          Thanks,

          Renu