Skip to content

Instantly share code, notes, and snippets.

@nickwhite917
Created February 17, 2017 13:17
Show Gist options
  • Select an option

  • Save nickwhite917/18b76cc8cdd2befe55cd5d9452e1d789 to your computer and use it in GitHub Desktop.

Select an option

Save nickwhite917/18b76cc8cdd2befe55cd5d9452e1d789 to your computer and use it in GitHub Desktop.
Execute a DAC Execution Plan from C# using SSH.NET
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