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: SQL query to get SID? (SID != service name?)

Re: SQL query to get SID? (SID != service name?)

From: Mladen Gogala <gogala_at_sbcglobal.net>
Date: Fri, 03 Mar 2006 02:57:10 GMT
Message-Id: <pan.2006.03.03.02.57.09.732107@sbcglobal.net>


On Thu, 02 Mar 2006 12:25:19 -0800, Joe Weinstein wrote:

> Hi, this is probably a real simple question... If I can get
> a connection to the DBMS via SQL-PLUS, with the tnsnames.ora
> entry listing the service name, not the SID, is there a query
> I can run to get the SID? I want to make an oracle thin JDBC connection,
> and the URL wants the SID. The service name doesn't seem to work.
> I would have though that the service name was the same as the SID,
> but apparently not?
> thanks
> Joe

Your database might have split personality and be accessed by more then one instance. Very few of such databases actually become serial killers, so you don't have to worry very much. Each instance usually has a table called GV$INSTANCE. This table contains two columns: INSTANCE_NUMBER and INSTANCE_NAME. INSTANCE_NAME is SID. My question is: what do you need the SID for when you have the instance name?

-- 
http://www.mgogala.com
Received on Thu Mar 02 2006 - 20:57:10 CST

Original text of this message

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