Oracle Home Issue while trying to connect to Oracle

Oracle Home Issue while trying to connect to Oracle

Postby faroukzy » Fri 18 Nov 2011 05:34

I am trying to deploy my application on Windows server 2003, I was earlier faced with licence related errors, I fixed that and now I am faced with connection to Oracle issue.

The server is 32bit and Oracle client is 32bit.
Oracle 10g

I eventually tried setting up my application on VS2008 that was already installed on the server and I ran the application from the IDE (IDE used development server) and everything worked well but the version packaged and installed on IIS for production would not work on the same server.

I am getting the error below.

Please help resolved the issue. Being battling with it for days now. Thanks.

Code: Select all
Devart.Data.Linq.LinqCommandExecutionException: Error on opening DbConnection. ---> System.IO.FileNotFoundException: Can not load Oracle client library oci.dll from home OraDb10g_home1.
   at Devart.Data.Oracle.OracleHome.get_ClientVersion()
   at Devart.Data.Oracle.av.a(Boolean A_0, Boolean A_1, OracleHome A_2, Boolean A_3)
   at Devart.Data.Oracle.OracleInternalConnection..ctor(aa connectionOptions, OracleInternalConnection proxyConnection)
   at Devart.Data.Oracle.cs.a(k A_0, Object A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, k A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionPoolGroup.a(DbConnectionPool A_0, DbConnectionBase A_1)
   at Devart.Common.DbConnectionPool.a(DbConnectionBase A_0)
   at Devart.Common.DbConnectionPool.GetObject(DbConnectionBase owningConnection)
   at Devart.Common.DbConnectionFactory.a(DbConnectionBase A_0)
   at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
   at Devart.Common.DbConnectionBase.Open()
   at Devart.Data.Oracle.OracleConnection.Open()
   at Devart.Data.Linq.Provider.k.a.g()
   --- End of inner exception stack trace ---
   at Devart.Data.Linq.LinqCommandExecutionException.CanThrowLinqCommandExecutionException(String message, Exception e)
   at Devart.Data.Linq.Provider.k.a.g()
   at Devart.Data.Linq.Provider.k.a.b(IConnectionUser A_0)
   at Devart.Data.Linq.Provider.k.b(IConnectionUser A_0)
   at Devart.Data.Linq.Provider.DataProvider.ExecuteQuery(CompiledQuery compiledQuery, Object[] parentArgs, Object[] userArgs, Object lastResult)
   at Devart.Data.Linq.Provider.DataProvider.ExecuteAllQueries(CompiledQuery compiledQuery, Object[] userArguments)
   at Devart.Data.Linq.Provider.DataProvider.Devart.Data.Linq.Provider.IProvider.Execute(Expression query)
   at Devart.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute[S](Expression expression)
   at System.Linq.Queryable.Count[TSource](IQueryable`1 source)
   at com.encentral.trustfund.dal.NsitfScheduleDal.getStates()
   at com.encentral.trustfund.bll.NsitfScheduleBll.getStates()
   at com.encentral.trustfund.service.NSITFWebService.getStates()
faroukzy
 
Posts: 4
Joined: Fri 18 Nov 2011 05:03
Location: Nigeria

Update to previous post:

Postby faroukzy » Sat 19 Nov 2011 11:56

So far I have tried all sort of things to get this to work but to no avail.

Here are the things I have tried.

I gave C:\oracle\product\10.0.0\DB_1\BIN permission for everyone. After I did this, the FileIOException disappeared now I have PATH and REGISTRY related error.

I set up a custom policy file: web_customtrust.config
Code: Select all

   
       
           
               
                   
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                  
                  
                     

                   
                       
                       
                       
                           
                           
                           
                           
                           
                           
                           
                           
                           
                     
                     
                           
                               
                                   
                               

                           

                           
                         

                   

                   
                       
                       
                           
                       

                       
                           
                       

                       
                           
                           
                               
                           

                           
                               
                           

                       

                   

               

           

       

   




I updated the system.web of my web.config file to this:
Code: Select all

      
      
         
            
            
            
            
            
         

      

      
      
      
      
         
            
            
         

      

      
         
         
         
         
      

      
         
      

      
      
         
      

      
   



I created a webpage to display registry and path information:
Code: Select all
string path = Environment.GetEnvironmentVariable("PATH");
        Microsoft.Win32.RegistryKey keys = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\ORACLE");

        Response.Write("Keys: " + keys.ToString() + "
");
        Response.Write("Path : " + path + "
");


Keys: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
Path : C:\oracle\product\10.1.0\Db_1\BIN;C:\sybase\OCS-12_5\dll;C:\sybase\OCS-12_5\bin;C:\sybase\ODBC;C:\sybase\SQLRemote\dll;C:\sybase\RPL-12_5\bin;C:\sybase\JS-12_5\bin;C:\sybase\ASE-12_5\dll;C:\sybase\ASE-12_5\bin;C:\oracle\product\10.1.0\Db_1\bin;C:\oracle\product\10.1.0\Db_1\jre\1.4.2\bin\client;C:\oracle\product\10.1.0\Db_1\jre\1.4.2\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\MsNfs\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Java\jdk1.6.0_06\bin;


At the end of the day, I still see this error.
Code: Select all
Devart.Data.Linq.LinqCommandExecutionException: Error on opening DbConnection. ---> Devart.Data.Oracle.OracleException: Can not load Oracle client. Check your PATH environment variable and registry settings.
   at Devart.Data.Oracle.aw..ctor(Boolean A_0, Boolean A_1, OracleHome A_2)
   at Devart.Data.Oracle.aw.a(Boolean A_0, Boolean A_1, OracleHome A_2, Boolean A_3)
   at Devart.Data.Oracle.OracleInternalConnection..ctor(aa connectionOptions, OracleInternalConnection proxyConnection)
   at Devart.Data.Oracle.cs.a(k A_0, Object A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, k A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionPoolGroup.a(DbConnectionPool A_0, DbConnectionBase A_1)
   at Devart.Common.DbConnectionPool.a(DbConnectionBase A_0)
   at Devart.Common.DbConnectionPool.GetObject(DbConnectionBase owningConnection)
   at Devart.Common.DbConnectionFactory.a(DbConnectionBase A_0)
   at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
   at Devart.Common.DbConnectionBase.Open()
   at Devart.Data.Oracle.OracleConnection.Open()
   at Devart.Data.Linq.Provider.k.a.g()
   --- End of inner exception stack trace ---
   at Devart.Data.Linq.LinqCommandExecutionException.CanThrowLinqCommandExecutionException(String message, Exception e)
   at Devart.Data.Linq.Provider.k.a.g()
   at Devart.Data.Linq.Provider.k.a.b(IConnectionUser A_0)
   at Devart.Data.Linq.Provider.k.b(IConnectionUser A_0)
   at Devart.Data.Linq.Provider.DataProvider.ExecuteQuery(CompiledQuery compiledQuery, Object[] parentArgs, Object[] userArgs, Object lastResult)
   at Devart.Data.Linq.Provider.DataProvider.ExecuteAllQueries(CompiledQuery compiledQuery, Object[] userArguments)
   at Devart.Data.Linq.Provider.DataProvider.Devart.Data.Linq.Provider.IProvider.Execute(Expression query)
   at Devart.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute[S](Expression expression)
   at System.Linq.Queryable.Count[TSource](IQueryable`1 source)
   at com.encentral.trustfund.dal.NsitfScheduleDal.getStates()
   at com.encentral.trustfund.bll.NsitfScheduleBll.getStates()
   at com.encentral.trustfund.service.NSITFWebService.getStates()


PLEASE HELP!!!
faroukzy
 
Posts: 4
Joined: Fri 18 Nov 2011 05:03
Location: Nigeria

Update to previous post:

Postby faroukzy » Sat 19 Nov 2011 11:57

So far I have tried all sort of things to get this to work but to no avail.

Here are the things I have tried.

I gave C:\oracle\product\10.0.0\DB_1\BIN permission for everyone. After I did this, the FileIOException disappeared now I have PATH and REGISTRY related error.

I set up a custom policy file: web_customtrust.config
Code: Select all

   
       
           
               
                   
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                  
                  
                     

                   
                       
                       
                       
                           
                           
                           
                           
                           
                           
                           
                           
                           
                     
                     
                           
                               
                                   
                               

                           

                           
                         

                   

                   
                       
                       
                           
                       

                       
                           
                       

                       
                           
                           
                               
                           

                           
                               
                           

                       

                   

               

           

       

   




I updated the system.web of my web.config file to this:
Code: Select all

      
      
         
            
            
            
            
            
         

      

      
      
      
      
         
            
            
         

      

      
         
         
         
         
      

      
         
      

      
      
         
      

      
   



I created a webpage to display registry and path information:
Code: Select all
string path = Environment.GetEnvironmentVariable("PATH");
        Microsoft.Win32.RegistryKey keys = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\ORACLE");

        Response.Write("Keys: " + keys.ToString() + "
");
        Response.Write("Path : " + path + "
");


Keys: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
Path : C:\oracle\product\10.1.0\Db_1\BIN;C:\sybase\OCS-12_5\dll;C:\sybase\OCS-12_5\bin;C:\sybase\ODBC;C:\sybase\SQLRemote\dll;C:\sybase\RPL-12_5\bin;C:\sybase\JS-12_5\bin;C:\sybase\ASE-12_5\dll;C:\sybase\ASE-12_5\bin;C:\oracle\product\10.1.0\Db_1\bin;C:\oracle\product\10.1.0\Db_1\jre\1.4.2\bin\client;C:\oracle\product\10.1.0\Db_1\jre\1.4.2\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\MsNfs\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Java\jdk1.6.0_06\bin;


At the end of the day, I still see this error.
Code: Select all
Devart.Data.Linq.LinqCommandExecutionException: Error on opening DbConnection. ---> Devart.Data.Oracle.OracleException: Can not load Oracle client. Check your PATH environment variable and registry settings.
   at Devart.Data.Oracle.aw..ctor(Boolean A_0, Boolean A_1, OracleHome A_2)
   at Devart.Data.Oracle.aw.a(Boolean A_0, Boolean A_1, OracleHome A_2, Boolean A_3)
   at Devart.Data.Oracle.OracleInternalConnection..ctor(aa connectionOptions, OracleInternalConnection proxyConnection)
   at Devart.Data.Oracle.cs.a(k A_0, Object A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, k A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionPoolGroup.a(DbConnectionPool A_0, DbConnectionBase A_1)
   at Devart.Common.DbConnectionPool.a(DbConnectionBase A_0)
   at Devart.Common.DbConnectionPool.GetObject(DbConnectionBase owningConnection)
   at Devart.Common.DbConnectionFactory.a(DbConnectionBase A_0)
   at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
   at Devart.Common.DbConnectionBase.Open()
   at Devart.Data.Oracle.OracleConnection.Open()
   at Devart.Data.Linq.Provider.k.a.g()
   --- End of inner exception stack trace ---
   at Devart.Data.Linq.LinqCommandExecutionException.CanThrowLinqCommandExecutionException(String message, Exception e)
   at Devart.Data.Linq.Provider.k.a.g()
   at Devart.Data.Linq.Provider.k.a.b(IConnectionUser A_0)
   at Devart.Data.Linq.Provider.k.b(IConnectionUser A_0)
   at Devart.Data.Linq.Provider.DataProvider.ExecuteQuery(CompiledQuery compiledQuery, Object[] parentArgs, Object[] userArgs, Object lastResult)
   at Devart.Data.Linq.Provider.DataProvider.ExecuteAllQueries(CompiledQuery compiledQuery, Object[] userArguments)
   at Devart.Data.Linq.Provider.DataProvider.Devart.Data.Linq.Provider.IProvider.Execute(Expression query)
   at Devart.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute[S](Expression expression)
   at System.Linq.Queryable.Count[TSource](IQueryable`1 source)
   at com.encentral.trustfund.dal.NsitfScheduleDal.getStates()
   at com.encentral.trustfund.bll.NsitfScheduleBll.getStates()
   at com.encentral.trustfund.service.NSITFWebService.getStates()


PLEASE HELP!!!
faroukzy
 
Posts: 4
Joined: Fri 18 Nov 2011 05:03
Location: Nigeria

Update:

Postby faroukzy » Sat 19 Nov 2011 15:57

Eventually I was able to resolve the issue but in a manner which is not recomended.

Because I know the problem has to do with system resource access issues I decided to set permission on %oraclehome%/bin to EVERYONE. With further errors, I set the same permission on the folder containing Oracle TNS names and eventually the magic occured when I set the same permission on the whole Oracle folder in the C: directory and its contents.

It has been three days...
faroukzy
 
Posts: 4
Joined: Fri 18 Nov 2011 05:03
Location: Nigeria

Postby StanislavK » Wed 23 Nov 2011 15:46

Sorry for the delay, and glad to see that the problem was resolved.

Generally, dotConnect for Oracle searches for Oracle homes based on the information provided in the registry and/or the PATH environmental variable. Having the information on the oci.dll location, dotConnect for Oracle works with the server via this library. Thus, the only permissions related to dotConnect for Oracle are the ones to
1) the Oracle-related registry entries;
2) the PATH variable;
3) the folder containing the oci.dll library.

All other necessary permissions completely depend on the behaviour of oci.dll. For the information on the permissions it needs, please refer to the Oracle documentation or support.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48


Return to dotConnect for Oracle