m.edmondson
m.edmondson

Reputation: 30922

Database is not found in the available list of aliases

I'm using the 'Data Connections' server explorer to connect to my Oracle database. I have specified the connection in Web.Config in:

<oracle.manageddataaccess.client>
    <version number="*">
      <dataSources>
        <dataSource alias="[removed]" descriptor="[removed]" />
      </dataSources>
    </version>
</oracle.manageddataaccess.client>

with a corresponding element in

<add name="DbPower" connectionString="[removed]" />

and added it to the TNS names file on my machine. Although when I go to manage the connection I get

enter image description here

Searching doesn't come up with anything and the alias in the dialog matches the one in the config.

Any ideas?

Upvotes: 1

Views: 1532

Answers (2)

Littlefoot
Littlefoot

Reputation: 143083

In order to avoid such headaches, I'd suggest you to create environment variable called TNS_ADMIN and point it to a directory (for example, C:\ora_lib). Put a single copy of TNSNAMES.ORA file in there, and put all databases you use into that TNSNAMES.ORA.

Doing so, you'll have to maintain only a single copy of TNSNAMES.ORA (instead of all of them, scattered over all your \network\admin directories that belong to different Oracle installations) and all your Oracle products will know where to look for a database you're connecting to.

Upvotes: 1

m.edmondson
m.edmondson

Reputation: 30922

I figured this out myself, as per usual with an Oracle installation you end up with multiple tnsnames.ora files on your machine. The one that visual studio is using is shown in the modify connections dialog:

enter image description here

Once I made sure I'd updated this file all was good.

Upvotes: 2

Related Questions