I have a perl script in which I setup the following env. variables:
delete @ENV{qw(ORACLE_BASE ORACLE_HOME PATH LD_LIBRARY_PATH HOME)};
$ENV{'ORACLE_BASE'} = "/fin01/app/oracle";
$ENV{'ORACLE_HOME'} = "/fin01/app/oracle/product/806";
$ENV{'PATH'} =
"/fin01/app/oracle/product/806/bin:.:/usr/bin:/usr/local/bin:/usr/ccs/bin:/opt/EMCpower/bin:/etc:/bin/:
/usr/sbin:/usr/ccs/bin:/usr/bin:/usr/ucb:/etc:/usr/openwin/bin:/usr/local/bin:/opt/VRTSvxfs/sbin:/usr/ccs/bin:/opt/bin";
$ENV{'LD_LIBRARY_PATH'} = "/fin01/app/oracle/product/806/lib";
$ENV{'HOME'} = "/fin01/app/oracle";
$ENV{'ORA_NLS33'} = "/fin01/app/oracle/product/806/ocommon/nls/admin/data";
when I print these values from the script everything is what it should
be (as set in the script) however when later in the program I try to
connect to an oracle database as in:
my $dbh = DBI->connect ("dbi:Oracle:$sid", $user, $password, {
PrintError => 0, RaiseError => 0 });
I get the following error:
PATH:
/fin01/app/oracle/product/806/bin:.:/usr/bin:/usr/local/bin:/usr/ccs/bin:/opt/EMCpower/bin:/etc:/bin/:/usr/sbin:/usr/ccs/bin:/usr/bin:/usr/ucb:/etc:/usr/openwin/bin:/usr/local/bin:/opt/VRTSvxfs/sbin:/usr/ccs/bin:/opt/bin
ORACLE_BASE: /fin01/app/oracle
ORACLE_HOME: /fin01/app/oracle/product/806
LD_LIBRARY_PATH: /fin01/app/oracle/product/806/lib:
install_driver(Oracle) failed: Can't load
'/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/auto/DBD/Oracle/Oracle..so'
for module DBD::Oracle: ld.so.1: /usr/local/bin/perl: fatal: relocation
error: file /umdw01/app/oracle/product/806/lib/libclntsh.so.1.0: symbol
slpmprodstab: referenced symbol not found at
/usr/local/lib/perl5/5.00503/sun4-solaris/DynaLoader.pm line 169.
at (eval 1) line 3
Perhaps a required shared library or dll isn't installed where expected
at /usr/local/bin/chg_um_pswd.pl line 52
Line 52 is the connect statement above
I don't know where the path "/umdw01/app/oracle/product/806/lib" is
coming from. The shell environment from which I run the script has the
umdw01 base, but everything is wiped out and reset from the script.
I have these variables set in a .profile and everything works fine when
I execute the startup .profile and run the script as oracle user, but I
need to be able to set these variables inside the script because the
script is being called from a bourne shell script that is being run as a
non-oracle user with different env. variables.
I appreciate any and all help.
-------------------------------------
Mahtaj Khamneian
University of Missouri - ASP Phone : (573) 884-2281
1805 East Walnut Fax : (573) 884-3070
Columbia, MO 65201-6425 [EMAIL PROTECTED]