Home » Open Source » Programming Interfaces » Unable to login to Oracle databse from perl script (SunOS, Oracle 10.2.0)
icon5.gif  Unable to login to Oracle databse from perl script [message #333079] Thu, 10 July 2008 08:03 Go to next message
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 #333110 is a reply to message #333079] Thu, 10 July 2008 09:18 Go to previous messageGo to next message
Michel Cadot
Messages: 57613
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
DBI and DBD versions?

Regards
Michel
Re: Unable to login to Oracle databse from perl script [message #333120 is a reply to message #333110] Thu, 10 July 2008 09:40 Go to previous messageGo to next message
sptr
Messages: 4
Registered: July 2008
Location: India/Bangalore
Junior Member
Hi Michel,

DBI version is 1.08
DBD version is 0.61


Thanks
Re: Unable to login to Oracle databse from perl script [message #333172 is a reply to message #333120] Thu, 10 July 2008 12:31 Go to previous messageGo to next message
Michel Cadot
Messages: 57613
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I think your versions are too old for Oracle 10g.
I use:
Perl 5.8.8
DBI 1.58
DBD 1.17
This works fine.

Regards
Michel
Re: Unable to login to Oracle databse from perl script [message #333321 is a reply to message #333172] Fri, 11 July 2008 04:21 Go to previous messageGo to next message
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 #333379 is a reply to message #333321] Fri, 11 July 2008 07:50 Go to previous messageGo to next message
Michel Cadot
Messages: 57613
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
With ORA-03113 there likely is a trace file, check it, otherwise you have to follow:
ORA-03113: end-of-file on communication channel
 *Cause: The connection between Client and Server process was broken.
 *Action: There was a communication error that requires further investigation.
          First, check for network problems and review the SQL*Net setup.
          Also, look in the alert.log file for any errors. Finally, test to
          see whether the server process is dead and whether a trace file
          was generated at failure time.

And/or call Oracle support.

Regards
Michel
Re: Unable to login to Oracle databse from perl script [message #333747 is a reply to message #333379] Mon, 14 July 2008 06:13 Go to previous messageGo to next message
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?
Re: Unable to login to Oracle databse from perl script [message #333750 is a reply to message #333747] Mon, 14 July 2008 06:20 Go to previous message
Michel Cadot
Messages: 57613
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
No, and nor directory naming if you don't use a ldap and nor host naming if you only use tnsnames.ora...

Regards
Michel
Previous Topic: Oracle Migration Workbench Error
Next Topic: Oracle in OraHome92
Goto Forum:
  


Current Time: Sun Apr 20 09:48:26 CDT 2014

Total time taken to generate the page: 0.09896 seconds