41

I just migrated from XP to Win 7. I am guessing this error has to do with switching operating systems. I wrote a .net application that basically massages a large amount of data and then connects to a database and inserts/updates a table.

When I hit a button to connect to the database I run into the error regarding the oracle provider not being registered on my local machine.

A clear, step by step outline of how I can fix this quickly would be much appreciated.

The exact error message is:

'OraOLEDB.Oracle.1' provider is not registered on the local machine

Day
  • 9,465
  • 6
  • 57
  • 93
Jared
  • 539
  • 2
  • 6
  • 8
  • have you solved this problems? – Handsome Sep 04 '15 at 02:54
  • Please check this **[The OraOLEDB.Oracle provider is not registered on the local machine](https://debug.to/2289/ssrs-ole-db-oracle-provider-is-not-registered-on-the-local-machine)** – Mohamed Dec 13 '21 at 04:24

14 Answers14

61

I had the same issue after installing the 64 bit Oracle client on Windows 7 64 bit. The solution that worked for me:

  1. Open a command prompt in administrator mode
  2. cd \oracle\product\11.2.0\client_64\BIN
  3. c:\Windows\system32\regsvr32.exe OraOLEDB11.dll
Michał Powaga
  • 22,561
  • 8
  • 51
  • 62
Der Wolf
  • 1,171
  • 9
  • 11
  • If you have multiple different Oracle products across several versions then you might also need to use regsrv32.exe on those other versions as well, depending on which Oracle client is causing the exception. – S. Dixon Aug 07 '14 at 17:06
  • 15
    For those who've stumbled on this post but have the 32-bit Oracle client on a Win 7 64-bit machine, be sure to use the path: C:\Windows\SysWOW64\Regsvr32.exe (and of course refer to the proper Oracle 32-bit BIN dir) – jimo3 Nov 03 '14 at 22:20
  • what does cd stand for? and it throw me the system cannot find the path specified. – Handsome Sep 04 '15 at 02:54
  • 2
    At a command prompt, cd is the command for "change directory". Not all machines will have Oracle installed in the same place, so you may have to modify step 2 to match your installation folder. – Der Wolf Sep 07 '15 at 22:17
  • In my case I have enable IIS 32-bit application to true – Imran Qadir Baksh - Baloch Nov 29 '15 at 06:18
  • 1
    What do you do if you have both 32bit and 64bit clients installed? – Alan Macdonald Jan 21 '16 at 11:31
  • 1
    @stephen, you can have **only one** OLE DB Provider (actually one each for x86 and x64) registered on your PC - that's a [Windows COM](https://en.wikipedia.org/wiki/Component_Object_Model) limitation. – Wernfried Domscheit May 24 '17 at 14:25
  • This answer ended a frustrating search for fixing the Provider not found problem. Oracle web site did not address this in anything I looked at. – ScottinTexas Jul 15 '21 at 14:55
10

I had the same issue using IIS.

Make sure the option 'Enable 32bit Applications' is set to true on Advanced Configuration of the Application Pool.

Vagner Gon
  • 595
  • 9
  • 23
5
  1. Right Click on My Computer
  2. Click on properties
  3. Click on Advanced System Settings
  4. Click on "Environment Variables" button.
  5. In the system Variable section find the "PATH" variable
  6. Edit the "PATH" variable and add Oracle installation path to it (from your local machine) like ;C:\oracle\product\10.2.0\client_1\bin
Anjan Biswas
  • 7,746
  • 5
  • 47
  • 77
  • Restart might be needed afterwards. – David Acero Sep 26 '17 at 04:48
  • This was the fix for me. When installing odac from command line (ODAC183Xcopy_x64.zip -> install.bat) I noticed that the path was updated (echo %path%) to include the oracle bin folder, so I thought everything should be working, but still received the Provider OraOLEDB.Oracle not registered error message, then I noticed that if I open a new command prompt window, the path to the oracle bin folder was no longer included in the windows path, so I had to manually add the paths for the oracle and oracle bin folders to the windows path environment variable. – Roger Perkins Oct 04 '22 at 15:24
5

Do the following test:

Open a Command Prompt and type: tnsping instance_name

where instance_name is the name of the instance you want to connect (if it's a XE database, use "tnsping xe"

If it returns ok, follow steps of Der Wolf's answer. If doesn't return ok, follow steps of Annjawn's answer.

It solved for me in both cases.

julison
  • 81
  • 1
  • 4
4

If you have windows 64 bits, try to install oracle driver 32 bits first then 64 bits driver, thats what i do and is working

3

It only worked for me after I changed the 'Platform target' to 'x64' (considering I'm using Oracle 12c 64 bits)

To do that, I did:

  1. Right click on the project name (at the Solution Explorer panel locate, in general, at the left)

  2. Clicked on 'Build' (in the new opened window)

  3. Changed the 'Platform target' from 'Any CPU' to 'x64'

That solved the problem.

Daniel Bonetti
  • 2,306
  • 2
  • 24
  • 33
3

I had the same issue but my solution was to keep the Platform target as Any CPU and UNCHECK Prefer 32-bit checkbox. After I unchecked it I was able to open a connection with the provider.

Turn Prefer 32-bit off

WebDevKris
  • 93
  • 1
  • 1
  • 7
3

just check for which architecture you installed the driver

open Powershell both in 32 and 64 (seperate instance) and fire up:

# OLEDB-drivers
(New-Object System.Data.OleDb.OleDbEnumerator).GetElements() | select SOURCES_NAME, SOURCES_DESCRIPTION

# ODBC-drivers
Get-OdbcDriver | select Name,Platform
Bernhard
  • 2,541
  • 1
  • 26
  • 24
2

After spend hours to fix that; and for some who installed it uncorrectly, you need to uninstall current version and reinstall it again as Administratorenter image description here

Bashar Abu Shamaa
  • 1,998
  • 2
  • 21
  • 36
1

If you are getting this in a C# projet, check if you are running in 64-bit or 32-bit mode with the following code:

        if (IntPtr.Size == 4)
        {
            Console.WriteLine("This is 32-Bit!");
        }
        else if (IntPtr.Size == 8)
        {
            Console.WriteLine("This is 64 Bit!");
        }

If you find that you are running in 64-Bit mode, you may want to try switching to 32-Bit (or vice versa). You can follow this guide to force your application to run as 64 or 32 bit (X64 and X86 respectively). You have to make sure that Platform Target in your project properties is not set to Any CPU and that it is explicitley set.

enter image description here

Switching that option from Any CPU to X86 resolved my error and I was able to connect to the Oracle provider.

Hooplator15
  • 1,540
  • 7
  • 31
  • 58
1

My team would stumble upon this issue every now and then in random machines that we would try to install our platform in (we use oracle drivers 12c ver 12.2.0.4 but we came across this bug with other versions as well)

After quite a bit of experimentation we realized what was wrong:

Said machines would have apps that were using the machine-wide oracle drivers silently locking them and preventing the oracle driver-installer from working its magic when would attempt to upgrade/reinstall said oracle-drivers. The sneakiest "app" would be websites running in IIS and the like because these apps essentially auto-start on reboot. To counter this we do the following:

  1. Disable IIS from starting automagically on restart. Do the same for any other apps/services that auto-start themselves on reboot.
  2. Uninstall any previous Oracle driver and double-check that there are no traces left behind in registry or folders.
  3. Reboot the machine
  4. (Re)Install the Oracle drivers and re-enable IIS and other auto-start apps.
  5. Reboot the machine <- This is vital. Oracle's OLE DB drivers won't work unless you reboot the machine.

If this doesn't work then rinse repeat until the OLE DB drivers work. Hope this helps someone out there struggling to figure out what's going on.

XDS
  • 3,786
  • 2
  • 36
  • 56
1

Don't forget to run your cmd as Administrator or you will get the misleading error message :

The module "OraOLEDB12.dll" may not be compatible with the version of Windows that you are running. Check to see if module is compatible with x86 (32 bit) or x64 (64 bit) version of regsvr32.exe

Feuillebug
  • 41
  • 3
0

Building on Der Wolfs tip, I uninstalled the Oracle client and installed it again, right-clicking on the setup program, and running it as Administrator. It worked.

Nuno G
  • 2,035
  • 3
  • 14
  • 16
0

If you can't change compile use x64, try uninstall x64 version of odac and install 32bit version. Then, don't forget to add install directory like C:\oracle and also the child directory C:\oracle\bin to the PATH environment variable. This worked out for me in .net 4 application.

ARW
  • 11
  • 3