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
- Service list for Local Machine (running)
running Alerter Alerter
running AvSynMgr AVSync Manager
running BITS Background Intelligent
Transfer Service
running Browser Computer Browser
running Dhcp DHCP Client
running dmserver Logical Disk Manager
running Dnscache DNS Client
running Eventlog Event Log
running EventSystem COM+ Event System
running lanmanserver Server
running lanmanworkstation Workstation
running LmHosts TCP/IP NetBIOS Helper
Service
running LogWatch Event Log Watch
running McShield McShield
running Netman Network Connections
running NtmsSvc Removable Storage
running Oracle8i_homeTNSListener Oracle8i_homeTNSListener
running OracleServiceTEST OracleServiceTEST
running PlugPlay Plug and Play
running ProtectedStorage Protected Storage
running RasMan Remote Access Connection
Manager
running RemoteRegistry Remote Registry Service
running RpcSs Remote Procedure Call
(RPC)
running SamSs Security Accounts Manager
running Schedule Task Scheduler
running seclogon RunAs Service
running SENS System Event Notification
running Spooler Print Spooler
running TapiSrv Telephony
running TrkWks Distributed Link Tracking
Client
running WinMgmt Windows Management
Instrumentation
running WMDM PMSP Service WMDM PMSP Service
running Wmi Windows Management
Instrumentation Driver Extensions
running wuauserv Automatic Updates
<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