0

I want to automate the export process which I take using expdp command in Oracle.

Following is the contents of batch file I have created to open PuTTY.

@echo off

"C:\Program Files\PuTTY\plink.exe" username@Ip_Addr -pw password -m Open_Putty.txt`

Following is the contents of Open_Putty.txt to execute different commands.

echo $ORACLE_SID;

Read oraenv;

But after opening Open_Putty.bat it disappears without showing any output. Please help me with this. I want to set oraenv and run some more commands to take the backup.

1 Answer 1

4

It's unlikely that plink.exe disappears without showing any output. I assume you execute the batch file from a Windows Explorer or other GUI application, so the Plink console window disappears once Plink finishes (possibly with error) and you cannot read the output (error).

Make sure you execute plink.exe from a console window (typically a cmd.exe) or add pause command to the end of the batch.


Make sure Plink can find the script file (Open_Putty.txt). As you do not specify a path to the file, it has to be located in your current working directory. Safer is to use a full path to the script file:

"C:\Program Files\PuTTY\plink.exe" username@Ip_Addr -pw password -m "C:\path\Open_Putty.txt"

The backtick symbol at the end of the command should probably not be there.


The name "Open PuTTY" is bit confusing. You are not using PuTTY at all. And even if you refer to Plink by "PuTTY", your script file (Open_Putty.txt) is not opening PuTTY nor Plink. It's executing remote commands. So you should better name it export.txt or similar.

Not the answer you're looking for? Browse other questions tagged or ask your own question.