TNSPING OK but sqlplus gives ORA-12154?

Sqlplus will give this error if you have an at-sign (@) in your password, which you do. Sqlplus thinks you are inputting the connection string as a parameter. Change your password (you can do this with SQL Developer).

Moral: Don't use at-signs in Oracle passwords.


Create an environment variable TNS_ADMIN that points to the directory where your tnsnames.ora file resides. Then try to connect with sqlplus.

If that works, then my guess is you maybe installed the Oracle client software too, and when you run sqlplus, it looks for the tnsnames.ora file in your client home.

-- Instructions for Adding the Environment variable TNS_ADMIN in windows
1. Go to control panel / system
2. select Advanced system settings
3. Select "Advanced" tab, and the environment variable button is at the bottom.
4. create new variable TNS_ADMIN and give the path where the .ora files are stored. e.g. C:\app\oracle\product\11.2.0\client_1\network\admin