Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: ORACLE_SID in client machine

Re: ORACLE_SID in client machine

From: Sybrand Bakker <gooiditweg_at_sybrandb.verwijderdit.demon.nl>
Date: Fri, 18 Jun 2004 22:43:39 +0200
Message-ID: <lok6d0h8gkk03bf6tjc2j3q3i5gl4936j8@4ax.com>


On 18 Jun 2004 12:07:45 -0700, scw_00_at_yahoo.com (jr) wrote:

>i am just a new ba..., plz forgive me this stupid question.
>
>version 9.2.0.1
>machines Solaris 2.8
>
>database is installed in db1 machine, and oracle client is installed in ap1.
>
>in ap1:
>i set ORACLE_SID=DBNAME, and tnsnames.ora has this entry.
>
>sqlplus /nolog
>sql> connect usr1/usr1;
>ERROR:
>ORA-12545: Connect failed because target host or object does not exist
>
>but it is OK
>sql> connect usr1/usr1_at_DBNAME
>connected
>
>
>my question is "the @DBNAME is necessary or not?".
>-- if the answer is no, then what i need to setup in order to make it work
> without enter "@DBNAME".
>
>-- if the answer is yes, then ORACLE_SID deosn't mean that much in here.
>
>Thanks in advance.

On a client (different from the server) ORACLE_SID doesn't apply at all.
You *must* setup a tnsnames.ora with a proper entry for your database in it.
The entry looks like (and you should use the net8 assistant to set it up properly)
<tns service name> =
(connect_data=((protocol=tcp)(host=db1)(service_name=< the name of your database, ie service_name in init.ora>)

The answer Turkbear posted is a workaround to avoid having to specify username/password@<tns service name>
every time.

As this is pretty basic, I suggest you take some time to read your documentation. It will definitely pay off!

--
Sybrand Bakker, Senior Oracle DBA
Received on Fri Jun 18 2004 - 15:43:39 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US