Re: oracle instance_name vs. service_name

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


joel garry <joel-garry_at_home.com> wrote:
>> > If I use sqlplus to connect to a database, I do it like that:
>>
>> > sqlplus user1/secr..._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 inhttp://download-uk.oracle.com/docs/cd/B19306_01/java.102/b14355/urls....
>>
>> According to the documentation, it should be
>>
>> jdbc:oracle:thin:@//ora1.mydomain.com:1583/db.prd1
>>
>> Yours,
>> Laurenz Albe

> 
> http://download-west.oracle.com/docs/cd/B14117_01/java.101/b10979/urls.htm#g1073263
> and scroll down a bit to "If you are using the Thin or OCI drivers,
> note the following:"
> 
> Found in a google search of:
> jdbc thin style syntax
> which led to http://twit88.com/blog/2008/05/29/new-jdbc-url-syntax-for-oracle-10g-jdbc-driver/
> So, judging from googling, at least, it's just an older syntax.

That's true!

Yet even in 10.1 they don't seem to have that syntax in "Table 3-3 Supported Database Specifiers"

Thanks for the clarification,
Laurenz Albe Received on Thu Nov 20 2008 - 04:13:32 CST

Original text of this message