Re: TWO_TASK environment variable



I was playing with TWO_TASK myself this morning and like Tom, I cannot make the advice in DBD::Oracle work with Instant Client 10.2.0.3. I wonder if the description of TWO_TASK is correct or perhaps out of date wrt to newer Oracle versions. See below:

tom r wrote:
reading man DBD::Oracle gives an in depth explanation on how the TWO_TASK environment variable can be used. however, when i tried to use it in place of .tnsnames.ora nothing worked. i believe that sql*plus does not use TWO_TASK.

-----
[~] cat .tnsnames.ora
infra=(description=(address=(protocol=tcp)(host=infradb.fs.usda.gov)
(port=1521))(connect_data=(sid=iwebdb)))
[~] sqlplus 'fs_public/fs_public@infra'

SQL*Plus: Release 10.2.0.3.0 - Production on Wed Apr 11 10:36:04 2007

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
[~] printenv | grep TWO
TWO_TASK=T:infradb.fs.usda.gov:iwebdb

Try as I might, I cannot make T:*** work either. What does work for me is:

TWO_TASK=//xxx.easysoft.local:1521/ORACLE_SID

but none of:

TWO_TASK=T:xxx.easysoft.local:1521:ORACLE_SID
TWO_TASK=T:xxx.easysoft.local:ORACLE_SID
TWO_TASK=T:xxx.easysoft.local/ORACLE_SID

so for a totally empty DBI->connect call (and using instant client) I have the following working:

DBI_DSN=dbi:Oracle:
DBI_USER=xxx
DBI_PASS=yyy
LD_LIBRARY_PATH=/home/martin/instantclient_10_2
TWO_TASK=//xxx.easysoft.local:1521/ORACLE_SID

perl -e 'use DBI; $h = DBI->connect();'

[~] sqlplus 'fs_public/fs_public'


<snipped sqlplus output failing to connect>


in addition, it appears sql*plus doesn't even allow one to specify the connection parameters on the command line.

That is also what I found which makes me think the syntax suggested by DBD::Oracle POD for TWO_TASK may no longer be applicable for Oracle 10.

-----
[~] sqlplus 'fs_public/fs_public@host=infradb.fs.usda.gov/sid=iwebdb'

For me what works using your values would be:

sqlplus 'fs_public/fs_public@//infradb.fs.usda.gov/iwebdb'

<snipped sqlplus output failing to connect>

-----

unless i'm missing something here, it seems sql*plus must use the .tnsnames.ora file.

No, I don't have a tnsnames.ora file but I don't use the syntax mentioned in DBD::Oracle.

From what I can find on the net, it may be that the syntax "T:", "P:" (in fact a letter followed by a colon) at the start of the connect string tells SQL*Net to use V1 and since Oracle 7.3, SQL*Net V1 is no longer supported.

This is not the first time someone has failed to use TWO_TASK following the directions in DBD::Oracle. Although I cannot be sure of the SQL*Net V1/V2 changes in syntax I can say that the syntax I show above does work with sqlplus and DBD::Oracle since Oracle 10. I suggest the DBD::Oracle POD is changed and I am happy to provide a patch against svn tree.

Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
.



Relevant Pages

  • Re: DBD::Oracle 1.19 fails to find Oracle version, problem and solution
    ... I don't understand your response since the problem I am seeing is that sqlplus will NOT run if ORACLE_HOME is defined and it does not seem related to combining libraries into one. ... Just attempted to install DBD::Oracle 1.19 on an Ubuntu Server 7.04 Feisty machine running Perl v5.8.8 (and instant client 10.2.0.3-20061115) and hit a problem with the Makefile.PL not being able to determine my Oracle version. ... WARNING: The tests will probably fail unless you set ORACLE_HOME yourself! ... You may need to set ORACLE_HOME to your Oracle software directory ...
    (perl.dbi.users)
  • Re: Trade Press Needs to Talk with HP Disaster Tolerence Customers
    ... This isn't so much targeted at you Tom but everyone in cov... ... Keith is right on target. ... > Oracle from improving their professional marketing of these advanced ... > I have repeatedly discussed the scientific basis of the design advantages ...
    (comp.os.vms)
  • Re: DBD::Oracle 1.19 fails to find Oracle version, problem and solution
    ... Just attempted to install DBD::Oracle 1.19 on an Ubuntu Server 7.04 Feisty machine running Perl v5.8.8 (and instant client 10.2.0.3-20061115) and hit a problem with the Makefile.PL not being able to determine my Oracle version. ... WARNING: The tests will probably fail unless you set ORACLE_HOME yourself! ... You may need to set ORACLE_HOME to your Oracle software directory ...
    (perl.dbi.users)
  • Re: OT: Pretty cool search toolbar
    ... > Better get used to it, Tom. ... > Bill Gates' genius has been in marketing trailing-edge tech- ... Their squishing of Java was hilarious. ... >> and founder of Oracle, ...
    (rec.arts.poems)
  • Re: DBD::Oracle 1.19 fails to find Oracle version, problem and solution
    ... The real root of the problem is that Oracle in its divine wisdom has compacted all the .so files into one so there is no way you c compiler can get them but of SQL on the Ubuntu Server it could be the case that the Makefile fort 1.19 is not recognizing it as a Linux server or alike. ... Just attempted to install DBD::Oracle 1.19 on an Ubuntu Server 7.04 Feisty machine running Perl v5.8.8 (and instant client 10.2.0.3-20061115) and hit a problem with the Makefile.PL not being able to determine my Oracle version. ... WARNING: The tests will probably fail unless you set ORACLE_HOME yourself! ... Looks like an Instant Client installation, ...
    (perl.dbi.users)