Re: Get list of databases

From: Bert Bear <bertbear_at_NOSPAMbertbear.net>
Date: Wed, 20 Nov 2002 21:40:07 GMT
Message-ID: <XiTC9.1433$Aq2.504205332_at_newssvr30.news.prodigy.com>


Robert,

[Quoted] First, I think you are using the term "Oracle service" correctly. Oracle in [Quoted] [Quoted] Getting to Know Oracle8i Release 2 (8.1.6) Part Number A76962-01 uses the [Quoted] term Oracle database service to refer to an Oracle database instance/SID [Quoted] [Quoted] (before 8i) and Oracle database service_name (for parallel server/RAC) in 8i and beyond.

[Quoted] [Quoted] The TNSNAMES.ORA is (normally) in the $ORACLE_HOME/network/admin [Quoted] [Quoted] subdirectory (for Window since you mentioned .NET). The structure of the [Quoted] [Quoted] TNSNAMES.ORA file is in the documentation.

[Quoted] Basically, though, what you want to put into the combo box is the connect [Quoted] [Quoted] descriptors. You find those in the file by parsing for <connection string> = (DESCRIPTION An example (9.2.0.1.0) is:

SNEAKERS =
  (DESCRIPTION =
    (ADDRESS_LIST =
[Quoted] (ADDRESS = (PROTOCOL = TCP)(HOST = ERCF)(PORT = 1521))
    )
    (CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = sneakers)

    )
  )

In this case, you would look for the name SNEAKERS (SNEAKERS = (DESCRIPTION [Quoted] = ... )) by parsing for = (DESCRIPTION. This only helps you if all the [Quoted] service names are in the TNSNAMES.ORA file. Additionally, this will also [Quoted] [Quoted] work ONLY if everyone using the combo box has the same TNSNAMES.ORA file as [Quoted] you. If they don't then your connection string and theirs won't match.

[Quoted] [Quoted] As I previously said (see prior message): You should look at using ONAMES [Quoted] [Quoted] and creating the combo box from the ONAMES configuration file (NOT TNSNAMES.ORA). Should you decide NOT to go with ONAMES, then you need to [Quoted] provide all the TNSNAMES.ORA information on the webpage for each Oracle service.

[Quoted] [Quoted] I would be happy to consult on this topic with your company (and my (non-inclusive) rates are reasonable).

Bertram Moshier
Oracle Certified Professional 8i and 9i DBA

http://www.bmoshier.net/bertram

Service Naming
An Oracle database can span multiple instances over multiple computers, [Quoted] making the database service a distributed service.

Prior to Oracle8i, an Oracle database service was identified by an Oracle [Quoted] [Quoted] System Identifier (SID). The SID was also used internally by the database as [Quoted] [Quoted] pointer to the System Global Area (SGA). Clients connected to a database [Quoted] [Quoted] instance by specifying the SID in the connect descriptor. This naming scheme [Quoted] did not distinguish services from instances.

[Quoted] In Oracle8i, a new naming schema has been implemented. Because an Oracle [Quoted] database can span over multiple computers, both the service as a whole and [Quoted] [Quoted] each of its instances are specified.

[Quoted] A database is now identified by its service name with the SERVICE_NAMES [Quoted] parameter in the initialization file. SERVICE_NAMES specifies the name of [Quoted] [Quoted] the highest-level view of Oracle database service, which may span instances [Quoted] and/or nodes. SERVICE_NAMES is defaulted to the global database name, a name [Quoted] comprised of the database name (DB_NAME) and domain name (DB_DOMAIN).

[Quoted] Database instances are identified by an instance name with the INSTANCE_NAME [Quoted] parameter in the initialization file. INSTANCE_NAME corresponds to the SID of the instance.

[Quoted] [Quoted] Connect descriptors used by clients should be configured with the [Quoted] SERVICE_NAME (singular, not plural) parameter to connect to an Oracle8i database.

[Quoted] Optionally, the connect descriptor can also be configured with the INSTANCE_NAME parameter to connect to a particular instance of the database. [Quoted] This may be useful if you have an Oracle Parallel Server with multiple instances.

[Quoted] "Robert Vabo" <rvabo_at_msn.com> wrote in message news:3ddbe156_at_news.wineasy.se...
> I'm sorry about the cross post. Its just that I have been asking questions,

> searching etc. for about a week without getting any answers.
>
> Why am I interested in listing up Oracle Services (or whatever they are
> called)
[Quoted] [Quoted] > HOW TO GET THE ENTRIES IN THE TNSNAMES.ORA FILE!! so I can fill a Combo
with
> it ?
>
[Quoted] [Quoted] > Oracle does it themselves when you use Net Assistant!
>
> --
> Regards
[Quoted] > Robert Vabo
> Gecko AS
> www.gecko.no
>
> "Robert Vabo" <rvabo_at_msn.com> skrev i melding
> news:3ddb83a0_at_news.wineasy.se...
> > How can I use .NET to retrieve a list of all Oracle services on my
network
> ?
> > --
> > Regards
> > Robert Vabo
> > Gecko AS
> > www.gecko.no
> >
> >
>
>
Received on Wed Nov 20 2002 - 22:40:07 CET

Original text of this message