The Enterprise Manager default purge policy for jobs deletes all finished jobs that are older than 30 days. This value cannot be changed using Enterprise Manager, but it can be changed using SQL*Plus.
To change the default time period (for example, to 60 days), use SQL*Plus to log into the Management Repository database as the Enterprise Manager repository owner (SYSMAN). The default purge policy is called SYSPURGE_POLICY. To change the time period, simply drop and re-create the policy with a different time frame:
SQL> execute MGMT_JOBS.drop_purge_policy('SYSPURGE_POLICY');
SQL> execute MGMT_JOBS.register_purge_policy('SYSPURGE_POLICY', 60, null);
SQL> COMMIT;
The actual purging of jobs is implemented by a DBMS job that runs once a day. When the job runs, it will look for and delete finished jobs that are the specified number of days older than the current time. (The current time refers the current time with respect to the Management Repository database). The actual time that the job runs may vary with each Enterprise Manager installation. To determine this time for your Enterprise Manager installation, use SQL*Plus to connect to the Management Repository database using the SYSMAN account. Then perform the following queries:
SQL> alter session set nls_date_format='mm/dd/yy hh:mi:ss pm';(Optional: this will format the date appropriately)SQL> select what, next_date from user_jobs;In the value for the ‘WHAT’ column, look for the MGMT_JOB_ENGINE.apply_purge_policies job, as shown below. The job will run at the same time each day. In this example, the purge policy job will run every day at 11:45:21 am, repository time:
WHAT
------------------------------------------------------------
NEXT_DATE
--------------------
MGMT_JOB_ENGINE.apply_purge_policies();
12/09/03 11:45:21 am