Re: oracle instance_name vs. service_name

From: Laurenz Albe <invite_at_spam.to.invalid>
Date: 19 Nov 2008 13:32:31 GMT
Message-ID: <1227101549.667017@proxy.dienste.wien.at>


J?ns M?rtin Schl?tt?r <KmoEfrUewEbx_at_spammotel.com> wrote:
> If I use sqlplus to connect to a database, I do it like that:
>
> sqlplus user1/secret1_at_ora1.mydomain.com:1583/db.prd1
>
> where db.prd1 is the service_name.

That's using the EZCONNECT syntax, ok.

> If I do the connect through JDBC, the connection url is:
>
> jdbc:oracle:thin:@ora1.mydomain.com:1583:db1
>
> SQLPLUS uses the service name, whereas JDBC uses the instance_name
> (resp. sid).
>
> How does this work? Is the oracle protocol so that either instance
> name or service name can be used?

I am surprised that this URL works, as indeed it does.

I cannot find this form under the supported Syntaxes in http://download-uk.oracle.com/docs/cd/B19306_01/java.102/b14355/urls.htm#BEICDECB

According to the documentation, it should be

jdbc:oracle:thin:@//ora1.mydomain.com:1583/db.prd1

Yours,
Laurenz Albe Received on Wed Nov 19 2008 - 07:32:31 CST

Original text of this message