Friday, October 19, 2012

Oracle tnsnames.ora : Net Service Name vs. Instance Service Name

In order to distinguish net_service_name to instance_service name in the tnsnames.ora file, I have colored them blue and red as show in the example below

net_service_name =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = host_name)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = instance_service_name)
)
)

 instance_service_name: 

An Oracle database is represented to clients as a service, i.e. the database performs work on behalf of clients. A database can have one or more services associated with it.

The service name is specified by either through the parameter SERVICE_NAMES or with the package DBMS_SERVICE


SQL> show parameter service_name

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------
service_names                        string       instance_service_name


tnsping net_service_name :

when we use the tnsping command to check the connectivity, it goes to check Net service names.

lsnrctl services:

whereas the list of services returned by the command lsnrctl services contains  instance_service_name


In Oracle10g, above information can also be returned as below.

SQL> select network_name from dba_services;

Why NETWORK_NAME? These are the instance service names registered with an Oracle Net listener (parameters LOCAL_LISTENER and REMOTE_LISTENER)


Connect command:


Connect strings, such as user/password@net_service_name, contain Net service names.

for further information, follow the below mentioned link
http://docs.oracle.com/cd/B19306_01/network.102/b14212/gettingstart.htm



No comments:

Post a Comment