adrci not purge trace files and alert logs I try to purge some files in oracle. I use adrci. I want to purge trace files in listener file. But it's not work. I don't know why.

[grid@orcl1 app]$ adrci

adrci&gt; set homepath diag/tnslsnr/orcl1/listener
adrci&gt; purge -age 360 -type alert
adrci&gt; purge -age 60 -type trace
adrci&gt; purge -age 1 -type trace
adrci&gt; exit


Tracefile still full with 4.9 gb.

[root@orcl1 trace]# ls -alh
total 4.9G
drwxr-xr-x  2 grid oinstall 4.0K Nov  2 12:43 .
drwxr-xr-x 14 grid oinstall 4.0K May  7 14:48 ..
-rw-r-----  1 grid oinstall  43M Aug 28  2014 listener_backup_20140828.log.bz2
-rw-r-----  1 grid oinstall 4.8G Nov  2 12:43 listener.log
[root@orcl1 trace]# pwd
/u01/app/grid/diag/tnslsnr/orcl1/listener/trace
ADRCI deletes the XML files, but not the plain text logs, which is a nuisance.

An easy but dirty solution would be overwriting the file with empty content, e.g:

$ cat /dev/null &gt; listener.log


Deleting the file while the listener is running and logging is enabled may not lead to the expected result because of the file handling implementation on Linux/UNIX platforms.

Another solution is to temporarily disable logging, delete (or move or compress) the listener.log, then enabled logging again:

$ lsnrctl set log_status off
$ rm listener.log
$ lsnrctl set log_status on


Obviously, if you want, you can just stop the listener, take care of the listener log, then start the listener again.