Installing Oracle – the host is localhost!

Yesterday, I started installing Oracle. I decided to download the newest version: version 11g R. I used windows xp as a platform with DHCP switched off. It really looked simple: the screens look simple and the questions asked were straight forward. I let it go for about 2 hours and after this time I returned to the machine and I looked if everything was successfull. It certainly was: an encooraging “successfull” looked at me.
I checked the installation by a command “tnsping”. This command was issued at the same machine where Oracle was installed.
I then issued the command “sqlplus uid/psw” that also gave access to the Oracle database.
Finally, I installed TOAD on the same machine as Oracle installed and also TOAD gave access to the database.
Much to my surprise, I could not get access from another machine as the machine on which I had installed Oracle. I got an error saying “TNS-12541: TNS: geen listener”. I really did not understand as to why this happened. If you google this error, you get ideas on network problems, but this was not the case. I checked every possible typo but this did not happen either.
The clue as to why the error happened came as I compared the outcomes form the tnsping command. From the server, it looked like:

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))
OK (20 msec)

look at the host! It reads localhost where I expected to see the serveraddress.

The outcome from the remote computer was:

Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.9)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = ORCL)))
TNS-12541: TNS: geen listener

the host is 192.168.1.9 which in itsself is ok.

Apparently the listener on the server listens to the localhost whereas it had to listen to the server address 192.168.1.9.

The solution was twofold.
First I changed the hosts file on the server in \windows\system32\drivers\etc. I commented out the localhost and I introduced the serveraddress.
Secondly, I changed the tnsnames.ora, listener.ora that can be found in \network\Administrator on the server. Every “localhost” reference was replaced by the serveraddress 192.168.1.9.

This seemed to help: the listener started to listen to the network address and it was possible to access the database from outside.

Oops – took a few hours but Oracle was up and running.

Door tom