Perl Oracle Connectivity problem

Perl Oracle Connectivity problem

Post by Priy » Thu, 13 Dec 2001 11:47:30



Hi,

 Environment are as follows

 I am using

 1)Installed activeperl in windows 2000.
 2)Oracle database in the solaris server 192.168.128.58
 3)Installed Net8 in my system (windows 2000) & configured to oracle
 server as service name "hpdb"

 I set the environment variable TWO_TASK as (T:192.168.128.58:hpdb) in
 windows 2000.




 Here is my code for connecting to oracle.

 #!perl

 use CGI;
 use DBI;
 use DBD::Oracle;
 BEGIN {
      $ENV{ORACLE_HOME} = 'C:/ORACLE/ORA81';
      $ENV{TWO_TASK}    = 'T:192.168.128.58:hpdb';
   }

 print "content-type: text/html\n\n";

 my $dbh=DBI->connect("dbi:Oracle:hpdb", "system", "manager");
 unless (defined $dbh) {
         print "Cannot connect to server: $DBI::errstr\n";
         die;
 }

 I am getting "Cannot connect to server: ORA-12640: Authentication
 adapter initialization failed (DBD: login failed) "

 What is the possible solution to resolve this issue? Where is the exact
 problem lies?

 Thanks in advance.

 With regards,
 Priya

 
 
 

Perl Oracle Connectivity problem

Post by Ron Reid » Thu, 13 Dec 2001 13:32:53



> Hi,

>  Environment are as follows

>  I am using

>  1)Installed activeperl in windows 2000.
>  2)Oracle database in the solaris server 192.168.128.58
>  3)Installed Net8 in my system (windows 2000) & configured to oracle
>  server as service name "hpdb"

>  I set the environment variable TWO_TASK as (T:192.168.128.58:hpdb) in
>  windows 2000.




>  Here is my code for connecting to oracle.

>  #!perl

>  use CGI;
>  use DBI;
>  use DBD::Oracle;
>  BEGIN {
>       $ENV{ORACLE_HOME} = 'C:/ORACLE/ORA81';
>       $ENV{TWO_TASK}    = 'T:192.168.128.58:hpdb';
>    }

>  print "content-type: text/html\n\n";

>  my $dbh=DBI->connect("dbi:Oracle:hpdb", "system", "manager");
>  unless (defined $dbh) {
>          print "Cannot connect to server: $DBI::errstr\n";
>          die;
>  }

>  I am getting "Cannot connect to server: ORA-12640: Authentication
>  adapter initialization failed (DBD: login failed) "

>  What is the possible solution to resolve this issue? Where is the exact
>  problem lies?

>  Thanks in advance.

>  With regards,
>  Priya

According to the error docs, you need to enable tns tracing to determine
the error.

However, did you try connecting without using TWO_TASK (i.e. using
tnsnames.ora to connect)?  Note this means you will need to unset
TWO_TASK from your environment and set ORACLE_SID.
--
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.