perl-5.6.1,

  DB<2> p $DBI::VERSION;
1.21


Using host-based authentication. In most cases the connection works.
In some cases it doesn't, fails in DBI::connect:

      DB<1> x  DBI->connect( 'dbi:Oracle:host=dsstransform;sid=PROD01', '', '' )
    Modification of a read-only value attempted at
    /opt/perl5/lib/site_perl/5.6.1/sun4-solaris/DBD/Oracle.pm line 153.   DB<2>
    Modification of a read-only value attempted at
    /opt/perl5/lib/site_perl/5.6.1/sun4-solaris/DBD/Oracle.pm line 153.

Checking the source:


   144          # get list of 'remote' database connection identifiers
   145          foreach $d ( $ENV{TNS_ADMIN},
   146            ".",                                                  #
current directory
   147            "$oracle_home/network/admin", # OCI 7 and 8.1
   148            "$oracle_home/net80/admin",   # OCI 8.0
   149            "/var/opt/oracle"
   150          ) {
   151              next unless $d && open(FH, "<$d/tnsnames.ora");
   152              $drh->trace_msg("Loading $d/tnsnames.ora\n") if $debug;
   153              while (<FH>) {
   154                  next unless m/^\s*([-\w\.]+)\s*=/;
   155                  my $name = $1;
   156                  $drh->trace_msg("Found $name. ".($dbnames{$name} ?
"(oratab entry overridden)" : "")."\n")
   157                      if $debug;
   158                  $dbnames{$name} = 0; # exists but false (to distinguish
from oratab)
   159              }
   160              close FH;
   161              last;
   162          }
   163
   164          $dbnames{0} = 1;        # mark as loaded (even if empty)
   165      }

Checking the environment:
    
    
     $ echo $TNS_ADMIN
    /opt/oracle/product/8.0.5/network/admin
    
    $ less $TNS_ADMIN/tnsnames.ora 
    <snip>
    # Transform production
    prod01 =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = dsstransform)(PORT = 1521))
        (CONNECT_DATA = (SID = prod01))
      )
    <snip>
    

Checking at the shell prompt:
    
     $ sqlplus /@PROD01
    
    SQL*Plus: Release 8.0.5.0.0 - Production on Thu Mar 21 18:57:8 2002
    
    (c) Copyright 1998 Oracle Corporation.  All rights reserved.
    
    
    Connected to:
    Oracle8 Enterprise Edition Release 8.0.5.2.1 - Production
    With the Partitioning and Objects options
    PL/SQL Release 8.0.5.2.0 - Production



Anything else I should check?

--
Steven Lembark                              2930 W. Palmer
Workhorse Computing                      Chicago, IL 60647
                                           +1 800 762 1582

Reply via email to