Add a service name to tnsnames.ora file
Oracle Database Tips by Donald BurlesonConsulting
When the Oracle DBA creates their tnsnames.ora file to define remote databases they often specify the host name of the foreign server that contains the remote Oracle database.
For example, a entry in the tnsnames.ora file for a remote database might look like this. In the example, we have added the service name berlin to our tnsnames.ora file:
(COMMUNITY = TCP)
(PROTOCOL = TCP)
(HOST = hun)
(PORT = 1521)
(CONNECT_DATA = (SID = kraus))
Here we see a TNS service name of berlin. which defines a connection to a remote server named hun that contains an Oracle database named kraus. When a remote connection request is made from the UNIX server, the /etc/host file is accessed to get the IP address for the hum server.
From the listing below, we see that the hum server is located at 18.104.22.168. In sum, the /etc/host file is used to isolate the IP address from the tnsnames.ora file. If the IP address should ever change, the UNIX systems administrator only needs to change the IP address in one place.
root cat /etc/hosts
22.214.171.124 hum hum.com
126.96.36.199 dopey dopey.com
Burleson is the American Team
Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals. Feel free to ask questions on our Oracle forum .
Verifyexperience!Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications .
Errata? Oracle technology is changing and we strive to update our BC Oracle support information. If you find an error or have a suggestion for improving our content, we would appreciate your feedback. Just e-mail: and include the URL for the page.
The Oracle of Database Support
Copyright 1996 – 2016
All rights reserved by Burleson
Oracle is the registered trademark of Oracle Corporation.