Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL query to get SID? (SID != service name?)
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.comReceived on Thu Mar 02 2006 - 20:57:10 CST