Enable trace for a Listener

Sometimes for a support request, some for apps self debug… but sometimes we need enable trace on the listener. It is a simple task so let’s do it!

Connect to lsnrctl

[+ASM@labo1234 ~]$ lsnrctl

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 27-MAR-2019 04:25:58

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> 

Set the listener we need to work with.

LSNRCTL> set current_listener LSNAPPS01
Current Listener is LSNAPPS01
LSNRCTL>

Get the current state (Trace Level)

LSNRCTL> status
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LSNAPPS01
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                13-SEP-2018 11:50:02
Uptime                    194 days 16 hr. 26 min. 30 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/12.2.0/grid/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/labo1234/listener/alert/log.xml
...
...

Change the trace level to ADMIN. This is the most used, if support needs another they will tell you.

LSNRCTL> set trc_level ADMIN
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=labo1234)(PORT=1521)))
LISTENER parameter "trc_level" set to admin
The command completed successfully
LSNRCTL>

Get the new state and see where the trace file will be located.

LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=labo1234)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LSNAPPS01
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                13-SEP-2018 11:50:02
Uptime                    194 days 16 hr. 36 min. 3 sec
Trace Level               admin
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/12.2.0/grid/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/labo1234/listener/alert/log.xml
Listener Trace File       /u01/app/grid/diag/tnslsnr/labo1234/listener/trace/ora_4012_140280313655680.trc
...
...

NOTE: When you need disable it, just execute “set trc_level OFF”