Friday, September 19, 2008

TNS Error ORA 12154

There are many ways that this error could occur, I would like to get into few of them to the best of my knowledge and how this ORA-12154: TNS can be resolved.

I was worried many times while I was trying to connect to a oracle data base server with this error.

For the first time when you install oracle10g client software select Administrator, so that you can configure your local machine to a remote data base server through configuration management tool provided iff you install administrator.

Once you have configured to a data base, you can find it in a text file (tnsnames.ora) located at oracle installation path sub directory network\admin.

Ex :-
(ADDRESS = (PROTOCOL = TCP)(HOST = dbdev)(PORT = 1521))
(SID = dpg)

DPG Database service name you configure
dbdevOracle data base server name
SIDData base name on server

Once it is configured, you can connect to this data base with any user name created to this data base. Funny thing is, I still observed TNS Error while doing all the above steps. I created a new application (.NET) and used oracleclient.dll to connect to this configured data base.Shocking is I am able to connect to this configured data base from other application but not with this new application. I believe this step surely avoids the error you get. Observe the path where application is, if there is any folder that contains ‘(‘or ‘)’ in folder name or path with ‘(‘or ‘)’ in it then definitely you will get this TNS error even if you are configured. The new application which is throwing TNS Error is because I saved this application in path having ‘)’ and ‘(‘. Hope this helps you :).

No comments:

Post a Comment