Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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?
share|improve this question

migrated from stackoverflow.com Jul 26 '12 at 12:48

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers 2

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.

share|improve this answer
add comment
  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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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