file lock

Clearing a hot oracle log file on windows

sometimes, i know not on our installations ;-), one may have forgotten to size and schedule oracle logging appropriately. a typical case is setting LOGGING_LISTENER = ON in the listener.ora and then just loosing sight of it. the next or another day later one will get a call that the system is slow, this time because oracle hardly works to still append to that multi-gigabyte listener.log file. oops, what to do know? one can’t delete the file because it is locked by the owning process. one can neither bounce the listener in a 24×7 environment. an option one has though is to shred the contents of the file by overwriting it with just nothing or NULL on windows (/dev/null on un*x):

type NUL > %my_correct_path%\listener.log

have fun