If your system is set up and configured correctly then you should never have
to set the environment variable ORACLE_HOME or ORACLE_SID in any Perl
program using DBI.  The ORACLE_HOME should be read in from the registry
location.  The ORACLE_SID will be defined in the connect string association
to the tnsnames.ora file.  There does seem to be a problem with some Oracle
8.x installs creating their ORACLE_HOME registry value in the wrong registry
location though.  You should have an ORACLE_HOME registry value in the
HKLM\SOFTWARE\ORACLE location.  In some instances it will be set in
HKLM\SOFTWARE\ORACLE\HOME0 only, which is not correct.  



-----Original Message-----
From: Vincent Roquencourt
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 29, 2001 7:39 AM
To: 'Mark Vandenbroeck'; Vincent Roquencourt
Cc: Tim Scott; [EMAIL PROTECTED]
Subject: RE: Connection pb with 2 oracle version! Please help!


Thanks guys!!! it works this way BUT... (there's is always one).. the
strange thing is that the same script works if i compile DBI /DBD with the
lowest oracle version (7.3.4).Why? Do we have upward (and not backward)
compatibility?
            
 
THANKS AGAIN :)
 
(FYI , it also works connecting via OCI and bypassing tnsnames.ora file with
7.3.4' compiled DBI but i won't use it for update :) )

-----Original Message-----
From: Mark Vandenbroeck [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 29, 2001 1:50 PM
To: Vincent Roquencourt
Cc: Tim Scott; [EMAIL PROTECTED]
Subject: Re: Connection pb with 2 oracle version! Please help!


Vincent, 

Your DBD is linked against the 8.1.6 libs, but you set your ORACLE_HOME to
the 7.3.4 distribution. This is, as said before, asking for trouble. You
should set your ORACLE_HOME to point to the 8.1.6 distribution, since that's
where the libs reside you need to link with. 


If your tnsnames.ora is set up correctly, everything should work. 


Oh, don't forget to check your LD_LIBRARY_PATH. It should contain
$ORACLE_HOME/lib (where ORACLE_HOME points to 8.1.6, of course). 


Brgds, 


Mark 
  


Vincent Roquencourt wrote: 


On Tue, May 29, 2001 at 10:28:01AM +0100, Tim Scott wrote: 
> Voncent, 
> 
> You'd be better to setup a tnsnames entry in your Oracle8.1.6 area to
point 
> at your Oracle 7.3.4 database and using this as a connect string. 
> 
> If you don't do this, you're using Oracle8 function calls from your
Perl/DBI 
> build to try to talk to an Oracle7 database. This is asking for trouble - 
> even if you do eventually connect. 
> 
> Regards, 
> Tim 

Hi Tim, 
        thanks for your quick reply, however i just tested it: 
$ENV{ORACLE_HOME}= '/export/home/oracle/app/oracle/product/7.3.4'; 
$ENV{ORACLE_SID}='mydb'; 
print "$ENV{ORACLE_HOME} .... $ENV{ORACLE_SID}\n"; 
        if( !( $dbh = DBI->connect($ENV{ORACLE_SID},$USER,$PASS, 'Oracle') )
) { 
                 print "not connected\n $DBI::errstr"; 
        } 
        else{ 
                 print "connected\n" 
        }; 


#this is supposed to connect using tnsnames.ora (sqlplus $USER@mysid works
with both db) 
i get the same error with the 7.3.4: 


/export/home/oracle/app/oracle/product/7.3.4 ....mydb 
not connected 
 ORA-01005: null password given; logon denied (DBD ERROR: OCISessionBegin) 


but not with the 8.1.6! 
/export/home/oracle/app/oracle/product/8.1.6 .... deuro 
connected 


user exists on both db (tested with sqlplus via sqlnet) 


HEEEELp!!! :) 
 

-- 

Mark Vandenbroeck                      Mobile : +32-495-59.55.62

Business Process Manager               Email  : [EMAIL PROTECTED]


EMEA Support Information Systems       AIM    : markvdb
  

Reply via email to