TNS:could not resolve the connect identifier specified I have done the research

7

I know, I know, you're going to tell me to check my paths and registry. I have, believe me.

My situation--we have two boxes running identical code with identical web.config files. Below are the specifications of both.

  • IIS 7.0, configured to reset the app pool at midnight
  • Oracle.ManagedDataAccess.dll, v 4.121.1.0
  • .NET 4.0 ASP.NET website

Relevant config section:

<oracle.manageddataaccess.client>
        <version number="*">
            <settings>
                <setting name="TraceFileName" value="C:\MDM\TraceLog\"/>
                <setting name="TraceLevel" value="7"/>
                <setting name="SelfTuning" value="0"/>
                <setting name="TNS_ADMIN" value="C:\MDM\tnsnames"/>
            </settings>
        </version>
</oracle.manageddataaccess.client>

Our problems began when we upgraded from unmanaged Oracle to the managed.

SYMPTOMS: The main page of our site has an automatic refresh feature, such that every 2 minutes it reloads the page. Some of our users leave it open when they leave at the end of the day. At midnight, the app pool recycles. At about 12:02, since the release of the Oracle.ManagedDataAccess.dll we've been getting consistent could not resolve the connect identifier errors, which persist on any call out to the database until the app pool is recycled, at which point everything works swimmingly.

   Oracle.ManagedDataAccess.Client.OracleException (0x80004005): ORA-12154: TNS:could not resolve the connect identifier specified ---> OracleInternal.Network.NetworkException (0x00002F7A): ORA-12154: TNS:could not resolve the connect identifier specified
       at OracleInternal.Network.AddressResolution..ctor(String TNSAlias, String instanceName)
       at OracleInternal.Network.OracleCommunication.DoConnect(String tnsDescriptor)
       at OracleInternal.ServiceObjects.OracleConnectionImpl.Connect(ConnectionString cs, Boolean bOpenEndUserSession, String instanceName)
       at OracleInternal.ConnectionPool.PoolManager`3.CreateNewPR(Int32 reqCount, Boolean bForPoolPopulation, ConnectionString csWithDiffOrNewPwd, String instanceName)
       at OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, String affinityInstanceName, Boolean bForceMatch)
       at OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, String affinityInstanceName, Boolean bForceMatch)
       at OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword)
       at Oracle.ManagedDataAccess.Client.OracleConnection.Open()

TNSPING is able to connect to the databases without issue. I left pages that hit both our boxes directly open last night, and only one of them displayed this issue. The tnsnames.ora file is located in the c:\mdm\tnsnames directory on both machines. The tnsnames.ora file is the most up to date file from our DB team.

The most infuriating part of this is that the connections work beautifully once the app pool is reset. No issues, no performance impact, and it didn't appear in our lower environments at all. I'm not able to provide a trace log because no matter what I do to the trace settings nothing shows up in the c:\mdm\tracelog directory.

Anyone have any ideas as to why this is happening?

EDITS: There is no environment variable TNS_ADMIN; the registry variable is pointing to the same location as the config file.

All users have full permission on the tnsnames.ora file.

There are only two tnsnames.ora files, mine and the sample one included in the previous installation. There are three sqlnet.ora files, one in the same directory as the tnsnames.ora file, one in the %ORACLEHOME%\network\admin folder, and one in the %ORACLEHOME%\network\admin\sample folder.

c#
asp.net
oracle
iis
asked on Stack Overflow Apr 23, 2015 by Marisa • edited Apr 23, 2015 by Marisa

1 Answer

0

If everythings works when you reset the AppPool, then it does not sound like it's related to TNSNAMES.ORA. It sounds more like the AppPool is stopping but not recycling.

Also, you mentioned that your main pages refresh and hit the server every two minutes, if they hit the server when the AppPool is recycling and fail, could this be causing the AppPool's Rapid-Fail Protection to shut it down? The AppPool comes with an option to Generate Recycle Event Log Entry, by default it's doesn't show much, you need to choose what you want to record. This log may hold more clues as to why the recycle event is not flying.

The log itself is a little hard to find, here's a link that may help you:

https://webmasters.stackexchange.com/questions/17630/which-event-log-file-does-iis-7-app-pool-log-to

answered on Stack Overflow Jul 29, 2015 by BasicIsaac • edited Apr 13, 2017 by Community

User contributions licensed under CC BY-SA 3.0