Go to the FreeLists Home Page Home Signup Help Login
 



[oracle-l] || [Date Prev] [11-2006 Date Index] [Date Next] || [Thread Prev] [11-2006 Thread Index] [Thread Next]

Re: DBI - solved

  • From: genegurevich@xxxxxxxxxxxxxxxxxxxxx
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Wed, 1 Nov 2006 15:41:20 -0600
Jared,

Thank you. It turned out that everything worked as long as they used slash
(/) for the name as they were supposed
to.

thank you

Gene Gurevich



                                                                           
             "Jared Still"                                                 
             <jkstill@xxxxxxxx                                             
             m>                                                         To 
             Sent by:                  genegurevich@xxxxxxxxxxxxxxxxxxxxx  
             oracle-l-bounce@f                                          cc 
             reelists.org              oracle-l@xxxxxxxxxxxxx              
                                                                   Subject 
                                       Re: DBI ?                           
             11/01/2006 01:50                                              
             PM                                                            
                                                                           
                                                                           
             Please respond to                                             
             jkstill@xxxxxxxxx                                             
                                                                           
                                                                           




On 11/1/06, genegurevich@xxxxxxxxxxxxxxxxxxxxx <
genegurevich@xxxxxxxxxxxxxxxxxxxxx > wrote:
  A developer is trying to connect to a database via DBI connect  using an
  externally authenticated Oracle ID.
  They claim that DBI can not connect to such an ID. Does anyone know
  whether
  this is true? I have not had
  any experience with DBI and can't tell whether this is correct or whether

  they simply don't know something.


I believe that DBI can connect anywhere sqlplus can connect.

eg.

created user 'ops$jkstill identified externally'.

From SQLPLUS:

11:47-ordevdb01:dv10:jkstill-13 > sqlplus /

SQL*Plus: Release 9.2.0.7.0 - Production on Wed Nov 1 11:47:34 2006

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
With the Partitioning option
JServer Release 9.2.0.7.0 - Production

SQL>

Again, but trying to go through sqlnet:

11:47-ordevdb01:dv10:jkstill-13 > sqlplus /@dv10

SQL*Plus: Release 9.2.0.7.0 - Production on Wed Nov 1 11:48:00 2006

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name:

This would likely work if OID were setup.

From perl, on the server, with ORACLE_SID set:

11:48-ordevdb01:dv10:jkstill-13 > perl c.pl
                X
[ /home/jkstill/tmp/dbi ]


Here is the script used:

use DBI;

my $username='/';
my $password = '';

my $dbh = DBI->connect(
   'dbi:Oracle:',
   $username, $password
);

die "Connect to  $db failed \n" unless $dbh;

my $sql=q{select * from dual};
my $sth = $dbh->prepare($sql);
$sth->execute;

while( my $ary = $sth->fetchrow_arrayref ) {
   print "\t\t$ary->[0]\n";
}

$sth->finish;
$dbh->disconnect;

It the script can't connect, try the same connection from SQL*Plus.

--
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist


--
http://www.freelists.org/webpage/oracle-l






[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.