Tag Archives: lsnrctl

Configure listener and tnsnames files (Oracle Network Configuration)

listener.ora:

The “listerner.ora” file contains server side network configuration parameters. It can be found in the “$ORACLE_HOME/network/admin” directory on the server.

Make sure hostname, oracle_home location, port number and db names are pointed correct in below example:

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = <<SERVER NAME/IP>>)(PORT = 1521))
)
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME= /u01/oracle/product/12c)
(SID_NAME = ORCL)
)
)

Listener Operations:

lsnrctl status –> To know the status
lsnrctl start –> To start the service
lsnrctl stop –> To stop the service
lsnrctl reload –> To restart the service

tnsnames.ora:

The “tnsnames.ora” file contains client side network configuration parameters. It can be found in the “$ORACLE_HOME/network/admin” directory on the client.

ORCL=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=<<SERVERNAME/IP>>)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=ORCL)
(INSTANCE_NAME=ORCL)
)
)

To avoid confusion on names, normally we keep listener name and tns name set to DBNAME for better understanding.

 

Thank you !!