I have been playing with Vagrant, Puppet and Virtualbox lately. One simple issue took a lot of my time so thought of sharing with you all.
Details of my setup.
- My primary OS was Windows 7 (system on which I have installed virtual box) and there was one VM running under guest OS Oracle Liunux 6.7.
- After installing XE database, I could not connect to Database which was running under VM.
- From Networking point of view, for Guest OS I had two adapters.
1. Adapter 1 NAT
2. Adapter 2 which is host-only.
- DB and listener both were up and running.
- Telnet to 1521 port was not working. Ping to Guest VM and Telnet to 22 was working fine.
- Disabled Firewall too. It did not resolve the issue.
From host OS, when I tried to connect to guest DB i got below error :-
Could not open connection to the host, on port 1521: Connect failed
Finally, I located the issue with my listener.ora. The hostname value was not updated properly. The content of the file was like this before change.
# listener.ora Network Configuration File:
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
(PROGRAM = extproc)
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
DEFAULT_SERVICE_LISTENER = (XE)
After I updated value of Host=identity.oraworld.com and restarted database and listener, it resolved the issue.
Hope it helps 🙂