Skip to Main Content
  • Questions
  • TWO_TASK environment variable on windows.

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Senthil.

Asked: May 30, 2001 - 2:21 pm UTC

Last updated: September 28, 2006 - 3:11 am UTC

Version: 8.1.5

Viewed 10K+ times! This question is

You Asked

Hi thomas,

Is it possible to connect remote database without giving service name.

i tried by setting TOW_TASK environment variable. i am able to connect any remote database from Unix client, if i
-set TWO_TASK environment and
-not giving the service name while entering username and password

but i am *not* able to do the same in windows-NT.


Here is an example.

First Instance, NTORCL, on windows-NT
Second Instance, UNORAC, on Sun-solarais

1. Login into unix client
2. add entry in tnsnames.ora, to the instance NTORCL
3. set TWO_TASK environment variable(assign the NTORCL service name)
4. sqlplus username/password

works fine...

now...
1. Login into windows client
2. add entry in tnsnames.ora, to the instance UNORAC
3. set TWO_TASK environment variable(assign the UNORAC service name)
4. sqlplus username/password
gives invalid username/password...

but it works if i give 'sqlplus username/password@service_name'

am i doing anything wrong or is it not possible.

please advice me.

thanks.

senthil.

and Tom said...

the environment variable name is LOCAL on windows NT.

set LOCAL=service_name

Rating

  (3 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

ORA-12560 Error also solved by this answer

Harold Kerry, May 12, 2004 - 1:07 pm UTC

I just installed an Oracle 8.1.7 on a W2000SP4 machine, the install process halted just after the listener install, so I had to create the database manually. The thing is I was getting ORA-12560 when trying to connect using svrmgrl, I could connect just using the explicit instance (@ORCL) syntax, setting the LOCAL environment variable solved it.

A reader, September 05, 2006 - 5:48 pm UTC


ORACLE_SID vs TWO_TASK

Venkataramesh, September 28, 2006 - 1:57 am UTC

hi tom,

why do we need to use two_task when we have oracle_sid.

Currently i am using oracle(10gr2) as a database in MTP (Mainframe transaction Processing) on solaris 10.

Mt MTP is not working fine with ORACLE_SID, but fine with TWO_TASK.

Are there any implications involved.

Please let me know if you have any material on TWO_TASK.

Thanks in advance.

Tom Kyte
September 28, 2006 - 3:11 am UTC

TWO_TASK lets you silently support a tns network connect string, that is, instead of:

sqlplus scott/tiger@tnsname


you can:

export TWO_TASK=tnsname


sqlplus scott/tiger <<<== that has an implied @tnsname



oracle_sid is used for a local connection - direct to the server - without using a listener