Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

listener.ora and tnsnames.ora location in oracle 12c database

Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
  • User AvatarKiran Dalvi
  • 19 Jun, 2019
  • 0 Comments
  • 1 Min Read

listener.ora and tnsnames.ora location in oracle 12c database

In our previous blog We have seen about the error message related to the address of tnsnames.ora file.

In this blog we will see the location of listener.ora and tnsnames.ora file . listener.ora is the database server level file and tnsnames.ora is the client side file.

oracle listener service should be up and running to get the new connection to oracle database.

In this blog, I will show you how to check the location of listener.ora and tnsnames.ora file in database server.

if your listener is up and running then you can get the both file path from there.

  • Check the listener status.

[oracle@oracle ~]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 19-JUN-2019 10:17:56
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 – Production
Start Date 19-JUN-2019 10:00:30
Uptime 0 days 0 hr. 17 min. 28 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /data/oracle/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora
Listener Log File /data/oracle/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle.oracle.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary…
Service “cdb1” has 1 instance(s).
Instance “cdb1”, status READY, has 1 handler(s) for this service…
The command completed successfully

if you observe the above listener status , there you will find the location of listener.ora file and in the same location you can see the tnsnames.ora file.

I have listed down the files available in that location.

[oracle@oracle ~]$ ls -lrt /data/oracle/app/oracle/product/12.1.0.2/db_1/network/admin/
total 40
-rw-r–r– 1 oracle oinstall 373 Oct 31 2013 shrept.lst
drwxr-xr-x 2 oracle oinstall 4096 Jun 2 11:38 samples
-rw-r–r– 1 oracle oinstall 201 Jun 2 17:33 sqlnet.ora
-rw-r–r– 1 oracle oinstall 343 Jun 2 17:33 listener.ora
-rw-r—– 1 oracle oinstall 511 Jun 5 10:13 tnsnames.ora

  • 2. Generic path for listener.ora and tnsnames.ora file

Both the files located under below path
$ORACLE_HOME/network/admin

if you want to know about the listener.ora and tnsnames.ora file then you can read from oracle official site.