denrepo

OracleMaintenance

Rotate the listener log

Turns listener logging off, lets you rename the current listener.log, then turns logging back on so a fresh file starts. Run it from the OS prompt as the listener owner.

Changes dataOS prompt

Tested on 12c, 19c · verified Sep 2026

This changes files or settings on the server. Check the names and values before you run it.
ora-listener-rotate.sh
1# From the OS prompt as the listener owner.2# Where is the log? lsnrctl status shows the ADR location; listener.log3# is in the trace directory beside it.4lsnrctl status5 6# 1) Turn logging off and confirm7lsnrctl8LSNRCTL> set log_status off9LSNRCTL> show log_status10 11# 2) In another terminal, rename the current log, for example:12#    mv listener.log listener_$(date +%Y%m%d).log13 14# 3) Turn logging back on and confirm15LSNRCTL> set log_status on16LSNRCTL> show log_status17 18# 4) Check that a new listener.log was created19#    ls -l listener.log

Run these at the operating system prompt.

Open in denrepo

Helps with