Steps to rename the listener log file in Oracle
Following are the steps to rename the listener log file in Oracle:
1. Open the command prompt or terminal, Set the Oracle home and PATH:
-- Windows
set oracle_home=E:\oracle\18.0.0\dbhome_1
set path=%oracle_home%\bin;%oracle_home%\opatch;%path%
--Linux
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/18.0.0
export PATH=$ORACLE_HOME/bin:$PATH
2. Open the listener command prompt with command “lsnrctl”.
C:\windows\system32>lsnrctl
LSNRCTL for 64-bit Windows: Version 18.0.0.0.0 - Production on 26-NOV-2020 20:40:20
Copyright (c) 1991, 2018, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL>
3. Stop the listener log with command “set log_status off”
LSNRCTL> set log_status off
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=WINORACLE.ORCL.com)(PORT=1521)))
LISTENER parameter "log_status" set to OFF
The command completed successfully
4. Manually rename the listener log file by Operating system commands
Go to location of listener.log file:
mv listener.log listener_old.log
Note: If you donot know the location of listener log file then use command “status”
LSNRCTL> status
-- In status you will find the following line but it will point to xml.
Listener Log File C:\Oracle\dbhomeXE\diag\tnslsnr\WINORACLE\listener\alert\log.xml
--You will change the path of last folder instead of "alert" to "trace".
C:\Oracle\dbhomeXE\diag\tnslsnr\WINORACLE\listener\trace\listener.log
5. Start the listener log with command “set log_status on”
LSNRCTL> set log_status on
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=WINORACLE.ORCL.com)(PORT=1521)))
LISTENER parameter "log_status" set to ON
The command completed successfully