A guide to configuring your Windows `hosts` file to connect to Oracle Apps R12.
Before you can connect to an Oracle database using a hostname (like `ebs.example.com`) in your `tnsnames.ora` file, your computer needs to know which IP address that hostname points to. The Windows `hosts` file is a simple text file that acts as a local DNS resolver, allowing you to manually map IP addresses to hostnames. This guide shows you how to edit it.
Click on the Start menu, search for 'Notepad', right-click on it, and select 'Run as administrator'. This is crucial because the hosts file is a protected system file.
In Notepad, go to File > Open. Navigate to the directory C:\Windows\System32\drivers\etc. You may need to change the file type from 'Text Documents (*.txt)' to 'All Files' to see the 'hosts' file. Select it and click Open.
Go to the end of the file and add a new line for your Oracle server. The format is IP Address, followed by a space or tab, and then the hostname. For example: 192.168.1.5 ebs.example.com
After adding the entry, go to File > Save to save your changes. You can now use the hostname 'ebs.example.com' in your tnsnames.ora file or other connection tools, and your computer will know it points to 192.168.1.5.
The `hosts` file only handles the IP to hostname mapping. The port and SID will be used in your `tnsnames.ora` configuration.