Oracle 11g Enhancements in AWR Baselines
Enhancements in AWR Baselines A baseline is any set of snapshots taken over a period of time. The snapshots are selected such that they yield a set of baselines that change during the period of time that you’re collecting data. The baseline captures the time-based variations for a set of baseline statistics and alerts you when the current values differ significantly from the baseline values. An AWR baseline contains a set of AWR snapshots collected over a period of time that provides a frame of reference for a known “good period,” which you can then use as a reference period to compare performance during another time period of interest. The snapshots in an AWR baseline are grouped to provide a set of baseline values that change over time. For example,the I/O rate is highest during the peak usage times in the database. One of the most difficult problems you have in setting alert thresholds is setting those thresholds to the correct levels for appropriate alerts. Arbitrary alerts that remain identical throughout are not optimal because they will likely miss the natural peaks and valleys in the workload of a real production database. Baselines,on the other hand,are ideal for setting time- dependent alert thresholds because the baselines let the database compare apples with apples and oranges with oranges,by enabling the comparison of present performance with baseline data from a similar time period. Oracle Database 11g enables you to collect two types of baselines: static baselines and moving window baselines. A static baseline can be a single baseline collected over a single fixed time period (for example,from Jan 1,2008 at 10:00 A.M. to Jan 1,2008 at 12:00 P.M.) or a repeating baseline collected over a repeating time period (for example,every first Monday in a month from 10:00 A.M. to 12:00 P.M. for the year 2008). The moving window baseline captures data over a window that keeps moving over time. Oracle Database 11g creates a system-defined moving window baseline by default. This default moving window corresponds to the AWR data captured during the AWR retention period,which is now eight days,rather than seven days,as it was in the Oracle Database 10g release. Baselines help you set alert thresholds,monitor performance,and compare advisor reports. This is a definite improvement over the Oracle Database 10g release,where all you can really do with an AWR baseline is to just create and drop static single baselines. Oracle Database 11g provides several enhancements to the AWR baselines feature,including the following:
Single AWR Baseline The fixed,or static,baseline functionality is a little more flexible in Oracle 11g compared to that of Oracle 10g. Originally,the DBMS_WORKLOAD_REPOSITORY package included a single CREATE_BASELINE procedure allowing you to define baselines using specific snapshot IDs. It now includes overloaded procedures and functions allowing baselines to be created using start and end times,which are used to estimate the relevant snapshot IDs. The functions have the same parameter lists as the procedures,but return the baseline ID. By default baselines are kept forever,but the new expiration parameter allows them to be automatically expired after a specified number of days. The DBA_HIST_BASELINE_DETAILS view shows details about all AWR baselines. ???? Type
Information about a specific baseline can be displayed by using the BASELINE_ID with the SELECT_BASELINE_DETAILS pipelined table function Baseline Templates The time period spanned by a baseline template can lie in the future or it can encompass a past timeline. No matter which timeframe you choose,the manageability infrastructure automatically generates a task and creates a baseline right away.Each night,the MMON (Memory Monitor background process) task checks to see whether the end time has passed for any baseline templates you created. If it discovers that a template for baseline generation contains a completed time range,it will create the baseline for the period specified by the baseline template. Besides it will delete the expired Baseline Templates,the information refer to the DBA_HIST_BASELINE_TEMPLATE view.You can create two types of baseline templates—a single? baseline template or a repeating baseline template. You can schedule the creation of an AWR baseline for a contiguous future time period such as a known heavy usage period. Using the single AWR baseline template,you can then automatically capture a baseline of the performance during the period you specify. The following example shows how to create a single baseline template using the CREATE_BASELINE_TEMPLATE procedure: The optional expiration parameter specifies that this baseline will expire in 100 days. The value you set for the expiration parameter specifies the length of time for which the database will maintain a baseline. If you don’t specify an expiration time period (NULL),the baseline will never expire. The baseline_name and template_name parameters are self-explanatory. The start_ time and end_time parameters specify the beginning and ending snapshot time periods. You can also specify a DBID parameter,but its value defaults to NULL if you omit it,as in this case. You can create a repeating baseline template to schedule the creation of an AWR baseline for a known period such as around 3:00 P.M. every Friday evening for an entire year. The database will automatically create a new baseline every Friday and you can have the database also automatically remove older baselines after a specified expiration time. Here’s how you create a repeating baseline template using the CREATE_BASELINE_TEMPLATE procedure again: BEGIN ?? DBID??? => 12345);
Information about baseline templates is displayed using the DBA_HIST_BASELINE_TEMPLATE view. Moving Window AWR Baselines Oracle Database 11g offers you a choice between a static baseline and a moving window baseline. It also allows you to create both a single static baseline and a repeating static baseline. You can create a moving window AWR baseline instead of a mere fixed baseline corresponding to a fixed,contiguous past period in time. Oracle creates and maintains a system-defined moving window baseline by default. A moving window baseline encompasses AWR data during the AWR retention period,which is,by default,eight days. (In Oracle Database 11g,the default retention period has been increased to eight days from the previous retention period of seven days.) This default moving window baseline is called the system_moving_window. Oracle schedules the statistics collection for this window every Sunday at midnight. The setting for days is always null for this baseline,thereby making the window size exactly match the duration of the AWR retention setting. Enterprise Manager uses the system-defined baseline as the default to compare performance with the current database performance. Moving window baselines are especially useful when you’re using adaptive thresholds because you can then utilize the data from the entire AWR retention period to compute the values for the metric thresholds you’ve selected. By default,the adaptive thresholds feature uses statistics on the default moving window baseline (SYSTEM_MOVING_WINDOW baseline). However,Oracle advises you to use a larger moving window such as 30 days rather than the default AWR retention period of 8 days,if you’re considering using adaptive thresholds. Because a moving window baseline depends on the AWR data,it can range over the length of the AWR retention period or a shorter time span. If you want to increase the size of the moving window,make sure that you first increase the size of the AWR retention period. Use the MODIFY_BASELINE_WINDOW_SIZE procedure to resize the default moving window baseline size of 8 days. Here’s an example that sets the moving window baseline size to 20 days: The current AWR retention period can be displayed by querying the RETENTION column of the DBA_HIST_WR_CONTROL view. Setting AWR Baseline Metric Thresholds Sometimes,you want to examine the metric threshold settings for the time period spanned by a baseline. Using the AWR data contained in the baseline,you can compute the metric threshold values. Use the SELECT_BASELINE_METRICS function to display the metric value statistics during the period covered by a baselineSELECT *FROM TABLE(DBMS_WORKLOAD_REPOSITORY.select_baseline_metric(‘peak_baseline‘)); The previous code will display the metric thresholds for the baseline named peak_baseline. Oracle Database 11g provides a built-in alert infrastructure that warns you about potential problems in the database. The default alerts include alerts pertaining to tablespace usage,recovery area space problem,suspended resumable sessions,and the “snapshot too old” error. However,you can also specify a custom performance alert based on performance-related metric thresholds. For example,a blocked_user threshold issues an alert when the number of users blocked by any one session exceeds the metric threshold you set. Performance alert thresholds can be difficult to determine because the expected metric values do vary by the type and amount of the workload.Using baselines,you can capture metric value statistics. If the baseline is static,you can manually compute the metric value statistics over the baseline. If you’re using a system moving window,the database can automatically compute the metric value statistics over the moving window. You can then use the baseline metric statistics to define the alert thresholds specific to the baseline. Baselines capture metric values,which the database will then compare against current performance metrics to judge how current performance measures up against performance during a known good period. If there’s a serious discrepancy—that is,if the expected values are very different from the actual present statistics—the database will issue a performance alert. Whether you use a manually computed static baseline or a baseline automatically computed over the system moving window,the baseline values are compared to present statistics to see if an alert is justified. Adaptive thresholds are so named because the thresholds aren’t fixed,but vary according to the conditions in the database—they adapt to the type and amount of the workload.? The database computes statistics from the system moving window according to the BSLN_MAINTAIN_STATS_SCHED schedule.? The metric statistics that you capture over a baseline enable you to set thresholds for comparing baseline statistics to current activity. You can use three different threshold types,as explained here:
Oracle Database 11g fully integrates the selection of adaptive thresholds for performance metrics with the AWR baselines,with the baselines serving as the source of the metrics. The database determines the alert thresholds by examining the metric statistics captured over the baseline time period. Thus,the database sets the thresholds based on data provided by the database itself,and you don’t have to know any system-specific metrics. The database sets the thresholds based on system data itself and some metadata provided by you. Using the Enterprise Manager,you can choose a starter set of thresholds based on either the OLTP or the Data Warehouse workload profile. Once you select the appropriate workload profile,the database will automatically configure and maintain the adaptive thresholds based on the default SYSTEM_MOVING_WINDOW baseline. The adaptive thresholds will cover all metrics suitable for the chosen workload profile. Once you configure the adaptive thresholds,you can edit the thresholds levels. When you’re editing the threshold levels,Oracle recommends that you set the initial significance level thresholds conservatively in the beginning because a very high significance level will keep the number of alerts low. ? 參考至:《McGraw.Hill.OCP.Oracle.Database.11g.New.Features.for.Administrators.Exam.Guide.Apr.2008》 ??????????????? http://www.oracle-base.com/articles/11g/awr-baseline-enhancements-11gr1.php (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |