Hi,

Please forgive the quality of this post. I'm new to Perl, DBI and this list server.

I'm working in an Oracle Apps v11.03, partitioned environment. The database is v 
8.1.6, the application tier is using v 8.0.6. The application tier account owns the 
batch scheduling mechanism.

As the database account I'm able to run the code below and successfully connect to 
databases on both local and remote servers.

As the application tier owner I receive the following error:

DBI->connect(voyagerERP4) failed: ERROR OCIEnvInit at ./dbtest.pl line 5
Can't connect to Oracle database: ERROR OCIEnvInit

Note that I have no problems connecting to these databases via sqlplus foo/bar@<SID>

I (think) I understand that this is a function of the invoking environment and have 
been modifying:

ORACLE_HOME
PATH
LD_LIBRARY_PATH
TWO_TASK

But, I can't seem to figure out the specific variables impacting the script. Has 
anyone experienced this ?


#!/bin/perl -w
use DBI;
my $db  = $ARGV[0];

my $dbh = DBI->connect( "dbi:Oracle:$db", "foo", "bar" )
        or die "Can't connect to Oracle database: $DBI::errstr\n";
my $stamt = $dbh->prepare("select name from v\$database");
$stamt->execute();
my @name = $stamt->fetchrow_array();
print @name, "\n";
$stamt->finish;
$dbh->disconnect
        or warn "Disconnection failed: $DBI::errstr\n";

Thanks
Ken Friday
Artesyn Communication Products
8310 Excelsior Dr.
Madison, WI 53717
608.826.8229
[EMAIL PROTECTED]

Reply via email to