Oracle Database 11g and above offers a great feature by managing its trace files by itself. In combination with the new “incident” system, a tool was necessary to handle those without enterprise manager: ADRCI. It has several other cool functions, such as a tail-like log file display, but today I just want to show a very short reference for the lifetime management of trace files and their friends.

1. Basics

The file lifetime for alerts, traces, incidents and dumps is calculated staring from the last modification done by Oracle. For example, a trace file can be used for hours (and days), but it will be deleted X hours after creation. Following this logic, a running logfile like alert.log will never be purged.

Keep in mind, the way how to work with times is confusing: The policies are in hours, the purging command accepts minutes.

2. Look up current configuration

Of course it’s useful to see how we are confugured. SHORTP_POLICY is for trace files and other things generated automatically. Incidents and other stuff done by purpose is cleaned following the LONGP_POLICY. The other fields (there are more than I am showing here) should be self-explanatory.