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
  • ANKUSH THAVALI
  • 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.