OracleClient and OCI.dll

J

James Tillery

I'm getting this error when I run, but I'm able to connect and get data from
adapter in design mode. What's my problem please.

[DllNotFoundException: Unable to load DLL (oci.dll).]
System.Data.OracleClient.DBObjectPool.GetObject(Object owningObject,
Boolean& isInTransaction)
System.Data.OracleClient.OracleConnectionPoolManager.GetPooledConnection(String
encryptedConnectionString, OracleConnectionString options, OracleConnection
owningObject, Boolean& isInTransaction)
System.Data.OracleClient.OracleConnection.OpenInternal(OracleConnectionString
parsedConnectionString, Object transact)
System.Data.OracleClient.OracleConnection.Open()
Filter.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\aspnet_client\filter\webform1.aspx.cs:29
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
 
G

Guest

Hi james,
your asp.net user account needs enough permission to execute the code.
Try giving your asp.net user account administrator access rights

Go to --> Local Users and Groups --> Users --> ASPNET (right click &
properties) --> Member of --> Add --> Administrator. --> Add --> Ok

HTH

Regards
Vinesh Mamania
 
R

Roy Fine

Vinesh Mamania said:
Hi james,
your asp.net user account needs enough permission to execute the code.
Try giving your asp.net user account administrator access rights

Go to --> Local Users and Groups --> Users --> ASPNET (right click &
properties) --> Member of --> Add --> Administrator. --> Add --> Ok

ABSOLUTELY NOT -- unnecessarily promoting an account to a member of the
administrator group is a most serious bad-practice with respect to security.

A better approach would be to find the value of ORACLE_HOME (look at the
value of the ORACLE_HOME key in the registry
HKEY_LOCAL_MACHINE\Software\Oracle) and give the ASPNET account read and
execute access to that path.

regards
roy fine
 
P

Paul Clement

¤ I'm getting this error when I run, but I'm able to connect and get data from
¤ adapter in design mode. What's my problem please.
¤
¤ [DllNotFoundException: Unable to load DLL (oci.dll).]
¤ System.Data.OracleClient.DBObjectPool.GetObject(Object owningObject,
¤ Boolean& isInTransaction)
¤ System.Data.OracleClient.OracleConnectionPoolManager.GetPooledConnection(String
¤ encryptedConnectionString, OracleConnectionString options, OracleConnection
¤ owningObject, Boolean& isInTransaction)
¤ System.Data.OracleClient.OracleConnection.OpenInternal(OracleConnectionString
¤ parsedConnectionString, Object transact)
¤ System.Data.OracleClient.OracleConnection.Open()
¤ Filter.WebForm1.Page_Load(Object sender, EventArgs e) in
¤ c:\inetpub\wwwroot\aspnet_client\filter\webform1.aspx.cs:29
¤ System.Web.UI.Control.OnLoad(EventArgs e)
¤ System.Web.UI.Control.LoadRecursive()
¤ System.Web.UI.Page.ProcessRequestMain()
¤
¤

Here is the Oracle Metalink article that covers this issue:

Problem Description
-------------------

When running an application using the Oracle9i Release 2 (9.2.0.1.0) install
of client software and that attempts to connect to an Oracle database with the
Authenticated User privilege (such as when you use Microsoft's Internet
Information Server (IIS)) through any of the following programmatic interfaces

1. Oracle Provider for OLE DB
2. Microsoft OLE DB Provider for Oracle
3. Oracle ODBC Driver
4. Microsoft ODBC for Oracle
5. Oracle Objects for OLE (OO4O)
6. Microsoft .NET Framework Data Provider for Oracle


you may receive one of the following errors:


(1) Oracle Provider for OLE DB

(a) Error Type: Microsoft OLE DB Service Components (0x80070005)

Access is denied.


(b) OraOLEDB.Oracle Provider is not registered on the local machine


(2) Microsoft OLE DB Provider for Oracle

(a) Error Type: Microsoft OLE DB Provider for Oracle (0x80004005)

Oracle client and networking components were not found. These
components are supplied by Oracle Corporation and are part of the
Oracle Version 7.3.3 or later client software installation. Provider
is unable to function until these components are installed.


(b) Error Type: Microsoft OLE DB Provider for Oracle (0x80004005)

Oracle error occurred, but error message could not be retrieved
from Oracle.


(3) Oracle ODBC Driver

(a) Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005)

Specified driver could not be loaded due to system error 5 (Oracle
in OraHome92).


(4) Microsoft ODBC for Oracle

(a) The Oracle(tm) client and networking components were not found.
These components are supplied by Oracle Corporation and are part
of the Oracle Version 7.3 (or greater) client software installation.

You will be unable to use this driver until these components have
been installed.


(b) Error number: -2147467259

Error Description: [Microsoft][ODBC Driver Manager] Driver's
SQLAllocHandle on SQL_HANDLE_ENV failed


(5) Oracle Objects for OLE

(a) while using a GLOBAL.ASA file

Error Type: Active Server Pages (0x0)

An error occurred while creating object 'OraSession'.


(b) not using a GLOBAL.ASA file

Error Type: Microsoft VBScript runtime (0x800A0046)

Permission denied: 'CreateObject'


(6) Microsoft .NET Framework Data Provider for Oracle

(a) System.DllNotFoundException: Unable to load DLL (oci.dll).
at System.Data.OracleClient.DBObjectPool.GetObject(Boolean&
isInTransaction)
at System.Data.OracleClient.OracleConnectionPoolManager.
GetPooledConnection(String encryptedConnectionString,
OracleConnectionString options, Boolean& isInTransaction)
at System.Data.OracleClient.OracleConnection.OpenInternal
(OracleConnectionString parsedConnectionString, Object transact)
at System.Data.OracleClient.OracleConnection.Open()
at WCWSItemAvailability.ETAAvailability.SingleAvailability(String
ItemNumber, String BusinessUnit, Int32 OrderQty, Int32&
AvailableQty, Int32& OnHandQty, String& ETADate, Int32& Error)
at WCWSItemAvailability.ETAAvailability.XMLAvailability(String
XMLInput)


(7) Other miscellaneous errors

(a) The Specified Module Could Not Be Found

(b) ORA-00604: error occurred at recursive SQL level 1
ORA-12705: invalid or unknown NLS parameter value specified

(c) Unable to load DLL (OraOps9.dll):
...
[DllNotFoundException: Unable to load DLL (OraOps9.dll).]

(d) System Error 998 trying to run ASP page


Solution Description
--------------------

Oracle 9.2 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).

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.

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
"Allow" column (on Windows XP the "Permissions" list is called
"Permissions for Authenticated Users").

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. Reboot your computer to assure that these changes have taken effect.


Re-execute the application and it should now work.


Explanation
-----------

If you install Oracle9i Release 2 (9.2.0.1.0) on a computer running Windows
with an NTFS partition, the contents of ORACLE_HOME directory will not be
visible to users who are authenticated on that machine. These permissions
were not set properly when the software was installed.

Applications that were working fine with previous versions of Oracle software
will stop working when they upgrade to Oracle 9.2.

NOTE: The application will continue to work if the user has logged onto the
machine as an Administrator.

Any application that is using the Authenticated User privilege will not work.
A notable example would be IIS which might service some of the requests based
on the Authenticated User privileges.

To demonstrate the problem in further detail, you can log on to the operating
system as an authenticated machine user. You won't be able browse the contents
of the ORACLE_HOME directory demonstrating your inability to load any Oracle DLLs
or make a connection.


Additional Information
----------------------

The above error messages may not only be encountered when using Oracle 9.2
client software but may also exists when running into general permissions
issues using third party products on a Windows platform.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
R

Roy Fine

Sahil Malik said:
I agree with that. ASPNET should not be given admin rights, that's suicide.
I personally don't like giving ASPNET access to even the ORACLE_HOME
directory, but I don't like oracle in the first place ( See ..
http://dotnetjunkies.com/WebLog/sahilmalik/archive/2004/08/28/23563.aspx )

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik

Your Oracle Sucks article has some serious shortcomings.

The number of CD's in the installation is not relevant to "bloat" - it is a
function of compression and features, etc. There is a lot of stuff on the
three Oracle CDs that is not on the SqlServer CD - so your comparisons are
flawed.

Your item B is flawed as well - when SqlServer starts (by default) it
consumes all available real memory. Oracle consumes a fixed amount
(established by max_sga_size init parameter) and variable amount determined
by the client process (or server instance) and whether or not you are
running dedicated or shared server. You are wrong to state that Oracle
memory usage goes up exponentially - the statement is wrong and using such
removes your works from the realm of objectivity.

Oracle and SqlServer implemented two very different scenarios - before one
can judge the merits of one vis-a-vis another, one must have a comparable
understanding of each. SqlServer requires much less knowledge to get it up
and running - that is a design consideration, and on that account, it does
pretty good at it. Oracle strives to run on many platforms, and focuses on
performance, security and stability, and on those accounts, it's pretty good
at it.

Item C - point well taken - but remember - Oracle runs on MANY platforms,
and it does a pretty good job of providing a consistent interface across
those platforms. Microsoft SqlServer runs on one platform, and it does a
pretty good job of providing a consistent interface vis-a-vis other
applications on that same/singular platform. Oracle is not good at looking
like SqlServer, but it gets no bad marks in that regard, because that was
never an advertised capability.

Item D - good point.

Item E - another good point - the registry has been forever tattooed

With respect to Larry Ellison's feeling towards Bill Gates, I have no
information - but I suspect yours is only an opinion, not something that can
be substantiated. However, the success of Oracle is based on the quality of
the product, not on the mindset of those that are using it. For high-end
systems, SqlServer does not measure up. That is not necessarily a fault of
the product, at least not directly, but rather the limitation of the
platform. The high end dual and quad processor Xeon machines running
Windows server O/S pale in comparison to multiprocessor RISC based hardware
with large physical memory capacity and high bandwidth I/O subsystems
(memory and storage)

Oracle is quite a bit more difficult to administer - and I suspect that such
is at the root of many of your dislikes with the product. You would serve
yourself and those that lend their ears to take the time to learn the
product, then proffer an objective comparison.

regards
roy
 
J

James Tillery

Thanks...I knew about the owner issue, but had forgotten. I have been using
SQL server. I believe I'll use the Oracle Home method. I appreciate all of
your inputs.

Jim


Paul Clement said:
¤ I'm getting this error when I run, but I'm able to connect and get data
from
¤ adapter in design mode. What's my problem please.
¤
¤ [DllNotFoundException: Unable to load DLL (oci.dll).]
¤ System.Data.OracleClient.DBObjectPool.GetObject(Object owningObject,
¤ Boolean& isInTransaction)
¤
System.Data.OracleClient.OracleConnectionPoolManager.GetPooledConnection(String
¤ encryptedConnectionString, OracleConnectionString options,
OracleConnection
¤ owningObject, Boolean& isInTransaction)
¤
System.Data.OracleClient.OracleConnection.OpenInternal(OracleConnectionString
¤ parsedConnectionString, Object transact)
¤ System.Data.OracleClient.OracleConnection.Open()
¤ Filter.WebForm1.Page_Load(Object sender, EventArgs e) in
¤ c:\inetpub\wwwroot\aspnet_client\filter\webform1.aspx.cs:29
¤ System.Web.UI.Control.OnLoad(EventArgs e)
¤ System.Web.UI.Control.LoadRecursive()
¤ System.Web.UI.Page.ProcessRequestMain()
¤
¤

Here is the Oracle Metalink article that covers this issue:

Problem Description
-------------------

When running an application using the Oracle9i Release 2 (9.2.0.1.0)
install
of client software and that attempts to connect to an Oracle database with
the
Authenticated User privilege (such as when you use Microsoft's Internet
Information Server (IIS)) through any of the following programmatic
interfaces

1. Oracle Provider for OLE DB
2. Microsoft OLE DB Provider for Oracle
3. Oracle ODBC Driver
4. Microsoft ODBC for Oracle
5. Oracle Objects for OLE (OO4O)
6. Microsoft .NET Framework Data Provider for Oracle


you may receive one of the following errors:


(1) Oracle Provider for OLE DB

(a) Error Type: Microsoft OLE DB Service Components (0x80070005)

Access is denied.


(b) OraOLEDB.Oracle Provider is not registered on the local machine


(2) Microsoft OLE DB Provider for Oracle

(a) Error Type: Microsoft OLE DB Provider for Oracle (0x80004005)

Oracle client and networking components were not found. These
components are supplied by Oracle Corporation and are part of
the
Oracle Version 7.3.3 or later client software installation.
Provider
is unable to function until these components are installed.


(b) Error Type: Microsoft OLE DB Provider for Oracle (0x80004005)

Oracle error occurred, but error message could not be retrieved
from Oracle.


(3) Oracle ODBC Driver

(a) Error Type: Microsoft OLE DB Provider for ODBC Drivers
(0x80004005)

Specified driver could not be loaded due to system error 5
(Oracle
in OraHome92).


(4) Microsoft ODBC for Oracle

(a) The Oracle(tm) client and networking components were not found.
These components are supplied by Oracle Corporation and are part
of the Oracle Version 7.3 (or greater) client software
installation.

You will be unable to use this driver until these components
have
been installed.


(b) Error number: -2147467259

Error Description: [Microsoft][ODBC Driver Manager] Driver's
SQLAllocHandle on SQL_HANDLE_ENV failed


(5) Oracle Objects for OLE

(a) while using a GLOBAL.ASA file

Error Type: Active Server Pages (0x0)

An error occurred while creating object 'OraSession'.


(b) not using a GLOBAL.ASA file

Error Type: Microsoft VBScript runtime (0x800A0046)

Permission denied: 'CreateObject'


(6) Microsoft .NET Framework Data Provider for Oracle

(a) System.DllNotFoundException: Unable to load DLL (oci.dll).
at System.Data.OracleClient.DBObjectPool.GetObject(Boolean&
isInTransaction)
at System.Data.OracleClient.OracleConnectionPoolManager.
GetPooledConnection(String encryptedConnectionString,
OracleConnectionString options, Boolean& isInTransaction)
at System.Data.OracleClient.OracleConnection.OpenInternal
(OracleConnectionString parsedConnectionString, Object
transact)
at System.Data.OracleClient.OracleConnection.Open()
at
WCWSItemAvailability.ETAAvailability.SingleAvailability(String
ItemNumber, String BusinessUnit, Int32 OrderQty, Int32&
AvailableQty, Int32& OnHandQty, String& ETADate, Int32& Error)
at WCWSItemAvailability.ETAAvailability.XMLAvailability(String
XMLInput)


(7) Other miscellaneous errors

(a) The Specified Module Could Not Be Found

(b) ORA-00604: error occurred at recursive SQL level 1
ORA-12705: invalid or unknown NLS parameter value specified

(c) Unable to load DLL (OraOps9.dll):
...
[DllNotFoundException: Unable to load DLL (OraOps9.dll).]

(d) System Error 998 trying to run ASP page


Solution Description
--------------------

Oracle 9.2 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).

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.

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
"Allow" column (on Windows XP the "Permissions" list is called
"Permissions for Authenticated Users").

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. Reboot your computer to assure that these changes have taken effect.


Re-execute the application and it should now work.


Explanation
-----------

If you install Oracle9i Release 2 (9.2.0.1.0) on a computer running
Windows
with an NTFS partition, the contents of ORACLE_HOME directory will not be
visible to users who are authenticated on that machine. These permissions
were not set properly when the software was installed.

Applications that were working fine with previous versions of Oracle
software
will stop working when they upgrade to Oracle 9.2.

NOTE: The application will continue to work if the user has logged onto
the
machine as an Administrator.

Any application that is using the Authenticated User privilege will not
work.
A notable example would be IIS which might service some of the requests
based
on the Authenticated User privileges.

To demonstrate the problem in further detail, you can log on to the
operating
system as an authenticated machine user. You won't be able browse the
contents
of the ORACLE_HOME directory demonstrating your inability to load any
Oracle DLLs
or make a connection.


Additional Information
----------------------

The above error messages may not only be encountered when using Oracle 9.2
client software but may also exists when running into general permissions
issues using third party products on a Windows platform.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top