locked
OCIEnvCreate failed with return code -1 but error message text was not available. RRS feed

  • Question

  • User-1077881737 posted

    Hi,

    We have a requirement to connect to oracle from ASP.NET and we installed ODAC(ODAC1110621) components  on the server but still we are getting the following error while opening the connection. Please find the details below:-

    OCIEnvCreate failed with return code -1 but error message text was not available.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Exception: OCIEnvCreate failed with return code -1 but error message text was not available.

    Source Error:

    Line 16:     {
    Line 17:         OracleConnection con = new OracleConnection(ConfigurationManager.ConnectionStrings["HRDBA"].ConnectionString);
    Line 18:         con.Open();
    Line 19:         Label1.Text = con.State.ToString();
    Line 20:         con.Close();


    Source File: \\hs003fs01-02.homebase.com\wfmp\Webpage1.aspx.cs    Line: 18

    Stack Trace:

    [Exception: OCIEnvCreate failed with return code -1 but error message text was not available.]
       System.Data.OracleClient.OciHandle..ctor(OciHandle parentHandle, HTYPE handleType, MODE ocimode, HANDLEFLAG handleflags) +376
       System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName) +151
       System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions) +133
       System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +40
       System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +29
       System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
       System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +72
       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +457
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +100
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +116
       System.Data.OracleClient.OracleConnection.Open() +40
       Webpage1.Page_Load(Object sender, EventArgs e) in \\hs003fs01-02.homebase.com\wfmp\Webpage1.aspx.cs:18
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +50
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
    



    I would be greteful if you could please suggest how i can fix this. The user is having full permissions on the Oracle folder.

    Many Thanks,

    Madhu

     

    <!-- [Exception]: OCIEnvCreate failed with return code -1 but error message text was not available. at System.Data.OracleClient.OciHandle..ctor(OciHandle parentHandle, HTYPE handleType, MODE ocimode, HANDLEFLAG handleflags) at System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName) at System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions) at System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.OracleClient.OracleConnection.Open() at Webpage1.Page_Load(Object sender, EventArgs e) in \\hs003fs01-02.homebase.com\wfmp\Webpage1.aspx.cs:line 18 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.webpage1_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\07971936\fa687e91\App_Web_vnm9shij.2.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->
    Monday, November 30, 2009 12:44 PM

All replies

  • User-1858676543 posted

    Madhu,

               Have you found any solution?

    Friday, October 15, 2010 1:33 AM
  • User-1858676543 posted

    I have found the solution


    Oracle Client software requires that you give the Authenticated User
    privilege to the Oracle Home by following these steps:
    
    1.  Log on to Windows as a user with Administrator privileges.
    
    2.  Launch Windows Explorer from the Start Menu and navigate to the
    ORACLE_HOME folder.  This is typically...
    
    - the "Ora92" folder under the "Oracle" folder
    (i.e. D:\Oracle\Ora92) in Oracle9iR2
    
    or
    
    - the "Client_1" folder under the "Oracle\product\10.1.0" folder
    (i.e. D:\Oracle\product\10.1.0\Client_1) in Oracle10gR1
    
    or
    
    - the "Db_1" folder under the "Oracle\product\10.1.0" folder
    (i.e. D:\Oracle\product\10.1.0\Db_1) in Oracle10gR1
    
    3.  Right-click on the ORACLE_HOME folder and choose the "Properties" option
    from the drop down list.  A "Properties" window should appear.
    
    4.  Click on the "Security" tab of the "Properties" window.
    
    NOTE: If you are running Windows XP and do not have a "Security" tab
    please do the following:
    
    (a) Open "Folder Options" in your Control Panel.
    (b) Choose the "View" tab.
    (c) Under "Advanced Settings" uncheck the option "Use simple file
    sharing (Recommended)".
    
    The "Security" tab should now be available.
    
    5.  Click on "Authenticated Users" item in the "Name" list (on Windows XP
    the "Name" list is called "Group or user names").
    
    6.  Uncheck the "Read and Execute" box in the "Permissions" list under the
    
    7.  Re-check the "Read and Execute" box under the "Allow" column (this is
    the box you just unchecked).
    
    8.  Click the "Advanced" button and in the "Permission Entries" list make
    sure you see the "Authenticated Users" listed there with:
    
    Permission = Read & Execute
    Apply To = This folder, subfolders and files
    
    If this is NOT the case, edit that line and make sure the "Apply onto"
    drop-down box is set to "This folder, subfolders and files".  This
    should already be set properly but it is important that you verify this.
    
    9.  Click the "Ok" button until you close out all of the security properties
    windows.  The cursor may present the hour glass for a few seconds as it
    applies the permissions you just changed to all subfolders and files.
    
    10.  You must REBOOT YOUR COMPUTER to assure that these changes have taken
    effect.  Failure to do this can prevent this procedure from working!
    
    11.  Re-execute the application and it should now work.
    
    
    NOTE: If the problem is still present after following steps 1-11 and
    rebooting your computer in step 10 you should perform the following
    two additional permissions settings at step 8 as described below.
    
    This may be necessary due to permissions that have been configured
    beyond the standard permissions setup when the OS was originally
    installed:
    
    12.  If the problem is still present, go back through these same 11 steps
    above, but when performing step 8 additionally check both boxes entitled
    
    objects.  Include these with entries explicitly defined here."


    http://www.eggheadcafe.com/software/aspnet/31897247/oracleclient-oracle-10g-connection-failure.aspx

    Friday, October 15, 2010 2:40 AM
  • User-1202966220 posted

    Thank you, It's working with me with Version 11.2.0

    Friday, January 11, 2013 11:11 AM