RE: purge EM repository objects

  • From: Courtney Llamas <courtney.llamas@xxxxxxxxxx>
  • To: patrice.boivin@xxxxxxxxx, ORACLE-L <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 10 Mar 2015 06:55:13 -0700 (PDT)

Let’s just start with, don’t drop anything in SYSMAN on your own.   Bad bad 
things will happen ;)  

 

EM has defined retention policies that will purge metrics, alerts, jobs, etc on 
regular basis.   What I think you’re asking is how to modify retention 
policies.    This is documented in the 11g EM Admin Guide - 
https://docs.oracle.com/cd/E11857_01/em.111/e16790/repository.htm#i1030660 .   
Each data type will have its own purge policy.  The EM jobs (dbms_jobs) will 
manage this purging cycle.    

 

As far as sizing, your repository will grow for 1 year, then steady out.  
Unless you have a significant increase in incoming data, targets or jobs of 
course.  

 

Specifically for jobs, default is set to 30 days:

 

How to Modify the Retention Period of Job History

Enterprise Manager Grid Control has a default purge policy which removes all 
finished job details which are older than 30 days. This section provides 
details for modifying this default purge policy.

The actual purging of completed job history is implemented via a DBMS job that 
runs once a day in the repository database. When the job runs, it looks for 
finished jobs that are 'n' number of days older than the current time (value of 
sysdate in the repository database) and deletes these jobs. The value of 'n' 
is, by default, set to 30 days.

The default purge policy cannot be modified via the Enterprise Manager console, 
but it can be changed using SQL*Plus.

To modify this purge policy, follow these steps:

Log in to the repository database as the SYSMAN user, via SQL*Plus
Check the current values for the purge policies using the following command:

SQL> select * from mgmt_job_purge_policies;

POLICY_NAME                      TIME_FRAME

-------------------------------- ----------

SYSPURGE_POLICY                          30

REFRESHFROMMETALINKPURGEPOLICY            7

FIXINVENTORYPURGEPOLICY                   7

OPATCHPATCHUPDATE_PAPURGEPOLICY           7

The purge policy responsible for the job deletion is called SYSPURGE_POLICY. As 
seen above, the default value is set to 30 days.

To change the time period, you must drop and re-create the policy with a 
different time frame:

SQL> execute MGMT_JOBS.drop_purge_policy('SYSPURGE_POLICY');

PL/SQL procedure successfully completed.

SQL> execute MGMT_JOBS.register_purge_policy('SYSPURGE_POLICY', 60, null);

PL/SQL procedure successfully completed.

SQL> COMMIT;

Commit complete.

SQL> select * from mgmt_job_purge_policies;

POLICY_NAME                      TIME_FRAME

-------------------------------- ---------- 

SYSPURGE_POLICY                          60

....

The above commands increase the retention period to 60 days. The timeframe can 
also be reduced below 30 days, depending on the requirement.

You can check when the purge job will be executed next. The actual time that 
the job runs may vary with each Enterprise Manager installation. To determine 
this time in your setup follow these steps:

Login to the Repository database using the SYSMAN account
Execute the following command:

SQL> alter session set nls_date_format='mm/dd/yy hh:mi:ss pm';

SQL> select what, next_date from user_jobs where what like '%JOB_ENGINE%';

WHAT

------------------------------------------------------------------------------

NEXT_DATE

--------------------

MGMT_JOB_ENGINE.apply_purge_policies();

09/23/08 10:26:17 am

In this example, the purge policy DBMS job will run every day at 10:26:17 AM, 
repository time.

 

 

From: Patrice sur GMail [mailto:patrice.boivin@xxxxxxxxx] 
Sent: Tuesday, March 10, 2015 7:37 AM
To: ORACLE-L
Subject: purge EM repository objects

 

We're wondering how to drop those LOB segments EM creates to save job results

 

the EM11g page doesn't show us much in terms of keeping the size of the 
repository to a minimum

-- Patrice

My profiles: HYPERLINK 
"http://www.facebook.com/home.php?#!/profile.php?id=100000206805521"; 
\nFacebookHYPERLINK "http://ca.linkedin.com/pub/patrice-boivin/a/933/5a9"; 
\nLinkedInHYPERLINK "http://www.twitter.com/PatriceBoivin"; \nTwitter

 

Signature powered by HYPERLINK "http://www.wisestamp.com/email-install"; 
\nWiseStamp 

Other related posts: