Search This Blog

Friday, December 28, 2012

Simple setup of TNS

Simple setup of TNS

You have multiple oracle home installed in your pc! One from Oracle Client that you installed, one from Oracle Express edition database and one from oracle workflow that you installed few months back. Now you are not sure which TNSNAMES.ora is being used or should be used. The situation sounds pretty similar... isn't it? Lets try this and get rid of the dilemma!

TNS Entry:
DEV = (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dev.domain.ee)(PORT=1567)))(CONNECT_DATA=(SID=sdev1)(server=dedicated)))

I prefer to use oracle home from Oracle Client. In my case this is
C:\OraHome_1

So I have added the above TNS entry in tnsnames.ora file
C:\OraHome_1\network\ADMIN\TNSNAMES.ORA
Now let's cehck the existing status of my connectivity by executing tnsping:



It failed with error. If we notice carefully, it seems its not using the correct oracle_home. So let's set ORACLE_HOME and TNS_ADMIN and try tnsping again



Mutch better, because it found the tns entry this time. But it couldnt find the listener. In my case, the database is in a remote machine and my client machine IP was not allowed by the remote server firewall. I got this opended by firewall admins and tried nslookup again. Heres how it looks like now..



Hope it helps! 

No comments:

Post a Comment