Some useful commands to use ADRCI for trace monitoring:
n If you want to see the lists of all the "ORA-" error, then run following command.
n last day adrci monitor
n last hour adrci monitor
n check for recent incidents from adrci with
Purging trace and dump files with 11g ADRCI
In previous versions of Oracle prior to 11g, we had to use our own housekeeping scripts to purge the udump, cdump and bdump directories.
In Oracle 11g, we now have the ADR (Automatic Diagnostic Repository) which is defined by the diagnostic_dest parameter.
So how are unwanted trace and core dump files cleaned out in 11g automatically?
This is done by the MMON background process.
There are two time attributes which are used to manage the retention of information in ADR. Both attributes correspond to a number of hours after which the MMON background process purges the expired ADR data.
LONGP_POLICY (long term) defaults to 365 days and relates to things like Incidents and Health Monitor warnings.
SHORTP_POLICY (short term) defaults to 30 days and relates to things like trace and core dump filesThe ADRCI command show control will show us what the current purge settings are as shown below.
Setting up Short Term Policty:
In this case it is set to the defaults of 720 hours (30 days) for the Short Term and 8760 hours (One year) for the long term category. We can change this by using the ADRCI command ‘set control’
In this example we are changing the retention to 15 days for the Short Term policy attribute (note it is defined in Hours)
Purging Tracefile Manually
We can also manually purge information from the ADR using the ‘purge’ command from ADRCI (note this is defined in minutes and not hours!).
In this example we are purging all trace files older than 6 days. We see that the LAST_MANUPRG_TIME column is now populated.