Unable to login to Oracle databse from perl script [message #333079] |
Thu, 10 July 2008 08:03 |
sptr
Messages: 4 Registered: July 2008 Location: India/Bangalore
|
Junior Member |
|
|
Hi,
In our application, we are trying to connect oracle database from perl script.We are trying to connect to a remote database. For this the SID is also set in TNSNAMES.ORA file.
We are able to connect the database with sqlplus from command prompt, but using Perl script we are unable to login.
So we have tried to make a small Perl script which can help to login to database.
Following is the test script,
*************************************************************************************
#!/opt/perl/bin/perl
use strict;
use DBI;
DBI->trace( 2, '/tmp/dbitrace.log');
my $user = $ENV{ORACLE_USER};
my $pass = $ENV{ORACLE_PASS};
my $sid = $ENV{ORACLE_SID};
print "Attempting connection: user='$user' password='$pass'
sid='$sid'\n";
my $dbh = DBI->connect("dbi:Oracle:$sid", $user, $pass)
or die "Failed to connect: $DBI::errstr\n";
print "Connected OK\n";
*************************************************************************************
It's result is coming like,
Attempting connection: user='urrp@URRP_STB' password='urrp712'
sid=''
DBI->connect failed: ORA-03113: end-of-file on communication channel (DBD: login failed) at oraDBD.pl line 22
Failed to connect: ORA-03113: end-of-file on communication channel (DBD: login failed)
And when we tried with this, "sqlplus $ORACLE_USER/$ORACLE_PASS"
it logged in.
Can anyone please throw some light on this problem, why we are unable to login with Perl script.
|
|
|
|
|
|
Re: Unable to login to Oracle databse from perl script [message #333321 is a reply to message #333172] |
Fri, 11 July 2008 04:21 |
sptr
Messages: 4 Registered: July 2008 Location: India/Bangalore
|
Junior Member |
|
|
Thanks Michel.
There is another point.We are facing this login problem while connecting to a remote databse(version 9.2.0.6.0). From our side the DB version is 10.2.0.3.0.
We also have a local database(version 10.2.0.3.0) & there we are able to login from perl script(with this version).
So I am not sure whether this can be a vesrion problem.
|
|
|
|
Re: Unable to login to Oracle databse from perl script [message #333747 is a reply to message #333379] |
Mon, 14 July 2008 06:13 |
sptr
Messages: 4 Registered: July 2008 Location: India/Bangalore
|
Junior Member |
|
|
Thanks Michel..I will check that.
One question Michel..I just ran this command "$ORACLE_HOME/bin/adapters"...& here I got some error.
Installed Oracle Net naming methods are:
Local Naming (tnsnames.ora)
Oracle Directory Naming
Oracle Host Naming
Error!!! Oracle Names Server Naming is not completely installed!
Do you think this "Oracle Names Server Naming" is needed for accessing remote database or it can be the error for which I am facing that problem?
|
|
|
|