ORA-12557 TNS:protocol adapter not loadable

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:\oracle\product\11.2.0\db_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:\oracle\product\11.2.0\db_1\bin;D:\oracle\product\11.2.0\client_1\bin;
--Change client path at first position
D:\oracle\product\11.2.0\client_1\bin;D:\oracle\product\11.2.0\db_1\bin;

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:\Users\oracle>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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.