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: Listing Oracle Databases on Windows

Re: Listing Oracle Databases on Windows

From: Bill Davison <wdavison_at_fpcc.net>
Date: Sun, 2 Mar 2003 17:58:49 -0700
Message-ID: <3e62a8bc@news.starnetinc.com>


Since each database in Windows has its own service, you can search for service names. There's a command line utility in the Windows 2000 Resource Kit called Service List (sclist.exe). I can email it to you off list if you like, size is only 6KB. One caveat - depending on how you shut down your databases it's possible for the database to be down even though its service is still running.

Finding the Oracle home for each DB is trickier, I think the only answer is to pull it out of the registry. There are probably some add-on Perl packages you can download for this. On Windows 2000 I think you're looking for
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\OracleService<your_sid> \ImagePath. There's another windows resource kit tool called regdmp.exe that you can use instead of Perl, but it spits out everything under OracleService<your_sid>, so you'd have more output than you want.

Here are the details on sclist:

usage: SCLIST [-?] [-r] [-s] [MachineName]
              [-?] Display this message
              [-r] Display only running services
              [-s] Display only stopped services
              [-MachineName] Machine name to list services

Output looks like this (only have the listener and one database running on this machine):

C:\>sclist -r


<dan1999a_at_attbi.com> wrote in message
news:yVj8a.310694$HN5.1353446_at_rwcrnsc51.ops.asp.att.net...
> Hi Oracle DBAs,

>

> In UNIX, to get a list of Oracle databases on a server, I do this in my
> script:
> grep ^[A-Z,a-z] /etc/oratab

>
> Is there a way that I can script out getting a list of Oracle databases
and
> its Oracle Home in a Windows environment? I'm trying to write a script
that
> will run for each Oracle database on a server.
>

> Also, is there a way of doing this using PERL?
>

> Thanks in advance.

>
> Received on Sun Mar 02 2003 - 18:58:49 CST

Original text of this message

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