Re: TWO_TASK environment variable



isn't TWO_TASK only used when you have SQL*NET installed??

I do not think Instant-client installs that??
I will get onto one of my Oracle DBA types later to day and ask that. Might
have to change the POD a bit to reflect that
----- Original Message ----- From: "Martin J. Evans" <martin@xxxxxxxxxxxx>
To: <dbi-users@xxxxxxxx>
Cc: "tom r" <mailbin@xxxxxxxxxxx>
Sent: Thursday, September 06, 2007 5:47 AM
Subject: 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: Performance of REGEXP_LIKE vs LIKE?
    ... There are certain situations where the syntax of REGEXP_LIKE ... is cleaner and shorter than the comparable LIKE expression. ... search of a 3 million record table, for a series of text strings. ... How about Oracle Text? ...
    (comp.databases.oracle.misc)
  • Re: Oracle input parameter of type string problem
    ... the syntax of my sproc may not be 100% correct. ... months since I have coded in Oracle and I typed the syntax from memory. ... Gregory A. Beamer ... > With the standard OleDb provider, I believe it is safe to use @Year or? ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Oracle procedure raises exception but looks to be successful from DBI
    ... is the more desirable syntax for calling oracle procedures. ... because DBI's execute method returned success even though the ... procedure raised an exception. ...
    (perl.dbi.users)
  • Re: How to decode in SQL Server 2005
    ... non-standard, non-portable features such as the join syntax, DECODE, ... NVL even though Oracle has long since supported the ... ISO standard alternatives. ... The main reason is that we use what we know best. ...
    (comp.databases.ms-sqlserver)
  • Re: Which column is taken in JOIN with multiple columns and different content ?
    ... of a more complex SQL statement. ... The syntax in Oracle would be select a.*, ... SQL> select deptno, dname, dname from dept; ...
    (comp.databases.oracle.misc)