【OCP学习1z0-053记录39】DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE_TEMPLATE

110.You plan to collect the Automatic Workload Repository (AWR) data every Monday morning for a month. You want Oracle Database to automatically create a baseline every Monday and remove the old baseline. What is the correct action to achieve this?
A. Create and populate a SQL Tuning Set from the AWR on every Monday.
B. Change the RETENTION setting for the AWR snapshots to 7 days on Monday.
C. Create a repeating baseline template.
D. Insert a finding directive for future ADDM tasks.
Answer: C

参考:http://docs.oracle.com/cd/E11882_01/server.112/e41573/autostat.htm#PFGRF94196


5.3.3.2 Creating a Repeating Baseline Template
本节描述如何创建重复基线模板。重复基线模板可用于自动创建基线,这些基线将在未来特定时间段内的特定时间间隔内重复。例如,您可以创建一个重复基线模板,以生成一个基线,该基线在2009年的每周一下午5点到8点之间重复。
To create a repeating baseline template, use the CREATE_BASELINE_TEMPLATE procedure:
BEGIN
    DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE_TEMPLATE (
                   day_of_week => 'monday', hour_in_day => 17,
                   duration => 3, expiration => 30,
                   start_time => '2009-04-02 17:00:00 PST',
                   end_time => '2009-12-31 20:00:00 PST',
                   baseline_name_prefix => 'baseline_2009_mondays_',
                   template_name => 'template_2009_mondays',
                   dbid => 3310949047);
END;
/
参数day_of_week指定基线将重复出现的星期几。hour_in_day参数指定基线开始的时间。duration参数指定基线将持续的时间(以小时为单位)。expires参数指定保留每个创建基线的天数。如果设置为NULL,那么基线永远不会过期。start_time参数指定要创建的基线的开始时间。end_time参数指定要创建基线的结束时间. baseline_name_prefix参数指定基线的名称,基线创建时将附加到数据信息中。template_name参数指定基线模板的名称。可选的dbid参数指定数据库标识符。如果未指定,则使用本地数据库标识符作为默认值。
在这个示例中,创建一个基线模板命名template_2009_mondays将生成一个基线从下午5点到8点开始每星期一4月2日,2009年12月31日下午5点,结束2009年下午8点在数据库与数据库的ID 3310949047。每个基线都将使用前缀baseline_2009_mondays_的基线名称创建,并将在30天后过期。
5.3.3.3 Dropping a Baseline Template
本节描述如何删除现有基线模板。您可能希望定期删除不再用于保存磁盘空间的基线模板。
To drop a baseline template:
Review the existing baselines in the DBA_HIST_BASELINE_TEMPLATE view to determine the baseline template you want to drop.
Use the DROP_BASELINE_TEMPLATE procedure to drop the desired baseline template:
BEGIN
  DBMS_WORKLOAD_REPOSITORY.DROP_BASELINE_TEMPLATE (
                   template_name => 'template_2009_mondays',
                   dbid => 3310949047);
END;
/
template_name参数指定将要删除的基线模板的名称。在本例中,将要删除的基线模板的名称是template_2009_mondays。可选的dbid参数指定数据库标识符,在本例中为3310949047。如果没有为dbid指定值,则使用本地数据库标识符作为默认值。

猜你喜欢

转载自blog.csdn.net/viviliving/article/details/89493873
今日推荐