Re: sqlplus

From: Robert W. Swisshelm <swisshelm_at_lilly.com>
Date: 1996/11/19
Message-ID: <3291AA9A.E05_at_lilly.com>#1/1


Sergio Tiezzi wrote:
>
> Can I connect to a database in this way :
>
> sqlplus user/passwd_at_DB_NAME
>
> Is it important what I write in my ORACLE_SID ?
>
> When I try I get
>
> ORA -12154:TNS : could not resolve service name
>
> sergio_at_datatrade.sm
>
> thank you very much

Yes, you can do this. However, 'DB_NAME' must be defined as a service in your tnsnames.ora file. That service entry descibes the connection type (generally tcp/ip), the host, the port, and the sid name that oracle should use to make the connection.

The directory that containts tnsnames.ora can be operating specific. On UNIX, it can be pointed to by $TNS_ADMIN. If that is not defined, it looks in /etc (HP-UX) or /var/opt/oracle (Solaris). If it is still not found, Oracle looks in $ORACLE_HOME/network/admin.

Under VMS, Oracle looks in TNS_ADMIN, which usually points to ORA_RDBMS:[NETWORK.ADMIN]. On a pc, you'll find it in c:\orawin\network\admin (16 bit) or c:\orawin95\network\admin

Here is an example entry:

mydb =
  (DESCRIPTION =
    (ADDRESS_LIST =

      (ADDRESS =
        (COMMUNITY = tcpcomm)
        (PROTOCOL = tcp)
        (HOST = orahost.world)
        (PORT = 1521)
      )

    )
    (CONNECT_DATA =
      (SID = mydb)
    )
  )
-- 
Bob Swisshelm
Eli Lilly and Company
swisshelm_at_lilly.com
Received on Tue Nov 19 1996 - 00:00:00 CET

Original text of this message