RE: oraperl SQL*Net V2 connect string

From: Deborah J. Henkel <deborah.henkel_at_srs.gov>
Date: Thu, 25 Aug 94 15:35:40 EST
Message-ID: <9408251932.AA11284_at_slsand.srs.gov.srs.gov>


Here is the solution to my problem from Kevin Stock. It works great now. Hopefully this will help anyone out there who also may be having this problem.

| I am having problems using the SQL*Net V2 connect string in my oraperl
| programs. The SQL*Net V1 string works just fine.
|
| I am going between two SUN Sparcstations running SUN OS 4.1.3. I have
| verified that the SQL*Net V2 is set up correctly since I created a
| database link using the V2 connect descriptor and within SQL Plus I am
| able to communicate between the two databases. However, using oraperl
| I am unsuccessful.
|
|
| For SQL*Net V1 I have:
| $lda = &ora_login("T:slsand:SID7","oracle_user_name","oracle_password");
| This works fine
|
|
| For SQL*Net V2 I have:
| $lda = &ora_login("SLSAND","oracle_user_name","oracle_password");
| This does not work fine

Here is the solution:

This may be a problem of Oraperl trying to be too clever for its own good. If the first argument to &ora_login() contains a colon, it is assigned to the variable TWO_TASK; if not, it is assigned to ORACLE_SID. As your v2 net descriptor doesn't contain a colon, Oraperl puts it in ORACLE_SID and Oracle thinks it's meant to be a local database.

The easiest workaround is probably something like this:

        undef $ENV{'ORACLE_SID'};
        $ENV{'TWO_TASK'} = 'SLSAND';
        $lda = &ora_login('', 'user', 'pass');

The empty first argument will make Oraperl use the existing environment instead of creating its own.

There isn't likely to be a fix for this as I don't have access to a system running Oracle any more. In fact, I've only just got back to the net after a year unemployed, and I'm not likely to spend a lot of time on News, at least for the moment.

        Kevin
        kstock_at_auspex.fr


--------------------------------------

Deborah Henkel
Westinghouse Savannah River Laboratory
Building 773-42A
Aiken, SC 29808
                                  
phone: (803) 725-8199           
email: deborah.henkel_at_srs.gov 
--------------------------------------     
Received on Thu Aug 25 1994 - 22:35:40 CEST

Original text of this message