Geeks With Blogs
Gabriel Lozano-Morán blog

A co-worker received today the following exception after the installation of Oracle Designer everytime his web service tried to open a connection to the Oracle Server:

System.Exception: OCIEnvNlsCreate failed with return code -1

The problems started when help desk installed the Oracle Designer on his machine so we figured out that this exception was related to this installation. Now what was exactly the problem.

Together with the installation of the Oracle Designer a different Oracle Client has been installed as well. This new Oracle Client has been set as the default home. The problem is that we use TNS NAMES to resolve the Oracle Servers and under the NETWORK\ADMIN folder of this new client there was no TNSNAMES.ORA therefore the OCIEnvNlsCreate fails because it cannot find a TNSNAMES.ORA.

This problem can be solved in different ways:

  1. Change the default home
  2. Add the System Environment variable TNS_ADMIN

Because we use different Oracle Clients the best solution was to add the System Environment variable TNS_ADMIN that points to the directory that contains a TNSNAMES.ORA. By adding this environment variable all Oracle Clients will use the same TNSNAMES.ORA file.


Cross-posted from The .NET Aficionado Posted on Tuesday, October 3, 2006 7:00 AM Tips & Tricks , Oracle | Back to top


Comments on this post: OCIEnvNlsCreate failed with return code -1

# Любопытно
Requesting Gravatar...
Пожалуй, это один из интереснейших блогов, которые я когда-либо читал :). Интересные статьи, Занимательные комментарии. Так держать! :)
Left by Вячеслав on Aug 22, 2009 5:31 AM

# re: OCIEnvNlsCreate failed with return code -1
Requesting Gravatar...
, 没, , , , , , ,,,,,
Left by 1112 on Feb 22, 2010 8:27 PM

Your comment:
 (will show your gravatar)


Copyright © Gabriel Lozano-Morán | Powered by: GeeksWithBlogs.net