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: SID enumeration help

Re: SID enumeration help

From: EdStevens <quetico_man_at_yahoo.com>
Date: 13 Nov 2006 11:19:23 -0800
Message-ID: <1163445563.905194.96100@k70g2000cwa.googlegroups.com>

schw wrote:
> could you please then provide solutions for unix and winsows
> seperately?
>
> cheers
> paw
>
>
> EdStevens napisal(a):
> > schw wrote:
> > > any OS, need to write a simple app in java working anywhere..
> > >
> > > two scenarios please
> > > - all installed
> > > - just those currently running..
> > >
> > > thanks!!!!
> > >
> > >
> > > EdStevens napisal(a):
> > > > schw wrote:
> > > > > Hi All,
> > > > >
> > > > > apologies for trivial question...but i need help..
> > > > >
> > > > > it is possible to run few oracle databases on a single machine...how
> > > >
> > > > Yes
> > > >
> > > >
> > > > > can I enumerate a list of SIDs?
> > > > >
> > > >
> > > > What OS? In what environment do you need to do this? (ad hoc command
> > > > line? shell script? etc?) All installed SIDs or just those currently
> > > > running?
> > > >
> > > > > thanks for your help..
> > > > >
> > > > > best regards,
> > > > > paw
> >
> > Maybe someone else can correct me, but I don't see how this can be os
> > neutral. In Unix, each sid runs as multiple seprarate processes while
> > in windows each sid runs as a separate, multithreaded service. In
> > unix, the 'repository' of installed sids is the oratab file, while in
> > windows it is in the registry.

Please don't top-post.

I'll leave the actual solution as an exercise for the student. Once you know where to get the raw information the solution is pretty trivial, though details will depend on your needs.

For unix, As Steve pointed out, you can grep the oratab file (which is located in either /etc or /var/opt/oracle, depending on your flavor of unix) to get a list of installed sids. To get a list of currently running sids, play around with this:

ps -ef | grep "pmon" | grep -v 'grep' |awk -F_ '{print $3}'

For Windows, you'll have to poke around in the registry, starting with HKLM\software\oracle. Below that, I believe what your are looking for is somewhat version dependent. Take a gander with regedit to get a feel for what's there. When you know exactly what you are looking for, there are some windows APIs for reading the registry that I have used in the past, but I don't have any references handy. Search around on technet.microsoft.com Received on Mon Nov 13 2006 - 13:19:23 CST

Original text of this message

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