When trying to connect to Oracle, you get this error:
ORA-12154: TNS:could not resolve service name
This error indicates that the service (or TNS alias) specified when trying to connect does not exist. ‘TNS aliases’ or ‘service names’ are defined locally to each workstation. Thus different workstations could have a completely different alias to refer to the same database.
Check which aliases are defined on the workstation, and either use one that is defined or add an appropriate one.
The following methods can be used to view the TNS names:
Look in the file ‘Oracle\Ora81\Network\Admin\Tnsnames.ora’. In this file each defined name will normally have ‘.world’ appended to it.
Try specifying the full service name, i.e. as it appears in the tnsnames file.
If a connection alias is not being explicitly provided then try to identify what alias Oracle thinks you are using. This will typically be contained in the ‘sqlnet.log’ file that the Oracle client will produce. Possible places where Oracle could be getting this (default) alias from:
The environment variable ‘LOCAL’.
http://forums.oracle.com/forums/thread.jsp?forum=61&thread=267600&message=808024
http://forums.oracle.com/forums/thread.jsp?forum=57&thread=297696&message=&tstart=0&trange=15937179
http://www.cryer.co.uk/brian/oracle/ORA12154.htm
http://www.experts-exchange.com/Databases/Oracle/Q_20902239.html
http://www.dbforums.com/archive/index.php/t-1012623.html
Part VII: Troubleshooting Applications
Application Runs But No Data is Displayed