DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: connect to remote db without @oracle_sid (Unix)

  1. #1
    Join Date
    Apr 2001
    Location
    London
    Posts
    725

    connect to remote db without @oracle_sid (Unix)

    Hi,

    One can configure net8 on a Unix box which will allow the dba to set his oracle_sid/export oracle_sid to a instance running on a different server. the database connect info is in tnsnames.ora.

    eg.
    i have oracle_sid set to 'live' on serverA
    i have a test instance on serverB which is configured in tnsnames.ora.

    I set ORACLE_SID=test, export ORACLE_SID
    then:
    sqlplus username/password
    Error: 'Oracle not available' - it is trying to look for the 'test' instance on serverA(my current connected server) instead of remotely on serverB.

    however if i issue the following command:
    sqlplus username/password@test - the instance is found on serverB and connection established.


    Question is:
    Why when I change the ORACLE_SID and export it I still have to qualify the SID i am trying to connect to (in this case have to add '@test' to the end of the sqlplus connect statement?)

    I need to be able to set Oralce_Sid's and connect to remote databases without having to add @oracle_sid to the sqlplus connect statement, i have been able to do this before but for some reason i have gone blank here and am having trouble figuring it out.

    sqlplus username/password (without having to enter @oracle_sid), connects without problems when establishing a connection to the instance on the server i am currently on.

    ??i'm confused??
    Once you have eliminated all of the impossible,
    whatever remains however improbable,
    must be true.

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    ORACLE_SID is looking on the local machine (i.e not using tnsnames / the listener - bypassing the network)

    Setting TWO_TASK will have the effect you want, i.e export TWO_TASK=test
    sqlplus username/password and you will connect to your remote database

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width