Some Enterprise Manager customers, complain about the high volume of data stored in OMS repository. Enterprise Manager agents collect metric data of targets they monitor, and upload these “raw” metric data to OMS. Depending on your metric collection periods and number of targets, the volume required to keep these data can be very huge. Enterprise Manager has already a mechanism to minimize the size of the Management Repository. Once a day, the previous day’s metric data (which is stored in em_metric_values) is aggregated into a one-hour and a one-day table (em_metric_values_hourly, em_metric_values_daily). According to the retention settings, both raw metric data and aggregated data are purged.
The default retention time for raw metric data is set to 7 days. The default retention time for hourly aggregate metric data is set to 31 days, and the default retention time for daily aggregate data is set 12 months. You can check the current retention using get_retention function in the gc_interval_partition_mgr package:
-- returns days select gc_interval_partition_mgr.get_retention('SYSMAN', 'EM_METRIC_VALUES') from dual; -- returns days select gc_interval_partition_mgr.get_retention('SYSMAN', 'EM_METRIC_VALUES_HOURLY') from dual; -- returns months select gc_interval_partition_mgr.get_retention('SYSMAN', 'EM_METRIC_VALUES_DAILY') from dual;
You can also directly query the em_int_partitioned_tables but the table names can be slightly different depending on the version of Enterprise Manager. For example, for EM13c, you need to add “_E” to the table names.
SELECT table_name, partitions_retained FROM em_int_partitioned_tables WHERE table_name IN ('EM_METRIC_VALUES_E', 'EM_METRIC_VALUES_HOURLY_E', 'EM_METRIC_VALUES_DAILY_E');
If you have problem with the size of the Management Repository. you can modify the retention for metric tables using set_retention procedure of the gc_interval_partition_mgr package:
begin -- sets to 5 days execute gc_interval_partition_mgr.set_retention('SYSMAN', 'EM_METRIC_VALUES', 5 ); -- sets to 21 days execute gc_interval_partition_mgr.set_retention('SYSMAN', 'EM_METRIC_VALUES_HOURLY', 21 ); -- sets to 6 months! execute gc_interval_partition_mgr.set_retention('SYSMAN', 'EM_METRIC_VALUES_DAILY', 6 ); end;
Although I share this information, I recommend you to not to modify the retention time of raw metric data. Maybe you can modify retention time for hourly and daily aggregated data. The best way to deal with high volume of metric data, is to modify monitoring templates and disable unnecessary metric collections and reduce “the collection frequency” for unimportant metrics.