Share via

Replication without SQL Agent

HarryNangle-2823 1 Reputation point
2021-03-15T12:21:12.497+00:00

Hi.

The site I am working at uses SQL2016 Std Ed and does not enable the SQL Agent. Scheduled tasks such as backups etc are run centrally from a 3rd party app.

I would like to set up transactional replication.

Most of the SQL Agent jobs that are created are essentially T-SQL tasks, using the TSQL subsystem in SQL Agent to issue EXEC <sproc> commands. However, 3 jobs - the LogReader Agent, Snapshot Agent and Distribution Agent - use the 'LogReader', 'Snapshot' and 'Distribution' subsystems. So these are not simply issuing EXEC <sproc> commands. For example:

the Snapshot Agent Job has 3 steps - steps 1 and 3 use TSQL but step 2 uses the Snapshot subsystem:

Step 1
Name: Snapshot Agent startup message.
Subsystem: TSQL
Command: sp_MSadd_snapshot_history @perfmon_increment = 0, @agent_id = 1, @runstatus = 1, @comments = N'Starting agent.'

Step 2
Name: Run agent.
Subsystem: Snapshot
Command: -Publisher [SQL01] -PublisherDB [pubdb] -Distributor [SQL02] -Publication [mypub] -DistributorSecurityMode 1

Step 3
Name: Detect nonlogged agent shutdown.
Subsystem: TSQL
Command: sp_MSdetect_nonlogged_shutdown @subsystem = 'Snapshot', @agent_id = 1

My question is: without enabling the SQL Server Agent (to be clear: not just disabling the jobs, but disabling the SQL Agent service itself after the initial setup) is it possible to run these replication tasks? Perhaps using PowerShell etc?

Many thanks for any help!

SQL Server | Other

1 answer

Sort by: Most helpful
  1. Tom Phillips 17,786 Reputation points
    2021-03-15T16:30:07.963+00:00

    Although you probably can technically do it without SQL Agent, by duplicating the jobs in something else, I would highly recommend against it.

    This is built-in functionality which MS expects to be used with SQL Agent. It is likely some processes like updates will fail if it detects replication is installed, but SQL Agent is disabled.

    Also, there are several replication related jobs created, not just the subscription jobs. You would need to duplicate all of them.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.