Trying to connect to Oracle on Windows server

Hi,

I am a newbie to Linux and still trying to learn. Here is my situation.

I have a windows server where I installed Oracle DB. On the same Windows server, I have a VM running linux. I can ping Windows server IP successfully from linux.

I installed sqlplus on linux and trying to access the oracle db tables on windows server. I am able to invoke sqlplus in linux but failing to connect to Oracle with an error message of target host doesnt exist. I configured all variables such as PATH, LD_LIBRARY_PATH correctly.

Please tell me where I am going wrong.

Thanks

Can you post the exact command line you're using?

I am invoking sqlplus by just typing sqlplus on the command line. Then it is asking for username and password which I am entering in and ending up with an error Target host doesn't exist. I see that I have to set environment variable called ORACLE_HOME to the directory where oracle was installed. This is exactly what my question was.

How do I set a environment variable in linux that points to a windows server directory assuming that windows and linux are in the same network?

No, there's quite a bit more to it. ORACLE_HOME points to the location where the software was installed, either for the server or the client. It never points to any directory on the machine the database instance is running on.

Instead you'll have to set up /etc/tnsnames.ora to point to the listener of the instance.

Okay.

Will you be able to help me in setting Oracle_home to the location where the oracle software was installed.

As I said earlier, Oracle is running on a windows server and linux on a vm.

As long as tnsnames and listener goes, here is what exactly I did. I went through the configuration directions from Oracle website and downloaded Oracle instant client basic, sqlplus package & odbc package for linux x86-64. Afterwards, I unzipped all the contents to one single directory called instantclient_11_2 and copied this directory to linux followed by setting environment variables PATH & LD_LIBRARY_PATH. Then, I copied tnsnames.ora file from network folder in windows and placed in linux instantclient_11_2 folder.

This is all what I did.

Please suggest where the things are going wrong.