This project is read-only.

Unable to login at the second username and password in Oracle database

Aug 15, 2013 at 3:39 PM
Hello guys,

I need your help on my project, I used renci to connect to an oracle database (AIX) for data backup using "exp" command. I used C# .net code. I am stuck on logging in the second username and password after executing the "exp" command. This is my code:

string serverIP = "";
        PasswordConnectionInfo connectionInfo = new PasswordConnectionInfo(serverIP, "username", "password");

        using (var client = new SshClient(connectionInfo))

            if (client.IsConnected)
                using (var shellStream = client.CreateShellStream("dumb", 80, 24, 800, 600, 1024))
                    string reply = String.Empty;
                    var rep = shellStream.Expect("$");

                    shellStream.WriteLine("cd /Orarecovery");
                    rep = shellStream.Expect(new Regex(@"[$#]")); 
                    rep = shellStream.Expect("Username:");
                    shellStream.WriteLine("system"); // 2nd username
                    //richTextOutput.Text = rep;  // to be displayed at the form

The output on this is like this:

Export: Release - Production on Thu Aug 15 22:24:47 2013

Copyright (c) 1982, 2007, Oracle. All rights reserved.



** it seems that it will not write the username and password

Hope you can help me..Thank you