Ошибка ora 12557

I am trying to develop a C# Windows Forms Application targeting the .net 4 framework. The program will execute a stored procedure against an Oracle Database and I get the following error when I try to open the connection to the database.

ORA-12557 TNS:protocol adapter not loadable

I am developing this in Visual Studio 2012 and have managed to make the Server Explorer connect to the database successfully, however I keep getting this error through my application.

I have two Oracle 11g clients on my machine. One is 32bit and the other is 64bit. I do need both for different applications so it is not possible to remove one. I have also tried changing the order of the Oracle home directories in the PATH variable. Currently I have the 64bit one first which is the one I would like to connect with.

I am connecting my application to the Database using ODP.NET and have referenced the dll from the 64bit application.

As far as I can tell I have done what has been suggested and have not managed to get it working. If anyone could help it would be appreciated.

Error
ORA-12557 TNS:protocol adapter not loadable

Solution
For solving the error you have to check the following points:

  1. Check ORACLE_HOME Environment Variable.
    Main cause of this error is set the oracle home of different version and we are using different version for TNSPING or SQLPLUS command. We have oracle database and client binaries at same machine and set the environment variable ORACLE_HOME with database binaries and execute command TNSPING or SQLPLUS from Client binaries which will cause error.

To fixed this problem:
On Windows, remove the entry of ORACLE_HOME from environment variable.

1. Right-click on 'My Computer' and choose 'Properties'
2. Click "Advanced System Settings"
3. Click "Environment Variables"
4. Inside the "System Variables" section, look for an entry for 'ORACLE_HOME'
5. Delete this entry

On Linux, remove entry of ORACLE_HOME from user profile.

Second alternative is set the ORACLE_HOME manually:

-- In Windows
SET ORACLE_HOME=D:oracleproduct11.2.0db_1
--In Linux
EXPORT ORACLE_HOME=/u01/app/dbhome_1
  1. Issue may be you are using 32 bit application with 64 bit database.
1. You need to install 32-bit Oracle Client on machine and use 32-bit client string for making connection.
2. Set ORACLE_HOME to the Oracle 32-bit client location and add the same to the PATH environment variable in first position.

3. Check the PATH Environment variable.

On installation of Oracle software or client, software automatically update the PATH environment variable. Window will use Oracle software which will point first in PATH Variable.
So, We need to update the PATH variable if we are facing issue in connectivity by removing first one or change the position to first one of Oracle binary location.

-- Check PATH variable in Windows
ECHO %PATH%
-- Check PATH variable in Linux/Unix
echo $PATH

--Example: Change the position of PATH 
Tried to TEST the connectivity by move the PATH of Oracle software to First position. By default first position PATH is used by application.

ECHO %PATH%
D:oracleproduct11.2.0db_1bin;D:oracleproduct11.2.0client_1bin;
--Change client path at first position
D:oracleproduct11.2.0client_1bin;D:oracleproduct11.2.0db_1bin;

Verify the Oracle is 32-bit or 64-bit.
It will give you the result in first line it is 64 bit or 32 bit.

tnsping service_name

--Example
C:Usersoracle>tnsping
TNS Ping Utility for 64-bit Windows: Version 11.2.0.2.0 - Production on 22-FEB-2019 14:56:19
Copyright (c) 1997, 2014, Oracle. All rights reserved.

  • Remove From My Forums
  • Вопрос

  • Hi,
       I using SSRS web interface to create a data source and trying to connect to one of our databases on Linux boxes.

    SSRS is installed on a windows box and oracle client 11g is insatalled as well.

    When I try to tnsping or sqlplus to I can connect without issue. But when I am creating a data source via the web interface I get this error:

    ORA-12557: TNS:protocol adapter not loadable

    any idea why this behavior?

    Thanks

    Nirmal

Ответы

  • Doesn’t matter — those will both use whatever client you happen to have installed.  ie — if you loaded the 32 bit client then all of the tools use the 32 bit drivers, if you loaded the 64 bit client they use the 64 bit drivers.

    Which client(s) do you have installed on the box?


    Chuck

    • Изменено

      4 апреля 2012 г. 13:55

    • Помечено в качестве ответа
      NirmalSArri
      4 апреля 2012 г. 15:11

Операционная система: windows 7
Версия базы данных: 11.2.0.1
Описание проблемы:
Вы можете войти в систему напрямую через sqlplus sys/[email protected]: 1521 / ysxt как sysdba, но вы не можете войти через sqlplus sys / oracle @ YSXT как sysdba, и сообщить ORA-12557: TNS: адаптер протокола не загружается. Проверьте переменные среды TNS_ADMIN и ORACLE_HOME, и все в порядке.

Наконец, проверьте переменную среды PATH и обнаружите, что каталоги клиента и сервера добавлены к пути, удалите конфигурацию клиента. следующим образом:

решить:
Поместите в PATH
F:appAdministratorproduct11.2.0client_1bin;F:appAdministratorproduct11.2.0dbhome_1bin;
Чтобы
F:appAdministratorproduct11.2.0dbhome_1bin;

Skip to content

При сборе информации RDA не может соединиться с БД с ошибкой ORA-12557 TNS protocol adapter not loadable.

Оказалось что на 64-битном сервере установлен также 32-битный клиент и в переменной PATH путь до клиенты был первым.

Решение: В текущей сессии жестко задать переменную PATH (если поменять в свойствах системы – это окажет влияние на все остальные программы и что-то может перестать работать). При задании пути оставить только самое необходимое.

C:rda>path=C:oracleproduct10.2.0db_1bin;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:oracleproduct10.2.0db_1perl5.8.3binMSWin32-x64-multi-thread

Technorati Теги: rda,ORA-12557,TNS,protocol,adapter,loadable

Понравилась статья? Поделить с друзьями:
  • Ошибка ora 01036
  • Ошибка ora 01013
  • Ошибка ora 01002
  • Ошибка ora 00980
  • Ошибка ora 00979