1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Cannot load OCI DLL

Discussion in 'Other Development Tools' started by mdsmit, Oct 6, 2010.

  1. mdsmit

    mdsmit Active Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    55
    I am setting up tools on a new Windows 7 PC that my company issued me and have everything working except TOAD.

    I installed oracle 10.2.0.3 on my PC and setup my ORACLE_HOME and TNS_ADMIN environment variables. I also set up by TNS file and host file. Afterwards I installed TOAD 10.1.1.8 as well as SQL Developer.

    I am able to connect to any database setup in my TNS file through SQL plus as well as through SQL Developer. But when I open TOAD, my oracle instalation is not appearing in the "Connect Using:" box when I try to make a connection. The only thing that appears there is an old installion of oracle 8 that was partially copied over when the tech staff copied files from my old PC to my new one. That installition is invalid and doesn't work.

    I looked through the TOAD user guide, and it has the following information about how it finds clients:

    How Toad Finds the Oracle Client DLL
    1. Toad first looks in the Toad command line for OCIDLL.
    2. If this is not found, Toad looks for the path for the Oracle home as follows:
    3. If the command line argument "ORACLEHOME" was passed in, then Toad will use
    that home.
    4. If there is no Toad home defined then Toad will display the home that is set as the
    default home using Oracle’s Home Selector application as the default in the dropdown.
    Toad will use the home that is active in the dropdown.
    5. To populate the dropdown, Toad searches the registry as follows:
    First, Toad reads the list of Oracle home names from the keys under HKEY_
    LOCAL_MACHINE\SOFTWARE\ORACLE\ALL_HOMES
    If no Oracle homes are found there, then the Oracle home is set to HKEY_
    LOCAL_MACHINE\SOFTWARE\ORACLE
    Otherwise, Toad finds the ORACLE_HOME value for each Oracle home, if it
    exists. Then Toad checks the system environment variable called PATH to see
    whether it contains the "bin" folder under ORACLE_HOME. Toad selects the
    Oracle home whose path appears first in PATH.
    If Toad still hasn't found an Oracle home, it uses HKEY_LOCAL_
    MACHINE\SOFTWARE\ORACLE.
    6. Toad looks for the client DLL in the "Bin" folder under the path found for the
    Oracle home
    If that fails, Toad looks for the ORACLE_HOME key under HKEY_LOCAL_
    MACHINE\ORACLE\SOFTWARE, and look for the client dll in the "Bin" folder
    under that.
    If that also fails, Toad looks for the client dll in every \bin directory in PATH.

    I checked my registry, and my oracle installion does appear in a 10g folder within HKEY_
    LOCAL_MACHINE\SOFTWARE\ORACLE.

    What else can I do to try and get TOAD to find my 10g oracle installion?

    Thanks for any help you can give.
     
  2. mdsmit

    mdsmit Active Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    55
    Re: Oracle Instalation Not Appearing in Connect Using Dropdown in TOAD

    I was able to partially solve the problem by finding where TOAD was getting that path. I set the correct path, but now it gives the error:

    "Cannot load OCI DLL: C:\oracle\product\10.2.0\client_2\BIN\oci.dll"

    Even though oci.dll is in that directory. Any ideas as to why it can't load it?
     
  3. Sadik

    Sadik Community Moderator Forum Guru

    Messages:
    1,906
    Likes Received:
    252
    Trophy Points:
    1,455
    Re: Oracle Instalation Not Appearing in Connect Using Dropdown in TOAD

    Ok, which version of Toad are you using?
     
  4. Sadik

    Sadik Community Moderator Forum Guru

    Messages:
    1,906
    Likes Received:
    252
    Trophy Points:
    1,455
    Re: Oracle Instalation Not Appearing in Connect Using Dropdown in TOAD

    Oh ok it's 10+. What are the currently values "paths" of the PATH environment variable ?
     
  5. mdsmit

    mdsmit Active Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    55
    I was able to find out the reason why it couldn't load the OCI DLL. Apparently no matter what version of TOAD you have, it is incompatible with 64 bit installations of oracle.

    TOAD looks for oracle installations under HKEY_LOCAL_MACHINE/SOFTWARE/WOW6432NODE/ORACLE which is where because that is where 32 bit installations are registered. I had put the path of my 64 bit oracle installation there, but it still doesn't work because TOAD requires a 32 bit installation.

    So, I installed a 32 bit version of Oracle, which TOAD was able to find, only to receive a similar error:

    "Can't initialize OCI. Error -1"

    I was instructed by my tech team at my project to add the following line to my sqlnet.ora file to solve that error, but it didn't:

    NAMES.DIRECTORY_PATH= (TNSNAMES)

    What DID, get rid of that error was when I ran TOAD as administrator on my PC. But now it gives a TNS error for any DB i try to connect to:

    "ORA-12154: TNS:could not resolve the connect identifier specified" and then the DB i was using

    However, I am able to connect to these databases with sql plus and sql developer without any issue. And yes, i have my TNS file in my network/admin directory for my new 32 bit installation as well as my 64 bit installation. And when I look at the TNSNames Editor in TOAD it has loaded everything from my TNS file.

    Why can it not resolve the database when it has properly loaded it and I can connect with every other tool?
     
  6. Sadik

    Sadik Community Moderator Forum Guru

    Messages:
    1,906
    Likes Received:
    252
    Trophy Points:
    1,455
    Well it simply means that Toad is unable to find the correct Oracle home through the path variable. That is why i asked you to check the values of PATH environment variables in the first place.
     
  7. mdsmit

    mdsmit Active Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    55
    Path is set to:

    "C:\oracle\product\10.2.0\client_3\bin;C:\oracle\product\10.2.0\client_2\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin"

    The string "C:\oracle\product\10.2.0\client_3\bin" is the bin directory for my 32 bit installation.

    The string "C:\oracle\product\10.2.0\client_2\bin" is the bin directory for my 64 bit installation.
     
  8. mdsmit

    mdsmit Active Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    55