how to permanently set hostname for sqlplus?

0

I have the following situation:

  • a windows 7, 64-bit OS;
  • in which I have an Oracle 10g setup;
  • on top of Win 7 - XP Mode;
  • in which I have Oracle 11 client.

As I try to connect to the Oracle Server from XP mode I got the two situations:

  1. sqlplus username/password@ host

    -> I log in successfully!

  2. sqlplus then username, then password (i.e. 3 separate rows)

    -> I get ORA - 12560

I believe this is due to the fact that the Oracle client 'forgets' or doesn't know which host to turn to in order to connect to server.

How do I set the host for the Oracle client? One more - I do not see any tnsnames.ora files in the installation directory of Oracle client.

karla

Posted 2012-01-04T12:30:29.663

Reputation: 249

Answers

1

Use the LOCAL environment variable in Windows (same as TWO_TASK in Unix).

set LOCAL=service_name 

By the way, the meaning and syntax of connection string is not

username/password@ host

but instead

username/password@service_name

In your case probably the service_name is the same as hostname.

kubanczyk

Posted 2012-01-04T12:30:29.663

Reputation: 1 108

thank you very much for the quick and accurate response! – karla – 2012-01-04T12:39:31.130