The partition containing my Oracle 11g installation began to fill up with trace files and when I went looking for what are these I've found this disturbing post about how to disable the trace file generation.

The two related questions I have are:

  1. Can I simply delete these trace files from my FS w/o consequence ? (I know, if they apeared one should probably look at them.. but won't happen and the database has no production use whatsoever. Going to have to happen another time.)
  2. What should be done to prevent it from appearing again?

2 Answers 2

  1. Yes, it's safe to delete them.

  2. If you're running on Linux, set up logrotate to compress & then delete after a set period of time. Examples of Oracle logrotate configuration can be found here.


One more comment. Some of trace files stay open as long the database is OPEN. When you delete them, the space is not freed. One of them is LMD trace file on RAC cluster

Then you must use oradebug as described here: http://blog.fatalmind.com/2010/02/01/oracle-trace-file-rotation/ or here: http://agstamy.blogspot.de/2010/11/flushing-and-closing-trace-files-using.html

SELECT s.sid, s.serial#, p.pid FROM v$session s, v$process p 
WHERE s.paddr=p.addr and s.program like '%LMD%';

SQL> oradebug setorapid 6
Unix process pid: 17652, image: oracle@labdb01 (LMD0)
SQL> oradebug close_trace
Statement processed.
SQL> oradebug flush
Statement processed.

You can also use Linux command lsof to list Oracle processes accessing deleted files. Then you can also truncate deleted file in Linux through /proc filesystem.

lsof -p <OSPID> | grep deleted
cd /proc/<OSPID>/fd/
echo -n > <file descriptor number>

Plus Oracle has it's own tool ADRCI for this purpose. Just beware this was quite buggy in early 11g releases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.