本文共 7343 字,大约阅读时间需要 24 分钟。
Oracle OCP 1Z0-050(33题)解析
QUESTION 33:
Which statement is true when Automatic Workload Repository (AWR) baselines are created using baseline templates?
A. AWR baselines are always created with infinite expiration duration.
B. AWR baselines are always created as repeating baselines.
C. AWR baselines are always created using the Automatic Workload Repository (AWR) retention period as expiration duration.
D. AWR baselines can be created on the basis of two-time values.
Answer: D
解析:
参考Oracle官方文档:
The Automatic Workload Repository (AWR) collects, processes, and maintains performance statistics for problem detection and self-tuning purposes. This data is both in memory and stored in the database. The gathered data can be displayed in both reports and views.
The statistics collected and processed by AWR include:
Object statistics that determine both access and usage statistics of database segments
Time model statistics based on time usage for activities, displayed in the V$SYS_TIME_MODEL
and V$SESS_TIME_MODEL
views
Some of the system and session statistics collected in the V$SYSSTAT
and V$SESSTAT
views
SQL statements that are producing the highest load on the system, based on criteria such as elapsed time and CPU time
ASH statistics, representing the history of recent sessions activity
Gathering database statistics using the AWR is enabled by default and is controlled by the STATISTICS_LEVEL
initialization parameter. The STATISTICS_LEVEL
parameter should be set to the TYPICAL
or ALL
to enable statistics gathering by the AWR. The default setting is TYPICAL
. Setting STATISTICS_LEVEL
to BASIC
disables many Oracle Database features, including the AWR, and is not recommended. If STATISTICS_LEVEL
is set to BASIC
, you can still manually capture AWR statistics using the DBMS_WORKLOAD_REPOSITORY
package. However, because in-memory collection of many system statistics—such as segments statistics and memory advisor information—will be disabled, the statistics captured in these snapshots may not be complete. For information about the STATISTICS_LEVEL
initialization parameter, see .
5.3.3.1 Creating a Single Baseline Template
This section describes how to create a single baseline template. You can use a single baseline template to create a baseline during a single, fixed time interval in the future. For example, you can create a single baseline template to generate a baseline that is captured on April 2, 2009 from 5:00 p.m. to 8:00 p.m.
To create a single baseline template, use the CREATE_BASELINE_TEMPLATE
procedure:
BEGIN DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE_TEMPLATE ( start_time => '2009-04-02 17:00:00 PST', end_time => '2009-04-02 20:00:00 PST', baseline_name => 'baseline_090402', template_name => 'template_090402', expiration => 30, dbid => 3310949047);END;/
The start_time
parameter specifies the start time for the baseline to be created. The end_time
parameter specifies the end time for the baseline to be created. The baseline_name
parameter specifies the name of the baseline to be created. The template_name
parameter specifies the name of the baseline template. The optional expiration
parameter specifies the expiration, in number of days, for the baseline. If unspecified, then the baseline never expires. The optional dbid
parameter specifies the database identifier. If unspecified, then the local database identifier is used as the default value.
In this example, a baseline template named template_090402
is created that will generate a baseline named baseline_090402
for the time period from 5:00 p.m. to 8:00 p.m. on April 2, 2009 on the database with a database ID of 3310949047
. The baseline will expire after 30 days.
5.2.2.3 Baseline Templates
You can also create baselines for a contiguous time period in the future using baseline templates. There are two types of baseline templates: single and repeating.
You can use a single baseline template to create a baseline for a single contiguous time period in the future. This technique is useful if you know beforehand of a time period that you intend to capture in the future. For example, you may want to capture the AWR data during a system test that is scheduled for the upcoming weekend. In this case, you can create a single baseline template to automatically capture the time period when the test occurs.
You can use a repeating baseline template to create and drop baselines based on a repeating time schedule. This is useful if you want Oracle Database to automatically capture a contiguous time period on an ongoing basis. For example, you may want to capture the AWR data during every Monday morning for a month. In this case, you can create a repeating baseline template to automatically create baselines on a repeating schedule for every Monday, and automatically remove older baselines after a specified expiration interval, such as one month.
5.3.3.2 Creating a Repeating Baseline Template
This section describes how to create a repeating baseline template. A repeating baseline template can be used to automatically create baselines that repeat during a particular time interval over a specific period in the future. For example, you can create a repeating baseline template to generate a baseline that repeats every Monday from 5:00 p.m. to 8:00 p.m. for the year 2009.
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;/
The day_of_week
parameter specifies the day of the week on which the baseline will repeat. The hour_in_day
parameter specifies the hour in the day when the baseline will start. The duration
parameter specifies the duration, in number of hours, that the baseline will last. The expiration
parameter specifies the number of days to retain each created baseline. If set to NULL
, then the baselines never expires. The start_time
parameter specifies the start time for the baseline to be created. The end_time
parameter specifies the end time for the baseline to be created. The baseline_name_prefix
parameter specifies the name of the baseline prefix that will be appended to the data information when the baseline is created. The template_name
parameter specifies the name of the baseline template. The optional dbid
parameter specifies the database identifier. If unspecified, then the local database identifier is used as the default value.
In this example, a baseline template named template_2009_mondays
is created that will generate a baseline on every Monday from 5:00 p.m. to 8:00 p.m. beginning on April 2, 2009 at 5:00 p.m. and ending on December 31, 2009 at 8:00 p.m. on the database with a database ID of 3310949047
. Each of the baselines will be created with a baseline name with the prefix baseline_2009_mondays_
and will expire after 30 days.
转载地址:http://mutdi.baihongyu.com/