DNS alias creation for oracle Database connectivity

DNS alias creation for oracle Database connectivity.

In this Article we will see what is the DNA alias and why we need to create and who creates it .

After creating the New Database , tnsnames.ora entry will be shared to application teams.

New DB connection details will be updated at many places  as given below.

  1. In the application , these connection details will be referred while creating Data Source and
  2.  if there are many clients those many times Data Source will be created .
  3. And need to update new tnsnames.ora entry  in the Database clients such as SQL Developer or Toad.

Sample tnsnames.ora entry is as follows.

ORCL21C =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.145.45.65)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl21c)
)
)

Assume that after few months/sometime  below changes required in the environment,

  1. Change in the IP address of the database server  or Server Decommission except DB.
  2. DB migration from one server to other server.

then

  • Application team needs to change new  connectivity details all the Data Sources and clients (SQL Developer/Toad etc.)
  •  And DBA team also need to change these connectivity details  in their scripts that are used to get the reports such as alerts /connectivity , capacity reports, billing reports.

Instead of the process given above  , if we create DNS alias ,even if there is any change in the IP address, no need to change the tnsnames.ora or connect strings / URLs from application side. There will be only one change in the DNS. Only change is required in n/w side.

So , In the initial setup only if we create DNS alias there are no changes at multiple locations and no down time  required from the application point of view.

How to create  DNS alias?

DNS alias is created/Modify by N/W team. For that task  DBA needs to send below details.

To create DNS alias

 

Name of the server: orlx01.ajara.tech

IP address:10.145.45.65

New Host A-Record: prod-ORCL21C.ajara.tech

Sample tnsnames.ora with DNS alias.

 

ORCL21C =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = prod-ORCL21C.ajara.tech)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl21c)
)
)

Note: See the difference in HOST value in tnsnames before and after DNS alias creation.

To Modify DNS alias

As discussed above , after few months/years /sometime ,assume IP address of the DB server has been changed due to some reasons discussed earlier,for ex: from 10.145.45.65  to  10.145.45.95  .then below details should be send to n/w team to modify DNS. No  changes required in application or DBA side.

 

Host A-Record:prod-ORCL21C.ajara.tech

Old IP address: 10.145.45.65 

New IP address: 10.145.45.95 

Conclusion

This process should be followed in Dev,Test, QA  and prod environments  and can be followed in other DB technologies like SQL Server, UDB  and wherever connectivity needs to be established for that matter.

See also: