<?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>article Qlik Replicate: SQL replication jobs in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-SQL-replication-jobs/ta-p/1918955</link>
    <description>&lt;P&gt;If you use a non-sysadmin account to replicate data from SQL Source, then the DBA must update the owner of all SQL Server jobs belonging to ‘&lt;FONT face="courier new,courier"&gt;REPL%&lt;/FONT&gt;’ category to the SA account.&lt;/P&gt;
&lt;P&gt;Qlik Replicate will not create or manage any of the SQL Agent jobs. If SQL Replication is enabled to run CDC task using Qlik Replicate, then as a prerequisite Distribution must be enabled on SQL server level and publication will be created for each database which Qlik replicate trying to replicate data from.&lt;/P&gt;
&lt;P&gt;If the below option is selected for the SQL Source endpoint, then sp_repldone is managed by SQL Server which is responsible for releasing the T-log space to the Operating system from time to time.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="start transactions in the database.png" style="width: 776px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/112748i05EA102490D1EF80/image-size/large?v=v2&amp;amp;px=999" role="button" title="start transactions in the database.png" alt="start transactions in the database.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Let’s discuss, what all SQL jobs will be created On SQL Server. All the jobs created to manage SQL Replication will be start with ‘&lt;FONT face="courier new,courier"&gt;REPL-&lt;/FONT&gt;‘ so it is easy to identify by its Job category.&lt;/P&gt;
&lt;P&gt;When we enable distribution on the server level, the below seven jobs will be created, and the Job owner will be whoever created the distributor. If DBA created the distributor, then their id will be the job owner.&amp;nbsp; This is one-time activity on SQL Server level.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SwathiPulagam_1-1650038499415.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/77214i77BC5E507908E0E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="SwathiPulagam_1-1650038499415.png" alt="SwathiPulagam_1-1650038499415.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;When we start Qlik Replicate task, it will create a publication and the publication will initiate two more SQL Jobs. One is &lt;FONT face="courier new,courier"&gt;QueueReader&lt;/FONT&gt; and the second one is &lt;FONT face="courier new,courier"&gt;Log Reader&lt;/FONT&gt;.&amp;nbsp; Only one &lt;FONT face="courier new,courier"&gt;QueueReader&lt;/FONT&gt; job will exist on the server, but &lt;FONT face="courier new,courier"&gt;LogReader&lt;/FONT&gt; will be created once per database and the Job owner for these jobs will be the id used in the Qlik Replicate UI.&lt;/P&gt;
&lt;P&gt;If we use test123 SQL id on the Qlik Replicate SQL endpoint, then for the below two jobs, test123 will be the owner. Test123 may or may not have &lt;FONT face="courier new,courier"&gt;sysadmin&lt;/FONT&gt; role depending on the requirement.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SwathiPulagam_2-1650038499430.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/77215i5CCD6EC680740013/image-size/large?v=v2&amp;amp;px=999" role="button" title="SwathiPulagam_2-1650038499430.png" alt="SwathiPulagam_2-1650038499430.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Suppose if SQL Server has 10 databases and Qlik Replicate is configured to replicate CDC data from three databases out of ten, then the below jobs will exist on server:&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;Seven SQL Jobs which created at the time of distribution creation&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;One &lt;FONT face="courier new,courier"&gt;QueueReader&lt;/FONT&gt; Agent Job created for the first publication (No &lt;FONT face="courier new,courier"&gt;QueueReader&lt;/FONT&gt; job will be created from the second publication onwards)&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Three &lt;FONT face="courier new,courier"&gt;LogReader&lt;/FONT&gt; Agent Jobs will be created with each publication Qlik Replicate initiate&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt;&amp;nbsp; It is recommended to have a sysadmin role for all replication SQL job owners.&lt;/P&gt;
&lt;P&gt;As a pre-requisite, as soon as we start running Qlik Replicate tasks, change the SQL Job owner ids to &lt;FONT face="courier new,courier"&gt;sa&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;The below script will generate a script to update all Qlik Replication job owners to &lt;FONT face="courier new,courier"&gt;sa&lt;/FONT&gt; account.&lt;/P&gt;
&lt;P&gt;Script:&lt;/P&gt;
&lt;PRE class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;SELECT&amp;nbsp; 'exec msdb..sp_update_job @job_name = '''+j.name + ''',@owner_login_name = ''sa'';'&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;FROM msdb.dbo.sysjobs J&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;INNER JOIN&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;sys.server_principals P&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ON J.owner_sid = P.sid where j.category_id between 10 and 20;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;PRE class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = 'Replication monitoring refresher for distribution.',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = 'Replication agents checkup',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = 'Agent history clean up: distribution',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = 'Reinitialize subscriptions having data validation failures',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = 'USREM-XYZ-AL_TEST-1',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = 'Expired subscription clean up',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = 'Distribution clean up: distribution',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = '[USREM-XYZ].6',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = 'Monitor and sync replication agent jobs',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jul 2023 08:59:40 GMT</pubDate>
    <dc:creator>SwathiPulagam</dc:creator>
    <dc:date>2023-07-21T08:59:40Z</dc:date>
    <item>
      <title>Qlik Replicate: SQL replication jobs</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-SQL-replication-jobs/ta-p/1918955</link>
      <description>&lt;P&gt;If you use a non-sysadmin account to replicate data from SQL Source, then the DBA must update the owner of all SQL Server jobs belonging to ‘&lt;FONT face="courier new,courier"&gt;REPL%&lt;/FONT&gt;’ category to the SA account.&lt;/P&gt;
&lt;P&gt;Qlik Replicate will not create or manage any of the SQL Agent jobs. If SQL Replication is enabled to run CDC task using Qlik Replicate, then as a prerequisite Distribution must be enabled on SQL server level and publication will be created for each database which Qlik replicate trying to replicate data from.&lt;/P&gt;
&lt;P&gt;If the below option is selected for the SQL Source endpoint, then sp_repldone is managed by SQL Server which is responsible for releasing the T-log space to the Operating system from time to time.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="start transactions in the database.png" style="width: 776px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/112748i05EA102490D1EF80/image-size/large?v=v2&amp;amp;px=999" role="button" title="start transactions in the database.png" alt="start transactions in the database.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Let’s discuss, what all SQL jobs will be created On SQL Server. All the jobs created to manage SQL Replication will be start with ‘&lt;FONT face="courier new,courier"&gt;REPL-&lt;/FONT&gt;‘ so it is easy to identify by its Job category.&lt;/P&gt;
&lt;P&gt;When we enable distribution on the server level, the below seven jobs will be created, and the Job owner will be whoever created the distributor. If DBA created the distributor, then their id will be the job owner.&amp;nbsp; This is one-time activity on SQL Server level.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SwathiPulagam_1-1650038499415.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/77214i77BC5E507908E0E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="SwathiPulagam_1-1650038499415.png" alt="SwathiPulagam_1-1650038499415.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;When we start Qlik Replicate task, it will create a publication and the publication will initiate two more SQL Jobs. One is &lt;FONT face="courier new,courier"&gt;QueueReader&lt;/FONT&gt; and the second one is &lt;FONT face="courier new,courier"&gt;Log Reader&lt;/FONT&gt;.&amp;nbsp; Only one &lt;FONT face="courier new,courier"&gt;QueueReader&lt;/FONT&gt; job will exist on the server, but &lt;FONT face="courier new,courier"&gt;LogReader&lt;/FONT&gt; will be created once per database and the Job owner for these jobs will be the id used in the Qlik Replicate UI.&lt;/P&gt;
&lt;P&gt;If we use test123 SQL id on the Qlik Replicate SQL endpoint, then for the below two jobs, test123 will be the owner. Test123 may or may not have &lt;FONT face="courier new,courier"&gt;sysadmin&lt;/FONT&gt; role depending on the requirement.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SwathiPulagam_2-1650038499430.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/77215i5CCD6EC680740013/image-size/large?v=v2&amp;amp;px=999" role="button" title="SwathiPulagam_2-1650038499430.png" alt="SwathiPulagam_2-1650038499430.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Suppose if SQL Server has 10 databases and Qlik Replicate is configured to replicate CDC data from three databases out of ten, then the below jobs will exist on server:&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;Seven SQL Jobs which created at the time of distribution creation&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;One &lt;FONT face="courier new,courier"&gt;QueueReader&lt;/FONT&gt; Agent Job created for the first publication (No &lt;FONT face="courier new,courier"&gt;QueueReader&lt;/FONT&gt; job will be created from the second publication onwards)&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Three &lt;FONT face="courier new,courier"&gt;LogReader&lt;/FONT&gt; Agent Jobs will be created with each publication Qlik Replicate initiate&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt;&amp;nbsp; It is recommended to have a sysadmin role for all replication SQL job owners.&lt;/P&gt;
&lt;P&gt;As a pre-requisite, as soon as we start running Qlik Replicate tasks, change the SQL Job owner ids to &lt;FONT face="courier new,courier"&gt;sa&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;The below script will generate a script to update all Qlik Replication job owners to &lt;FONT face="courier new,courier"&gt;sa&lt;/FONT&gt; account.&lt;/P&gt;
&lt;P&gt;Script:&lt;/P&gt;
&lt;PRE class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;SELECT&amp;nbsp; 'exec msdb..sp_update_job @job_name = '''+j.name + ''',@owner_login_name = ''sa'';'&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;FROM msdb.dbo.sysjobs J&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;INNER JOIN&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;sys.server_principals P&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ON J.owner_sid = P.sid where j.category_id between 10 and 20;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;PRE class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = 'Replication monitoring refresher for distribution.',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = 'Replication agents checkup',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = 'Agent history clean up: distribution',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = 'Reinitialize subscriptions having data validation failures',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = 'USREM-XYZ-AL_TEST-1',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = 'Expired subscription clean up',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = 'Distribution clean up: distribution',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = '[USREM-XYZ].6',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;exec msdb..sp_update_job @job_name = 'Monitor and sync replication agent jobs',@owner_login_name = 'sa';&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 08:59:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-SQL-replication-jobs/ta-p/1918955</guid>
      <dc:creator>SwathiPulagam</dc:creator>
      <dc:date>2023-07-21T08:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: SQL- Replication jobs</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-SQL-replication-jobs/tac-p/1918991#M6130</link>
      <description>&lt;P&gt;Hi Swathi,&lt;/P&gt;
&lt;P&gt;If&amp;nbsp;&lt;SPAN&gt;the user only has read only permission.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Is there a way to use this user to retrieve data without giving it sysadmin or db_owner access?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;BR /&gt;Naren&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2022 19:02:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-SQL-replication-jobs/tac-p/1918991#M6130</guid>
      <dc:creator>narendersarva</dc:creator>
      <dc:date>2022-04-15T19:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: SQL- Replication jobs</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-SQL-replication-jobs/tac-p/1918995#M6131</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/164978"&gt;@narendersarva&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To use a Microsoft SQL Server source in a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="mc-variable Replicate.Product variable"&gt;Qlik Replicate&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;task, the user specified in the Microsoft SQL Server&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://help.qlik.com/en-US/replicate/November2021/Content/Replicate/Main/SQL%20Server/SQLServerDB_DiaBox_source.htm" target="_blank"&gt;endpoint connection settings&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;can be either of the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;A member of both the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;db_owner&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;database role and the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;sysAdmin&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;fixed server role.&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;A member of the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;db_owner&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;database role but not a member of sysAdmin fixed server role.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Swathi&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2022 19:22:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-SQL-replication-jobs/tac-p/1918995#M6131</guid>
      <dc:creator>SwathiPulagam</dc:creator>
      <dc:date>2022-04-15T19:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: SQL- Replication jobs</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-SQL-replication-jobs/tac-p/1919014#M6132</link>
      <description>&lt;P&gt;Thank you Swathi.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2022 21:14:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-SQL-replication-jobs/tac-p/1919014#M6132</guid>
      <dc:creator>narendersarva</dc:creator>
      <dc:date>2022-04-15T21:14:44Z</dc:date>
    </item>
  </channel>
</rss>

