- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
3#
发表于 2013-4-22 18:58:55
参考这个文档吧
Grid Control Repository: How to Modify the Retention and Purging Policies for Metric Data? [ID 430830.1]
Enterprise Manager Base Platform - Version 10.2.0.2 to 11.1.0.1 [Release 10.2 to 11.1]
Information in this document applies to any platform.
***Checked for relevance on 26-08-2012***
Goal
The metric data that is collected and uploaded by the Agents on the targets hosts is called the 'raw' data, which is stored by the OMS into the repository tables. One of the DBMS_Job's (Rollup job) in the Repository is reponsible for rolling up / aggregating this raw data into 1Hour metric tables, which are further rolled up into 1Day tables. The 1Hour and 1Day is used for providing historical metric information in the Grid Console UI pages. The 3 tables that store this data are:
MGMT_METRICS_RAW
MGMT_METRICS_1HOUR
MGMT_METRICS_1DAY
After the data is aggregated, it considered eligible for purging. However, a certain period of time has to pass for data to actually be purged. This period of time is called the Retention time.
The goal of this document is to provide information on how to modify the Grid Control Default Retention and Purging Policies in 10g Grid Control.
Note:
The default aggregation and purging policies have been designed to provide the most available data for analysis while still providing the best performance and disk-space requirements for the Management Repository. As a result, these should not be modified to improve performance or increase the available disk space. Increasing the retention time drastically can affect the performance of the Management Repository and have adverse reactions on the scalability of the Enterprise Manager installation.
Fix
Due to an unpublished bug in Grid Control 10gR2, it was not possible to change the default retention time for the data stored in the Repository of Grid Control.
Refer to
This bug is fixed in 10gR3 (10.2.0.3) and a generic one off patch is available on top of Grid Control 10.2.0.2.0
- If you want to change the default retention times in Grid Control, you need to upgrade to Grid Control 10.2.0.3 or later. Oracle recommends to always upgrade to the latest Release available.
- If you want to change the default retention times in 10.2.0.2, you need to apply the following Patch:
Patch 3900473 TRUNCATION OF PARTITIONED TABLES MUST ALLOW OVERRIDE OF RETENTION TIMES
The procedure on how to accomplish this was documented in the 10gR1 Advanced Configuration Guide. This is still valid for 10gR2 and 10gR3, however due to a documentation bug the information was not included in the corresponding documentation.
The steps are the same for all versions and are explained in Oracle� Enterprise Manager Administration 10g Release 5 (10.2.0.5), Chapter 12 - Maintaining and Troubleshooting the Management Repository
Topic: Management Repository Data Retention Policies
Example for Changing Retention Time
The raw data, with the highest insert volume, has the shortest default retention time, which is set to 7 days. As a result, 7 days after it is aggregated into a one-hour record, a raw data point is eligible for purging. One-hour aggregate data records are purged 31 days after they are rolled up to the one-day data table. The highest level of aggregation, one day, is kept for 365 days.
The default data retention policies are summarized in the following table:
Aggregate Level Retention Time
Raw metric data 7 days
One-hour aggregated metric data 31 days
One-day aggregated metric data 365 days
To modify the default retention time for each level of management data in the repository, you must insert additional rows into the MGMT_PARAMETERS table in the repository database. The Table below shows the parameters that need to be inserted into the MGMT_PARAMETERS table, to modify the retention time for each of the raw data and aggregate data tables.
Table Name Parameter in MGMT_PARAMETERS Table Default Retention Value
MGMT_METRICS_RAW mgmt_raw_keep_window 7 days
MGMT_METRICS_1HOUR mgmt_hour_keep_window 31 days
MGMT_METRICS_1DAY mgmt_day_keep_window 365 days
For example, to change the default retention time for the table MGMT_METRICS_RAW from 7 days to 14 days:
1. Use SQL*Plus to connect to the repository database as the SYSMAN user.
2. Check the current value of the MGMT_METRICS_RAW retention value:
SQL> select parameter_name, parameter_value from mgmt_parameters
where parameter_name='mgmt_raw_keep_window';
If there is no row shown, then the value is set to the default value of 7.
3. Enter the following SQL to insert the parameter and change the default value:
SQL> INSERT INTO MGMT_PARAMETERS (PARAMETER_NAME, PARAMETER_VALUE) VALUES ('mgmt_raw_keep_window','14');
SQL> commit;
4. To modify the existing setting, to say 15 days, execute:
SQL> Update MGMT_PARAMETERS set parameter_value=15
where parameter_name='mgmt_raw_keep_window';
SQL> commit;
Note:
1. The information provided above is an excerpt from the documentation above. Please consult the current documentation for full details.
2. The MGMT_PARAMETERS table does not have entries for the default parameter values. Hence, the first time a modification needs to be done the parameter and its value has to be inserted into this table. For subsequent changes, the existing parameter value can be modified.
For modifying Job History retention time, refer to Note 604978.1: Grid Control Repository: How to Set the Retention Period or Purge Policy for Enterprise Manager Job History? |
|