<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Switching from Direct Replication Path to Logstream Without Reloading Data in Qlik Replicate</title>
    <link>https://community.qlik.com/t5/Qlik-Replicate/Switching-from-Direct-Replication-Path-to-Logstream-Without/m-p/2485574#M12903</link>
    <description>&lt;P&gt;Thank you for your support&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/127219"&gt;@TomaszRomanowski&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Oct 2024 10:57:04 GMT</pubDate>
    <dc:creator>john_wang</dc:creator>
    <dc:date>2024-10-07T10:57:04Z</dc:date>
    <item>
      <title>Switching from Direct Replication Path to Logstream Without Reloading Data</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Switching-from-Direct-Replication-Path-to-Logstream-Without/m-p/2484596#M12862</link>
      <description>&lt;P&gt;Hello Qlik Community,&lt;/P&gt;
&lt;P&gt;I have an environment with many large tables that are replicated using CDC. The source is MSSQL (using default MS-REPLICATION) and the target is Oracle. I want to switch this replication to use Logstream because I plan to add extra targets.&lt;/P&gt;
&lt;P&gt;When I attempt to switch to using Logstream (via Run → Resume Processing), I encounter the following error:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;E: Position does not exist [1002510] (at_audit_reader.c:642)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I understand that this error has already been discussed in the forum. Therefore, I want to use &lt;STRONG&gt;Run → Advanced Run Options&lt;/STRONG&gt; to specify &lt;STRONG&gt;Date and Time&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;My key question is: How can I determine the correct &lt;STRONG&gt;Date and Time&lt;/STRONG&gt; to avoid any &lt;U&gt;duplicates&lt;/U&gt; or &lt;U&gt;gaps&lt;/U&gt; in the data?&lt;/P&gt;
&lt;P&gt;I attempted to use the table &lt;STRONG&gt;attrep_status&lt;/STRONG&gt;, which has a column &lt;STRONG&gt;source_timestamp_applied&lt;/STRONG&gt;. According to the documentation:&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;This is the timestamp of the last transaction committed. In a bulk apply, this will be the timestamp for the commit of the last transaction in that batch. It will only be changed as part of the last transaction in the batch&lt;/EM&gt;."&lt;/P&gt;
&lt;P&gt;Therefore I stop my job, reconfigure source endpoint (to use logstream), before setting the &lt;STRONG&gt;Date and Time&lt;/STRONG&gt;, I check the value of &lt;STRONG&gt;source_timestamp_applied&lt;/STRONG&gt; and &lt;STRONG&gt;add 1 second&lt;/STRONG&gt;. And I run job.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Am I doing this correctly? Is there a better procedure to avoid duplicates and gaps in the data without reloading data?&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;Thank you for your assistance.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 09:38:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Switching-from-Direct-Replication-Path-to-Logstream-Without/m-p/2484596#M12862</guid>
      <dc:creator>TomaszRomanowski</dc:creator>
      <dc:date>2024-10-01T09:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Switching from Direct Replication Path to Logstream Without Reloading Data</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Switching-from-Direct-Replication-Path-to-Logstream-Without/m-p/2484628#M12863</link>
      <description>&lt;P&gt;I had a similar circumstance a few months back.&amp;nbsp; However, my target was another SQL Server, so I was able to use the tablediff.exe available from Microsoft.&amp;nbsp; I don't believe it works with sources/targets other than MS-SQL.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My approach was to wait until there was no active transactions and use the resume task from whenever the log stream task started.&lt;/P&gt;
&lt;P&gt;I don't believe you'll get duplicates since Qlik checks the PK.&amp;nbsp; And I believe the only way to check for gaps would be some type of mechanism like tablediff or Redgate.&amp;nbsp; A tablecount isn't necessarily accurate as it won't account for data differences.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 11:49:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Switching-from-Direct-Replication-Path-to-Logstream-Without/m-p/2484628#M12863</guid>
      <dc:creator>PGN</dc:creator>
      <dc:date>2024-10-01T11:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: Switching from Direct Replication Path to Logstream Without Reloading Data</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Switching-from-Direct-Replication-Path-to-Logstream-Without/m-p/2484820#M12867</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;
&lt;P&gt;However, in an environment with a large number of substantial tables running &lt;STRONG&gt;24/7&lt;/STRONG&gt;, it becomes complicated to verify if the data is synchronized.&lt;/P&gt;
&lt;P&gt;&amp;gt;&lt;STRONG style="font-family: inherit;"&gt;I don't believe you'll get duplicates since Qlik checks the PK.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;In the case of inserts, if duplicates occur, I will have rows in the exceptions table. But what happens with updates and deletes? This could lead to data inconsistency.&lt;/P&gt;
&lt;P&gt;Therefore, I would like to know if I can use the &lt;STRONG&gt;attrep_status&lt;/STRONG&gt; table and the &lt;STRONG&gt;source_timestamp_applied&lt;/STRONG&gt; column to ensure that the data is in sync. I'm certain that someone else has encountered the same issue as I have.&lt;/P&gt;
&lt;P&gt;Any insights or suggestions would be greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 08:05:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Switching-from-Direct-Replication-Path-to-Logstream-Without/m-p/2484820#M12867</guid>
      <dc:creator>TomaszRomanowski</dc:creator>
      <dc:date>2024-10-02T08:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Switching from Direct Replication Path to Logstream Without Reloading Data</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Switching-from-Direct-Replication-Path-to-Logstream-Without/m-p/2484874#M12868</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/127219"&gt;@TomaszRomanowski&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Without losing any changes, you should use the &lt;STRONG&gt;SOURCE_TAIL_POSITION&lt;/STRONG&gt; or &lt;STRONG&gt;SOURCE_TAIL_TIMESTAMP&lt;/STRONG&gt; from the attrep_status table. These two columns store the oldest start transaction that is still not committed. I would suggest setting the value a bit earlier.&lt;BR /&gt;&lt;BR /&gt;Since duplicates occur, you may encounter duplicate record error (INSERT) and record not found (UPDATE/DELETE) error, but these error will be written into the attrep_apply_exceptions table, depends on your task settings.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Desmond&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 11:52:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Switching-from-Direct-Replication-Path-to-Logstream-Without/m-p/2484874#M12868</guid>
      <dc:creator>DesmondWOO</dc:creator>
      <dc:date>2024-10-02T11:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Switching from Direct Replication Path to Logstream Without Reloading Data</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Switching-from-Direct-Replication-Path-to-Logstream-Without/m-p/2485479#M12901</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/127219"&gt;@TomaszRomanowski&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;In general startup from LSN is more accurate than TIMESTAMP because there are chance multiple transactions occurs in the same second. However &lt;STRONG&gt;&lt;EM&gt;manually&lt;/EM&gt; &lt;/STRONG&gt;startup task from both LSN and TIMESTAMP cannot guarantee no duplicates nor gaps, unless there are other factors to meet your needs. This is completely different from resuming a task. The '&lt;STRONG&gt;&lt;EM&gt;RESUME&lt;/EM&gt;&lt;/STRONG&gt;' task function does not apply to the behavior described below.&lt;/P&gt;
&lt;P&gt;This is not Qlik Replicate defect or bad design, but it's RDBMS common behavior. Assume we have below transactions in source DB:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;LSN&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;Transactions&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;Transaction Timestamp&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;100&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;(trxID=1) UPDATE TABLE ... A&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;01:00:00 PM&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="46px"&gt;200&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="46px"&gt;(trxID=2) INSERT INTO TABLE B ...&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="46px"&gt;02:00:00 PM&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;300&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;(trxID=2) COMMIT&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;03:00:00 PM&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;400&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;&lt;STRONG&gt;Changes applied &amp;amp; Task STOP&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;04:00:00 PM&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;500&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;(trxID=1) COMMIT&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;05:00:00 PM&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Assume the task stopped after TrxID=2 was applied on the target side. Now, if we restart the task:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;If we start from the 4PM timestamp&lt;/STRONG&gt;: The transaction is incomplete, and Replicate will discard it, causing TrxID=1 to be lost.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;If we start from LSN 400&lt;/STRONG&gt;: The same issue occurs. To avoid data loss, Qlik Replicate should start from LSN 100 or the 1PM timestamp ("begin Transaction" of trxID=1). However, in doing so, TrxID=2 will be processed twice, leading to duplicate records on the target.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;In short, it’s difficult to ensure no duplicates or gaps by simply restarting from a specific stream position. To handle this:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;STRONG&gt;If possible, start the task earlier than TrxID=2&lt;/STRONG&gt; to capture the complete transaction. For more information please check&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/replicate/May2024/Content/Replicate/Main/Control%20Tables/replication_status.htm#ar_control_tables_553656663_1336339:~:text=the%20SOURCE_CURRENT_TIMESTAMP%20column.-,SOURCE_TAIL_POSITION,to%2C%20without%20losing%20any%20changes.%20There%20may%2C%20of%20course%2C%20be%20duplicates.,-SOURCE_TIMESTAMP_APPLIED" target="_blank"&gt;SOURCE_TAIL_POSITION and&amp;nbsp;SOURCE_TAIL_TIMESTAMP&lt;/A&gt;. As Desmond said,&amp;nbsp;&lt;SPAN&gt;Without losing any changes, you should use the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;SOURCE_TAIL_POSITION&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;or&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;SOURCE_TAIL_TIMESTAMP&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;from the attrep_status table.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;If the table has a Primary Key (PK) or Unique Index (UI)&lt;/STRONG&gt;, set the task to &lt;A title="UPSERT mode" href="https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-Implementing-UPSERT-and-MERGE-modes-by-applying-a/tac-p/2485474#M14729" target="_blank" rel="noopener"&gt;UPSERT mode&lt;/A&gt; to prevent duplicates. You may get warning:&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Source changes that would have had no impact were not applied to the target database. Refer to the 'attrep_apply_exceptions' table for details.&lt;/FONT&gt; This is expected behavior.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;If the table has not Primary Key (PK) or Unique Index (UI)&lt;/STRONG&gt;, or you are using &lt;STRONG&gt;Store Changes&lt;/STRONG&gt; table, you will get duplicates in target tables.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;I hope this clarifies the process.&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Oct 2024 13:31:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Switching-from-Direct-Replication-Path-to-Logstream-Without/m-p/2485479#M12901</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2024-10-06T13:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Switching from Direct Replication Path to Logstream Without Reloading Data</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Switching-from-Direct-Replication-Path-to-Logstream-Without/m-p/2485532#M12902</link>
      <description>&lt;P&gt;Thank you for your clarification.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 07:25:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Switching-from-Direct-Replication-Path-to-Logstream-Without/m-p/2485532#M12902</guid>
      <dc:creator>TomaszRomanowski</dc:creator>
      <dc:date>2024-10-07T07:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Switching from Direct Replication Path to Logstream Without Reloading Data</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Switching-from-Direct-Replication-Path-to-Logstream-Without/m-p/2485574#M12903</link>
      <description>&lt;P&gt;Thank you for your support&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/127219"&gt;@TomaszRomanowski&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 10:57:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Switching-from-Direct-Replication-Path-to-Logstream-Without/m-p/2485574#M12903</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2024-10-07T10:57:04Z</dc:date>
    </item>
  </channel>
</rss>

