When moving/deleting the listener.log, I used to stop and start the listener and move/delete the listener in between the actions.
This method has a big inconvenience: users can not connect to the database for a few seconds…
What I never knew was that the listener could be told to stop and start logging and take the appropriate action in between.
A colleague (Joords) reminded me of the following listener option:
lsnrctl set log_status [on|off]
cd \oracle\product\10.2.0\db_1\NETWORK\log lsnrctl set log_status off rename listener.log listener.old lsnrctl set log_status on
cd /u01/app/oracle/product/10.2.0/db_1/NETWORK/log lsnrctl set log_status off mv listener.log listener.old lsnrctl set log_status on
One of the comments I got from Guillaume mentions that when ADMIN_RESTRICTIONS are turned on, the command is not available any more…