John Scoles wrote:
isn't TWO_TASK  only used when you have SQL*NET installed??

Yes.

I do not think Instant-client installs that??

$ strings libclntsh.so | grep sqlnet.ora
Getting the path of sqlnet.ora
Failure in reading sqlnet.ora parameter %s

so I think it is in libclntsh.so.

AFAIK, I need SQL*Net to be able to communicate with a remote Oracle database. I am communicating with a remote Oracle database and I only have instant client installed.

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

Yes, that was my point. As it stands the instructions for using TWO_TASK in the pod don't appear to work with Oracle 10 (either instant client or full client).

... and whilst I'm posting here I noticed the README says:
  Build, test and install the DBI module (at least DBI 1.21).
but Makefile.PL says:
    use DBI 1.28

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

----- Original Message ----- From: "Martin J. Evans" <[EMAIL PROTECTED]>
To: <dbi-users@perl.org>
Cc: "tom r" <[EMAIL PROTECTED]>
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/[EMAIL PROTECTED]'

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/[EMAIL PROTECTED]/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



Reply via email to