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: HELP!- Question and Problem in connecting to remote Oracle database using PRO*C

Re: HELP!- Question and Problem in connecting to remote Oracle database using PRO*C

From: Mladen Gogala <gogala_at_sbcglobal.net>
Date: Mon, 19 Jul 2004 00:22:07 -0400
Message-ID: <pan.2004.07.19.04.22.04.725731@sbcglobal.net>


On Mon, 19 Jul 2004 10:29:28 +0800, Ursula Lee wrote:

> Hi,
>
> I am unable to connect to Oracle database from another server using
> Client/Server relationship.
>
> (FYI...Program is written as Pro*C using Oracle 9.2.0.1.0 running on
> UNIX HP-UX11)
>
> In my Pro*C program, I am using syntax as follows:
>
> EXEC SQL CONNECT :username IDENTIFIED BY :password AT :db_name USING
> :db_string;
>
> (Client Server: THS_1
> Database Server: THSORACLE
> Database Instance: DRLDBMS
> TNSNAMES defined on Client Server: DRLDBMS_THSORACLE
> )
>
> I have 2 instances running on THS_ORACLE, but I made the
> ORACLE_SID = DRLDBMS, ie. the instance I need to connect.
>
> So for the above connection, I am using:
>
> EXEC SQL CONNECT :username IDENTIFIED BY :password AT 'DRLDBMS' USING
> 'DRLDBMS_THSORACLE'
>
> But it is still failed in connection.

This is the right syntax:

EXEC SQL CONNECT :username IDENTIFIED BY :password AT 'DRLDBMS_THSORACLE'

The USING part should be used if and only if you plan on identifying database through the program. It is supposed to contain the full TNS description of the database, starting with (ADDRESS_LIST=...).

-- 
A city is a large community where people are lonesome together.
Received on Sun Jul 18 2004 - 23:22:07 CDT

Original text of this message

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