07 April, 2015

Oracle listener log file growing too large

Oracle listener.log file growing too large:
If the oracle database listener log file  (listener_<DB name>.log) is growing at higher pace. Do the below to move the file and let the DB create the new file. 


Pre-requisite;
ADMIN_RESTRICTIONS_LISTENER_CL1 parameter should be off or commented out at listener.ora file located at $ORACLE_HOME/network/admin

1. connect to the server
2. connect to the DB environment if you have more than one DB installed within the same oracle_home
3. connect to the listener - lsnrctl
4. look up to verify if you are connect to the current DB listener : show current_listener
5. if you need to connect to the right listener : set current_listener <LISTENER NAME>
 lsnrctl > show --> shows all the available commands that can be run
6. show log_Status --> shows the current status the logging

example:
LSNRCTL> show log_status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orat)(PORT=1512)))
LISTENER_AGSBX parameter "log_status" set to ON

7. Set the log_status to OFF in order for us to rename the active listener log file and post which we can move to a different file system if needed to make space.

LSNRCTL> set log_status off

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orat)(PORT=1512)))

LISTENER_AGSBX parameter "log_status" set to OFF

The command completed successfully

8. verify the log_status once again and quit
9. rename the listener file
AGSBX>mv listener_agsbx.log listener_agsbx.log.03312015
10. connect to the listener as per the above steps from 1 to 5.
11. set the log_status to ON again 


LSNRCTL> set log_status ON
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orat)(PORT=1512)))
LISTENER_AGSBX parameter "log_status" set to ON
The command completed successfully

LSNRCTL> show log_status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orat)(PORT=1512)))
LISTENER_AGSBX parameter "log_status" set to ON
The command completed successfully

12. the new file gets created and will be used by the DB now.

AGSBX>pwd
/u01/home/oracle/diag/tnslsnr/orat1/listener_agsbx/trace
AGSBX>ls -lart listener*
-rw-r----- 1 oracle dba 3059024868 Mar 31 12:35 listener_agsbx.log.03312015
-rw-r----- 1 oracle dba 152467 Mar 31 12:37 listener_agsbx.log

No comments:

Post a Comment