Quantcast
Channel: SQL Server Manageability forum
Viewing all articles
Browse latest Browse all 1519

Run Log Shipping Programmatically

$
0
0

A few weeks back I posed a question about running Log Shipping inside a Trigger. Here is essentially a follow up to that question [ https://social.msdn.microsoft.com/Forums/sqlserver/en-US/9f994c51-7c98-411b-afbd-1f513ac5f62b/can-i-use-a-trigger-to-start-transaction-log-shipping?forum=sqlkjmanageability ]

There are three jobs that comprise this Log Shipping process.
   1. LSBackup_Job1     (creates .bak file from database #1 on primary Server A)
   2. LSCopy_Job2         (moves .bak file from primary Server A to secondary Server B)
   3. LSRestore_Job3     (restores .bak file to database #2 on secondary Server B)

I would like to kick the first job off from a Trigger in a table (upon Insert) on database #1 on the Primary server.  (answer provided by dave_gona)
i.e. exec msdb..sp_start_job @job_name= 'LSBackup_Job1'    

When this finishes I would like to kick off Job2 an then Job3.  The question is, can this be possible after the first EXEC commands inside the trigger on Server A considering that this LS process encompasses two servers? 

Brian



Viewing all articles
Browse latest Browse all 1519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>