Oracle Net Configuration Assistant

Oracle Net Configuration Assistant with Examples

In this article, I am going to discuss Oracle Net Configuration Assistant with Examples. Please read our previous article where we discussed Static Listener in Oracle with Examples. Until now we have learned how to configure listeners manually by making changes in the listener.ora and tnsnames.ora files. We already have discussed that there are two types of service registrations.

Listener Service Registrations in Oracle:

The Listener service registrations are of two types

Dynamic Registration:

In order to configure dynamic registrations, we have to configure as below

  • Listener.ora
  • Tnsnames.ora
  • Local_listener parameter
Static Registration:

In static registration, we configure listener.ora by adding SID_LIST. Apart from these two, we have other methods

  • Oracle Net Manager(netmgr)
  • Oracle Net Configuration Assistant(netca)
  • Listener Control Utility
  • Enterprise Manager Cloud Control (Database in the cloud)
  • Database Configuration Assistant (allows you to create a listener while creating a CDB)

So, we have two main tools. Oracle Net Manager and Oracle Net Configuration Assistant. Oracle Net Manager will help us to control the listener. Oracle recommends we use this Oracle Net Configuration Assistant. Let us go ahead and open the listener.ora file.

Listener Service Registrations in Oracle

We can see there are many listeners created. We have created these listeners manually. We have listener_PDB as the static listener and LISTENER_19c as the dynamic listener and the actual default listener. In order to configure a listener using Oracle Net Configuration Assistant. We have to follow the below steps.

Add Listener in Oracle:

Step1: Open netca

Open a terminal and enter the command netca. This is the command for opening Oracle Net Configuration Assistant.

Add Listener in Oracle

From the output, we can see there is a popup for Oracle Net Configuration Assistant. Let us explore netca. When we enter the command netca, Oracle will create backup files in the admin folder for the listener.ora and tnsnames.ora.

Add Listener in Oracle

Step 2: Listener Configuration.

When we start netca we will have many options like Listener Configuration, and Naming Method configuration which configures sqlnet.ora file, Local Net Service Name Configuration which is used to configure tnsnames.ora, Directory Usage Configuration. We will choose Listener Configuration where will configure the listener.ora file and add a new listener.

Listener Configuration

Select Listener Configuration and click Next.

Step 3: Add Listener

Here we are adding a new listener so, we have selected Add option. If we want to delete a listener then we can select the delete option. Select Add option and click Next.

Add Listener

Step 4: Listener Name

Here we have to enter the listener name that we are going to create. Make sure not to use the listener that is already present in the listener.ora file. Click Next.

Listener Name

Step 5: Protocol Selection.

We will have three options here TCPS, IPC, and TCP protocol. We have to select TCP protocol as it is the default protocol. Click Next.

Protocol Selection

Step 6: Port Number Selection

Here we will get an option to use the default port number or select any other port number. We will be using another port and let’s enter the new port number. We are selecting to use another port number option and entered 1530 as the port number.

Port Number Selection

If you click Next It asks for do you want to add another listener. If you click Yes then the process starts from the beginning and you will be able to create another listener. We are clicking No, so we will move to the next step.

Port Number Selection

Step 7: Start Listener.

You will get an option to start the listener we have configured. Select the listener that we have created and click Next. You can see in the background the listener is started.

Start Listener

Step 8: Finish Configuration

You will see a popup showing the listener configuration completed. Click Next and Click Finish.

Finish Configuration

Let’s go ahead and open the listener.ora to check whether the listener is created or not.

Finish Configuration

From the output, we can see the listener_test is created and the port number is 1530. The netca will make life easier while configuring listeners.

Remove a Listener in Oracle:

Step 1: Let us go ahead and learn how to remove a listener using netca.

Use the command netca again.

Remove a Listener in Oracle

Select Listener Configuration and click Next

Step 2: Delete Configuration

Select Delete Configuration as we have to delete the listener and click Next.

Delete Configuration

Step 3: Listener Selection and Deletion.

Select a listener that we want to delete. We are selecting LISTENER_TEST.

Listener Selection and Deletion

Click Next. It will show a popup as below.

Listener Selection and Deletion

Netca is asking for confirmation that the listener is running, netca will stop the listener and then delete the listener. Click Yes.

Listener Selection and Deletion

The listener Successfully deleted. Click Next and finish. Let’s go ahead and check the listener.ora file if the LISTENER_TEST exists or not.

Listener Selection and Deletion

We can see the listener LISTENER_TEST is not present in the listener.ora file.

Tnsnames Entry in Oracle:

We will try to create tnsnames entry to the tnsnames entry. Let’s assume we have a pluggable database called TEST_DB. The service name would be TEST_DB.com. Let’s go ahead and create a tns entry for this TEST_DB.

Step 1: Local Net Service Name Configuration

Open netca and select the Local Net Service Name Configuration and click Next.

Local Net Service Name Configuration

Step 2: Add tnsentry

As we are creating a new entry in tnsnames.ora we are selecting add and clicking Next.

Add tnsentry

Step 3: Service Name

Suppose there is a pluggable database named TEST_DB then the service name would be TEST_DB.com. So, we are entering TEST_DB.com and click Next.

Service Name

Step 4: Protocol Selection.

We are selecting TCP protocol as it is the default protocol that we are using. Click Next.

Protocol Selection

Step 5: Hostname and Port number

In this step, we have to enter the hostname and port number. Our hostname is oracletest.com, so we are entering oracletest.com and the port number that we are using is the default port number. Click Next.

Hostname and Port number

Step 6: Test Connection.

In this step, netca asks us to check the connection of the database with the new tnsentry. We are not going to perform a test because there is no database named TEST_DB on our server.

Oracle Net Configuration Assistant with Examples

Click Next

Step 7: Net service name

Here we have to enter the entry name into the tnsnames.ora file. This entry is used by the client to connect to the database. We are giving TEST_DB.

Oracle Net Configuration Assistant with Examples

Click Next and netca asks us to create another tnsentry. Click No.

Oracle Net Configuration Assistant with Examples

Click Next and the tnsentry process is finished.

Oracle Net Configuration Assistant with Examples

So, the tnsentry process is completed. Let’s go ahead and open the tnsnames.ora file and check if the entry is created or not.

Oracle Net Configuration Assistant with Examples

We can see the TEST_DB entry is present. The hostname is oracletest.com and the port number is 1521. The service name is TEST_DB.com

If we need to connect to TEST_DB we have to create a new database named TEST_DB. So, we have learned how to create a new entry to listener.ora and the tnsnames.ora using netca.

In the next article, I am going to discuss Oracle Net Manager with Examples. Here, in this article, I try to explain Oracle Net Configuration Assistant with Examples and I hope you enjoy this Oracle Net Configuration Assistant with Examples article.

Leave a Reply

Your email address will not be published. Required fields are marked *