Created
February 17, 2017 13:17
-
-
Save nickwhite917/18b76cc8cdd2befe55cd5d9452e1d789 to your computer and use it in GitHub Desktop.
Execute a DAC Execution Plan from C# using SSH.NET
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using Renci.SshNet; | |
| namespace SSH_Net | |
| { | |
| class Program | |
| { | |
| private const string Dev_Host = "hostname"; | |
| private const string Dev_User = "usern"; | |
| private const string Dev_Pass = "pass"; | |
| private const string Dev_EP_Name = "EP Name Here"; | |
| private const string Test_Host = ""; | |
| private const string Prod_Host = ""; | |
| static void Main() | |
| { | |
| ExecuteInformaticaWorkflow(Dev_Host, Dev_User, Dev_Pass, Dev_EP_Name); | |
| } | |
| private static void ExecuteInformaticaWorkflow(string host, string username, string password, string epName) | |
| { | |
| SshClient cSSH = new SshClient(host, 22, username, password); | |
| cSSH.Connect(); | |
| SshCommand launchExecPlan = | |
| cSSH.RunCommand($"cd /oracle/dac11g && ./dacCmdLine.sh StartETL \"{epName}\""); | |
| cSSH.Disconnect(); | |
| cSSH.Dispose(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment