Thursday, 16 June 2016

Adding Net Service Names

This quick post intends to demonstrate the steps to configure a new Oracle Net Service Name. In this particular case, I will be using Oracle Network Configuration Assistant utility - netca. The configuration of Oracle Net Service Names can be performed done via Oracle Network Manager utility – netmgr and Oracle Enterprise Manager.

It is also possible, although not recommended, to configure Oracle Net Service Names by manually editing the configuration files like sqlnet.ora and tnsnames.ora.

clip_image0028_thumbHow to Get to It in the Documentation? – tnsnames.ora
Oracle Database Online Documentation 12c Release 1 (12.1) / Database Net Services Administrator’s Guide / Expand All / <CTRL + F> tnsnames.ora <ENTER> /  Configuring the tnsnames.ora File After Installation

Invoke netca from the Unix Shell as the osdba user, typically oracle.

$ netca

Then, select what type of configuration you want to perform. As you can see from below, netca can perform configurations other than managing Net Service Names.


Select what configuration action you want to perform


Next, type in the name of the database service you want to reach. Any Service including:

  • Non-CDB default Database Services
  • Non-CDB manually added Database Sevices via DBMS_SERVICE
  • Non-CDB manually added Database Services via srvctl
  • Default PDB services
  • Manually added PDB services via DBMS_SERVICE
  • The Service Name is not to be confused with the Oracle Net Service Name. The Service Name is the actual database service name you want to access via the Oracle Net Service Name you are creating. You can think of a Net Service Name as an alias for a connection description.


    The Protocol


    The Host and port for the Oracle Listener. In this case, it is a simple host name. When using RAC, the host name is likely to be the SCAN name.


    At this stage, you can perform a test if you want.


    Below, the Net Service Name is entered. This is the alias for the descriptor, not the Oracle Database Service Name.




    Once finished, you can, optionally, have a look at the tnsnames.ora file located under the $ORACLE_HOME/network/admin directory


    $ cd /u01/app/oracle/product/12.1.0/dbhome_1/network/admin
    [oracle@ocmdb12c admin]$ cat tnsnames.ora
    # tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora
    # Generated by Oracle configuration tools.

    NONCDB =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = = 1521))
        (CONNECT_DATA =
          (SERVICE_NAME =


    In this post, a new Net Service Name has been added. However, netca can be used to modify the entry we just added as well as perform other configuration actions.