HowTo – Problema con Oracle Client e WCF Services su IIS

Interessante problema con relativa soluzione segnalata dal mio collega Gregor.

Situazione:

  • Server Windows 2003
  • IIS
  • .NET Framework 3.5 SP1
  • Oracle Client 9.2

Dopo aver configurato il sito web con i servizi WCF che accedono ad un database Oracle, si verifica un problema durante il consumo dei servizi con un'eccezione che indica la necessità di utilizzare una versione di Oracle Client minimo 8.1.7 facendo intendere che il processo di IIS non riesce a trovare il necessario per comunicare con Oracle.

Il problema risiede invece sulla mancanza di diritti sulla Oracle Home.

Qui di seguito il testo che indica la soluzione al problema.

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 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.

0 comments:

Luca Ritossa Blog - Designed by Posicionamiento Web | Bloggerized by GosuBlogger