Cannot access Linux Oracle Databse with Perl Script after connecting with PuTTY

by gauss76   Last Updated July 19, 2017 08:01 AM

I have the following problem: I currently connect to one of our Linux servers using PuTTY on my Windows 10 machine. If I use a ‘standard’ PuTTY connection I have no problem: I can log in and run my Perl script to access an Oracle database on the Linux server. However, recently I have set up a new PuTTY connection (I copied the original working copy used above). The only difference from the original is that I have entered the following in the section ‘Connection->SSH->Remote command’ of the PuTTY configuration window:

cd ../home/code/project1/scripts/perl ; /bin/bash

(I have done this so I arrive directly in the folder containing all my scripts.)

I can still log into the server with no problems and it takes me straight to the folder that contains my Perl scripts. However, when I run the script to access the Oracle database I get the following error:

DBI connect('server1/dbname','username',...) failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME (Linux) env var or PATH (Windows) and or NLS settings, permissions, etc. at line 10. impossible de se connecter à server1 / dbname at line 10, line 1.

In addition, if I run the 'env' command on the server the variable $ORACLE_HOME is not listed (If I run the same 'env' command on the server with the standard PuTTY connection the $ORACLE_HOME variable is present.)

Just to note: Running any other Perl script on the server (that does NOT access the Oracle database) through either of the PuTTY sessions I have created works with no problems.

Any help much appreciated.


Related Questions

Registering oracle 10g db with 12c grid

Updated March 24, 2017 09:01 AM

oracle 12c Installation Error

Updated April 22, 2018 10:01 AM