When connecting to an Oracle database, typically your database server will have tnsnames.ora
, which is a configuration file that informs the server about NET_SERVICE_NAMES
which are valid database connections. By default, this file is located at ORACLE_HOME/network/admin
.
For example, a NET_SERVICE_NAME
descriptor in tnsnames.ora
may be formatted like this:
myDatabaseNetService =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = tcp)(HOST = localhost)(PORT = 1521)(QUEUESIZE = 100))
(CONNECT_DATA =
(SERVICE_NAME = bookstore.company.com)
)
)
This would define a NET_SERVICE_NAME
using the SERVICE_NAME
we discussed earlier (bookstore.company.com
) and connecting to localhost
through port 1521
.