your post is a little bit confusing me.
A listener.ora is located on the database server. The tnsnames.ora is a part of the client machine (and also the database server).
If you are configure a tnsnames.ora your should use service_name or sid not both. In case of RAC you use SERVICE_NAME and maybe INSTANCE_NAME.
Also you should use the service_name which is configure on the listener, so your next step should be a lsnrctl status on the database machine to get the correct service_name and use them in your tnsnames.ora
I think you mix up some things:
- You do not need to install Instant Client to connect to a server on the same machine.
- listener.ora belongs to the server, while tnsnames.ora belongs to the client.
- You do not connect to 'localhost', but to a database.
- "tnsping" has nothing to do with "ping".
I assume that you have no sqlnet.ora file.
So, what I would do:
- Remove Instant Client from the machine.
- Put both listener.ora and tnsnames.ora in $ORACLE_HOME/network/admin.
- Undefine the environment variable TNS_ADMIN.
- Try to connect with sqlplus -L user/password@mydb
If that fails, solve that problem first.
- Fix your odbc.ini file.
"ServerName" should by "MYDB", and I don't know what "Database" is. There may by other problems.
How did you come up with this file?