Showing posts with label Performance tunning. Show all posts
Showing posts with label Performance tunning. Show all posts

Wednesday, November 28, 2018

query execution taking long time in oracle (parse bug)

Oracle Query Execution Long Time Due to Parsing Bug

Issue Description

In certain Oracle environments, a specific query has been observed to exhibit erratic execution times, ranging significantly from approximately 3 seconds to 50 seconds. Upon detailed analysis, it was determined that the variability in execution time was primarily attributable to the parsing phase of the query.

This prolonged parsing time was often exacerbated by sub-optimal application coding practices, which led to the query undergoing frequent hard parses rather than leveraging soft parsing. Hard parsing is resource-intensive and contributes significantly to query latency when repeated often.

Resolution

The root cause of this inconsistent parsing performance was identified as a parsing bug within the Oracle Database software. The following workaround was implemented to mitigate the issue:

ALTER SYSTEM SET "_fix_control"='13836796:OFF' SCOPE=BOTH SID='*';
ALTER SYSTEM SET "_optimizer_cost_based_transformation"=OFF SCOPE=BOTH SID='*';

Explanation of Parameters:

  • _fix_control='13836796:OFF': This is a hidden parameter used to disable a specific internal Oracle fix (identified by bug ID 13836796). Setting it to OFF reverts a change that might be causing the parsing issue.

  • _optimizer_cost_based_transformation=OFF: This hidden parameter controls whether the optimizer performs cost-based query transformations. Disabling it can prevent certain transformation paths that might interact negatively with the parsing bug, leading to more stable execution plans and faster parsing.

Important Note:

It is crucial to understand that setting hidden parameters (those prefixed with an underscore _) should generally be avoided without prior consultation and guidance from Oracle Support. Hidden parameters are internal to Oracle and their behavior or impact can change between database versions or even patches, potentially leading to unforeseen side effects or stability issues. Always open a Service Request (SR) with Oracle Support for confirmation and advice before applying such changes in a production environment.

Tuesday, July 3, 2018

DB IOPS & Throughput from AWR report Oracle DB

Detailed I/O Metrics and Network Throughput

The AWR report provides more granular I/O and network metrics, often summarized in an "I/O Profile" or found within "Instance Activity Stats."

I/O Profile (Summary):

  • IOPS: Total Requests: Read + Write Per Second

  • Throughput (MB): Total (MB): Read + Write Per Second

Mapping from "Instance Activity Stats" to "IO Profile":

Instance Activity Stats Metric

IO Profile Metric (Per Second)

physical read total IO requests

Total Requests: Read per Second

physical write total IO requests

Total Requests: Write Per Second

physical read total bytes / 1024 / 1024

Total (MB): Read per Second

physical write total bytes / 1024 / 1024

Total (MB): Write Per Second

Mapping from "Load Profile" to "Instance Activity Stats":

Load Profile Metric

Instance Activity Stats Metric

Read IO requests

physical read IO requests

Write IO requests

physical write IO requests

Read IO(MB)

physical read bytes

Write IO(MB)

physical write bytes

Network Throughput:

These metrics provide insight into network activity related to SQL*Net communication.

  • bytes received via SQL*Net from client

  • bytes sent via SQL*Net to client

  • MB received via SQL*Net from client

  • MB sent via SQL*Net to client

Tuesday, February 27, 2018

Stored outlines vs SQL plan baseline vs SQL PROFILE

Oracle SQL Tuning Features: Stored Outlines, SQL Plan Baselines, and SQL Profiles

Oracle Database provides several powerful features to influence and stabilize SQL execution plans, helping to optimize query performance. This document explains three key features: Stored Outlines, SQL Plan Baselines, and SQL Profiles.

Stored Outlines

Stored Outlines were an earlier mechanism to "freeze" the execution plan for a specific SQL statement.

  • Purpose: To ensure that a particular SQL statement always uses the same execution plan, regardless of changes in statistics, database parameters, or optimizer versions.

  • Limitation: While they freeze a plan, they also prevent the optimizer from generating potentially more beneficial execution plans in the future. This can be a disadvantage if database conditions or data distribution change significantly, and a new, better plan could be generated.

SQL Plan Baseline

SQL Plan Management (SPM), introduced in Oracle Database 11g, provides a more robust and flexible way to manage and evolve SQL execution plans through SQL Plan Baselines.

  • Concept: When SPM is enabled, the optimizer stores generated execution plans in a special repository called the SQL Management Base (SMB). All stored plans for a specific SQL statement form its plan history.

  • Accepted Plans: Some of the plans in the history can be explicitly marked as "accepted." When the SQL statement is re-parsed, the optimizer considers only these accepted plans from the history. This set of accepted plans for that SQL statement is called a SQL plan baseline.

  • Flexibility: With SQL plan management, you can:

    • Examine all available plans in the plan history for a SQL statement.

    • Compare them to see their relative efficiency.

    • Promote a specific plan to "accepted" status.

    • Even make a plan the permanent ("fixed") one, similar to a stored outline but within the SPM framework.

  • Creation Methods: You can create a SQL plan baseline in several ways:

    • Using a SQL Tuning Set (STS).

    • From the cursor cache.

    • Exporting from one database and importing into another.

    • Automatically for every statement (if configured).

  • Evolution: A SQL plan baseline can be "evolved" (meaning new, better plans can be tested and added to the baseline) either by executing the evolve_sql_plan_baseline function (part of DBMS_SPM package) or by using the SQL Tuning Advisor.

  • Querying Baselines: You can view accepted SQL plan baselines using:

    SELECT sql_text, plan_name, enabled, accepted FROM dba_sql_plan_baselines;
    

SQL Profile

A SQL Profile is a set of auxiliary information that the query optimizer uses to enhance its ability to select the best execution plan for a SQL statement.

  • Purpose: The optimizer normally uses inputs like object and system statistics, compilation environment, and bind values to determine the optimal plan. However, in some cases, defects in these inputs or in the optimizer itself can lead to a sub-optimal plan. A SQL profile contains additional, corrective information that mitigates these problems.

  • Functionality: When used together with its regular inputs, a SQL profile helps the optimizer minimize mistakes and thus is more likely to select the best plan. It doesn't "freeze" a plan like an outline or baseline, but rather provides hints and corrections to guide the optimizer's decision-making process.

  • Creation: SQL profiles are typically created by the SQL Tuning Advisor when it identifies a sub-optimal plan for a SQL statement and finds better execution paths.

Monday, July 30, 2012

How to read AWR Report oracle DB

Oracle AWR Report Analysis: Key Sections for Performance Monitoring

The Automatic Workload Repository (AWR) report is a powerful diagnostic tool in Oracle Database that provides a snapshot of database performance over a specified time interval. Analyzing different sections of the AWR report helps DBAs identify performance bottlenecks and trends.

This document outlines several key sections of an AWR report and what information they provide.

Report Header

This is the introductory section of the AWR report.

  • Content: Provides fundamental information about the database and the AWR snapshot interval, including:

    • Database Name and ID

    • Instance Name (if RAC)

    • Platform Information

    • Snap Interval (the duration of the snapshot)

Load Profile

The Load Profile section provides a high-level summary of database activity during the snapshot interval, normalized to per-second rates.

  • DB time(s): The total amount of time Oracle has spent performing database user calls. This does not include background processes.

  • DB CPU(s): The amount of CPU time spent on user calls. Similar to DB time, it does not include background processes. The value is typically in microseconds.

  • Redo size: The average amount of redo data generated per second by transactions.

  • Logical reads: Represents Consistent Gets + DB Block Gets. This is the total number of blocks read from the buffer cache (logical I/O).

  • Block Changes: The number of data blocks modified during the sample interval.

  • Physical reads: The number of block requests that caused a physical I/O operation (i.e., had to be read from disk).

  • Physical writes: The number of physical writes performed to datafiles.

  • User calls: The number of user queries/calls generated per second.

  • Parses: The total number of parse operations (both hard and soft) per second.

  • Hard Parses: The number of parses requiring a completely new parse of the SQL statement. These consume significant resources (latches and shared pool area).

  • Soft Parses: (Derived by subtracting hard parses from total parses). A soft parse reuses a previously hard-parsed SQL statement, consuming significantly fewer resources.

  • Sorts: The number of sort operations performed per second.

  • Logons: The number of new user logons during the interval.

  • Executes: The number of SQL executions per second.

  • Transactions: The number of user transactions per second.

Shared Pool Statistics

This section provides insights into the utilization and efficiency of the Shared Pool, a critical SGA component.

  • Begin/End Memory Usage %: Shows the percentage of the Shared Pool used at the beginning and end of the snapshot.

  • SQL with executions > 1 %: Percentage of SQL statements in the Shared Pool that have been executed more than once.

  • Memory for SQL w/exec > 1 %: Percentage of Shared Pool memory consumed by SQL statements executed more than once.

Interpretation:

  • Ideally, memory usage should not be excessively high (e.g., consistently beyond 90%), as this could indicate contention in the shared pool and suggest it is too small.

  • If the percentage is very low (e.g., around 50%), it might indicate that the shared pool is too large for the current workload, leading to wasted memory.

Instance Efficiency Percentages (Target 100%)

These percentages indicate how efficiently the database instance is operating. Values close to 100% are desirable.

  • Buffer Nowait %: Percentage of buffer gets that did not have to wait.

  • Redo NoWait %: Percentage of redo entries that did not have to wait for space in the redo buffer.

  • Buffer Hit %: Percentage of logical reads that found the block already in the buffer cache (avoiding physical I/O).

  • In-memory Sort %: Percentage of sort operations performed entirely in memory (not spilling to disk).

  • Library Hit %: Percentage of parse calls that found the SQL statement already in the library cache (soft parse).

  • Soft Parse %: Percentage of total parse calls that were soft parses.

  • Execute to Parse %: Percentage of executions relative to parses. A high value indicates good SQL reuse.

  • Latch Hit %: Percentage of latch gets that were successful on the first attempt.

  • Parse CPU to Parse Elapsd %: Ratio of CPU time spent parsing to total elapsed time during parsing. A low value might indicate parsing contention.

  • % Non-Parse CPU: Percentage of CPU time spent on actual execution rather than parsing.

Top 5 Timed Foreground Events

This crucial section identifies the top 5 events that foreground processes spent the most time waiting for. "Time" is a very important component here, as it directly points to where the database is spending its time waiting. Analyzing these events is often the starting point for performance tuning.

RAC Statistics

This section is present in AWR reports generated for Oracle Real Application Clusters (RAC) environments. It provides metrics specific to inter-instance communication and resource management, such as Global Cache (GC) related wait events (e.g., gc current block request, gc cr block request).

Time Model Statistics

This section breaks down the total DB time into various components, showing how much time was spent on different database activities (e.g., SQL execution, parsing, PL/SQL execution, Java execution). This provides a granular view of where the database time is actually being consumed.

SQL Statistics

This section provides detailed performance metrics for individual SQL statements. It typically includes sub-sections that order SQL statements by:

  • SQL ordered by Elapsed Time: Top SQL statements consuming the most total time (CPU + Wait).

  • SQL ordered by CPU Time: Top SQL statements consuming the most CPU time.

  • SQL ordered by Gets: Top SQL statements performing the most logical reads (buffer gets).

  • SQL ordered by Reads: Top SQL statements performing the most physical reads.

I/O Stats Section

This section provides detailed statistics about I/O operations.

  • Av Rd(ms) (Average Read time in milliseconds): This metric is a key indicator of I/O latency. Ideally, this value should not cross beyond 10ms. A value consistently above this threshold is considered an I/O bottleneck, indicating that the storage subsystem is struggling to deliver data quickly.

Advisory Statistics

Advisory sections provide recommendations for optimizing various SGA and PGA memory components.

  • Buffer Pool Advisory: Recommends optimal DB_CACHE_SIZE based on workload simulation.

  • PGA Aggr Summary: Summary of PGA memory usage.

  • PGA Aggr Target Stats: Statistics related to the PGA Aggregate Target.

  • PGA Aggr Target Histogram: Distribution of PGA memory usage.

  • PGA Memory Advisory: Recommends optimal PGA_AGGREGATE_TARGET based on workload.

  • Shared Pool Advisory: Recommends optimal SHARED_POOL_SIZE.

  • SGA Target Advisory: Recommends optimal SGA_TARGET (if using Automatic Shared Memory Management).

  • Streams Pool Advisory: Recommends optimal STREAMS_POOL_SIZE (if using Oracle Streams).

  • Java Pool Advisory: Recommends optimal JAVA_POOL_SIZE (if using Java in the database).

init.ora Parameters

This section lists the values of all initialization parameters that were set at the instance level during the AWR snapshot interval. This is useful for understanding the database's configuration.

By thoroughly reviewing these sections in an AWR report, DBAs can gain a comprehensive understanding of database performance, identify bottlenecks, and make informed decisions for tuning and optimization.


=====================================================================


Here's how you can derive DB IOPS (Input/Output Operations Per Second) and Throughput (data transferred per second) from the sections of an AWR report you've described:

To understand your database's I/O performance, you'll primarily look at the "Load Profile" and potentially infer from the "I/O Stats" section.

Deriving DB IOPS (Input/Output Operations Per Second)

IOPS represents the number of individual read or write operations performed per second.

  1. Identify Key Metrics in "Load Profile":

    • Physical reads: This is the total number of data blocks that Oracle had to read from disk into memory during the AWR snapshot interval. Each of these counts as an I/O operation.
    • Physical writes: This is the total number of data blocks that Oracle wrote from memory to disk during the AWR snapshot interval. Each of these also counts as an I/O operation.
  2. Find the AWR Snapshot Interval:

    • Look at the "Report Header" section. It will specify the start and end times of the AWR snapshot, from which you can calculate the elapsed_seconds.
      • AWR Interval (seconds) = END_TIME - START_TIME
  3. Calculate IOPS:

    • Total IOPS = (Physical reads + Physical writes) / AWR Interval (seconds)

    Example: If Physical reads = 1,000,000, Physical writes = 500,000, and AWR Interval = 3600 seconds (1 hour): Total IOPS = (1,000,000 + 500,000) / 3600 = 1,500,000 / 3600 ≈ 416.67 IOPS

Deriving DB Throughput (Data Transferred per Second)

Throughput represents the total volume of data (in MB/GB) transferred to or from disk per second.

  1. Identify Key Metrics in "Load Profile":

    • Again, use Physical reads and Physical writes.
  2. Determine Database Block Size:

    • The AWR report itself usually lists the database block size (e.g., 8KB, 16KB) in the "Report Header" or "init.ora Parameters" section. If not, you can query show parameter db_block_size in SQL*Plus.
    • Convert the block size to bytes (e.g., 8KB = 8 * 1024 bytes = 8192 bytes).
  3. Find the AWR Snapshot Interval:

    • As before, from the "Report Header".
  4. Calculate Throughput:

    • Total Throughput (Bytes/sec) = ((Physical reads + Physical writes) * Database Block Size in Bytes) / AWR Interval (seconds)
    • To convert to Megabytes per second (MB/sec), divide the result by (1024 * 1024).
    • To convert to Gigabytes per second (GB/sec), divide the result by (1024 * 1024 * 1024).

    Example: Using the above IOPS example, with a Database Block Size = 8192 bytes: Total Throughput (Bytes/sec) = (1,500,000 * 8192) / 3600 = 12,288,000,000 / 3600 ≈ 3,413,333 Bytes/sec Total Throughput (MB/sec) = 3,413,333 / (1024 * 1024) ≈ 3.25 MB/sec

Using "I/O Stats" Section

The "I/O Stats" section, particularly the Av Rd(ms) (Average Read time in milliseconds), is an indicator of I/O latency, not directly IOPS or throughput.

  • Av Rd(ms): This metric tells you how quickly your storage subsystem is responding to read requests.
    • A value consistently above 10ms (as you noted) indicates a potential I/O bottleneck, suggesting that your storage system might be struggling to keep up with the demand, which would directly impact your achievable IOPS and throughput. While it doesn't give you the raw numbers, it's a critical health check for your I/O subsystem.


Monday, July 16, 2012

Statistics Lock in Oracle10g

Oracle10g has one of the useful feature that we can lock the table statistics. When statistics on a table are locked, all the statistics depending on the table, including table statistics, column statistics, histograms and statistics on all dependent indexes, are considered to be locked.


We can use this feature in the following circumstances...

1. There are tables where you want to setup gathering statistics manually. You can stop gathering statistics during the regular schedule by locking the statistics.

2. Some cases, Queries works fine with old statistics. You can avoid gathering statistics at this situation.

3. Some time, tables are bigger and automatic gathering statistics might fail silently. In this scenario, we might need to lock the table and collect the statistics seperately. Refer these links Post1, Post2,Post3

4. Sometime, gathering statistics, creating histograms takes very long time on bigger table and we can avoid such a bigger table while collecting statistics for all the tables in schema or DB level.

5. For some reason, if we want to use any specific parameter to gather statistics on particular table, then we can use this option to lock the statistics and gather statistics in different time.




SQL> execute dbms_stats.lock_table_stats('SCOTT','EMP');
PL/SQL procedure successfully completed.
SQL> execute dbms_stats.lock_schema_stats('SCOTT');
PL/SQL procedure successfully completed.


Tuesday, May 29, 2012

Top 5 Wait events in AWR

Common Oracle AWR Wait Events Explained

This document provides an overview of frequently observed wait events in Oracle Automatic Workload Repository (AWR) reports, categorized by their primary area of impact. Understanding these wait events is crucial for diagnosing and resolving performance bottlenecks in an Oracle database.

DB FILE Type Waits – Physical I/O

These events indicate waits related to physical I/O operations from datafiles.

  1. DB File Sequential Reads

    • Description: The user process is reading buffers into the SGA buffer cache and is waiting for a physical I/O call to return. Typically a single-block read.

    • Common Causes: Memory starvation (insufficient buffer cache), non-selective indexes, high concurrency on specific blocks.

  2. DB File Scattered Reads

    • Description: Similar to db file sequential reads, but the session is reading multiple data blocks (e.g., from a full table scan) and scattering them into different, non-contiguous buffers in the SGA.

    • Common Causes: Full table scans, insufficient indexing, large sorting operations.

  3. Direct Path Writes

    • Description: Occurs when a process is writing buffers directly from the session's Program Global Area (PGA) to datafiles, bypassing the SGA buffer cache. The process waits for the write call to complete.

    • Common Causes: Direct-path INSERT operations (e.g., INSERT /*+ APPEND */), data loads (e.g., SQL*Loader direct path), parallel DML.

  4. Direct Path Reads

    • Description: An I/O operation that reads data directly into the session's PGA instead of the SGA.

    • Common Causes: Parallel query execution (parallel slaves retrieving data), sorting to disk, hash joins spilling to disk, temporary tablespace activity.

  5. DB File Parallel Writes

    • Description: This wait event is associated with the Database Writer (DBWR) process. DBWR compiles a set of dirty blocks, hands the batch over to the OS for writing to datafiles, and waits for the I/O to complete.

    • Common Causes: High database activity generating many dirty blocks, backup operations, partitioned table usage (where DBWR writes blocks for multiple partitions in parallel).

  6. DB File Parallel Reads

    • Description: Occurs during database recovery, where blocks that need to be changed are read in parallel. Can also happen during buffer prefetching as an optimization.

    • Common Causes: Instance recovery, crash recovery, certain optimization paths (e.g., multi-block reads for specific operations).

  7. DB File Single Write

    • Description: Used to wait for the writing of single blocks, typically file headers.

    • Common Causes: File header writes (e.g., during checkpointing, file resizing), excessive number of data files.

  8. Direct Path Read Temp

    • Description: Reading data directly from temporary files into the PGA.

    • Common Causes: Extensive temporary segment activity due to large sorts, hash joins, temporary table usage, or bitmap operations that spill to disk.

  9. Direct Path Write Temp

    • Description: Writing data directly to temporary files from the PGA.

    • Common Causes: Similar to Direct Path Read Temp, indicating heavy use of temporary tablespace for sorts, hashes, or temporary tables.

BUFFER Type Waits – Logical I/O

These events relate to contention or issues within the SGA buffer cache.

  1. Free Buffer Waits

    • Description: Occurs when a session needs a free buffer in the SGA but none are immediately available. Oracle waits for a buffer to become available.

    • Common Causes:

      • DBWR not writing dirty buffers fast enough (e.g., slow I/O, undersized DB_WRITER_PROCESSES).

      • A file was read-only and is now read-write, requiring invalidation of existing buffers.

      • Need for a buffer in CR (Consistent Read) or recovery modes.

      • Insufficient DB_CACHE_SIZE.

  2. Buffer Busy Wait

    • Description: A session cannot access a needed data block because it is currently being used or modified by another session.

    • Common Causes:

      • Hot blocks (frequently accessed blocks, e.g., index root blocks, segment header blocks).

      • Insufficient free lists for a table (pre-ASSM).

      • Too few rollback segments (pre-Automatic Undo Management).

      • High concurrency on specific data or index blocks.

  3. Latch Free Waits

    • Description: Latches are internal Oracle locking mechanisms that protect SGA data structures. This wait occurs if a session needs to acquire a latch that is currently held by another session.

    • Common Causes: High concurrency on shared memory structures (e.g., library cache latch, shared pool latch, cache buffers chains latch), inefficient SQL (e.g., excessive parsing).

Log Type Waits

These events are related to the redo log buffer and online redo log files.

  1. Log File Parallel Write

    • Description: The Log Writer (LGWR) process is writing the redo buffer to the online redo log files in parallel and waits for the I/O to complete.

    • Common Causes: Slow I/O subsystem for redo logs, insufficient redo log group members, large redo generation rates.

  2. Log Buffer Space

    • Description: A session waits for space to become available in the log buffer because redo information is being generated faster than LGWR can write it to the redo files.

    • Common Causes: Log buffer is too small (LOG_BUFFER), redo log files are on disks with I/O contention, very high transaction rates.

  3. Log File Switch (Archiving Needed)

    • Description: A log switch is pending, but the next online redo log file cannot be used because it has not yet been archived.

    • Common Causes: Archiver processes are slow or stopped, archive destination is full or slow, insufficient archiver processes (LOG_ARCHIVE_MAX_PROCESSES).

  4. Log File Switch (Checkpoint Incomplete)

    • Description: A log switch is pending, but the checkpoint for the next log file has not completed, preventing LGWR from wrapping into it.

    • Common Causes: Redo log files are sized too small, FAST_START_MTTR_TARGET is set too high, slow I/O for datafiles (impacting checkpoint completion).

  5. Log File Switch Completion

    • Description: Sessions are waiting for a log switch operation to fully complete.

    • Common Causes: Slow I/O for redo logs, issues with archiver processes, or slow checkpoint completion.

  6. Log File Sync

    • Description: When a user session commits, its redo information must be flushed to the redo logfile. The session waits for LGWR to write the log buffer to disk and then post the user session. The wait time includes both the write and the post.

    • Common Causes: Slow I/O to redo logs (most common), high commit rate, CPU contention affecting LGWR, network latency in RAC environments.

PX – Parallel Query

These events are related to operations performed by parallel execution processes.

  • Master Note Parallel Execution Wait Events (Doc ID 1097154.1): Refer to this Oracle Support document for detailed information on parallel execution wait events.

GC – Global Cache (RAC Related)

These events indicate contention or waits in Oracle Real Application Clusters (RAC) environments for accessing data blocks across instances.

  • gc current block request: Waiting for a current version of a data block from another instance.

  • gc cr block request: Waiting for a consistent read (CR) version of a data block from another instance.

  • gc current block 3-way: A more complex scenario for current block requests involving three instances.

  • gc current block busy: The requested current block is busy on the holding instance.

  • gc cr block grant 2-way: A simpler scenario for consistent read block requests.

Undo or Rollback Segment Related

These events are associated with undo segment management and rollback operations.

  • Undo Related Wait Events & Known Issues (Doc ID 1575701.1): Consult this Oracle Support document for comprehensive details on undo-related wait events and common issues.

By analyzing the top wait events in AWR reports and understanding their causes, DBAs can effectively pinpoint and address performance bottlenecks in Oracle databases.

Thursday, May 19, 2011

AWR snapshot interval change & baseline


@?/rdbms/admin/awrrpt.sql
Display a list of snapshots

set lines 100 pages 999
select snap_id
, snap_level
, to_char(begin_interval_time, 'dd/mm/yy hh24:mi:ss') begin
from dba_hist_snapshot
order by 1
/
Change the snapshot interval

col snap_interval format a30
col retention format a30
select snap_interval
, retention
from dba_hist_wr_control
/

changes it to 10 minutes
exec dbms_workload_repository.modify_snapshot_settings (interval => 10)


Change the retention period
changes it to 10 days


exec dbms_workload_repository.modify_snapshot_settings (retention => 10*24*60)


AWR BASELINE


Creating a baseline allowed a specified range of snapshots to be retained, regardless of the AWR retention policy


The main purpose of a baseline is to preserve typical runtime statistics in the AWR repository, allowing you to run the AWR snapshot reports on the preserved baseline snapshots at any time and compare them to recent snapshots contained in the AWR. This allows you to compare current performance to established baseline performance, which can assist in determining database performance problems.

Create a baseline
exec dbms_workload_repository.create_baseline (, ,'')
Remove a baseline
exec dbms_workload_repository.drop_baseline(''')


11G Enhancement

Time-expired baselines - start and end times.

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 specified number of days

The Moving Window Baseline

Uses the system_moving_window to incorporate adaptive thresholds, whereby the bases changes as does the typical workload.  The system_moving_window corresponds to the retention tine window for the existing baselines, and the total time span is controlled by the dbms_workload_repository.modify_baseline_window_size procedure that allows you to create adaptive threshold baselines for longer periods (like monthly workload cycles).

Tuesday, May 3, 2011

Poor performance reported by user

we should follow the below steps.


- Check alert log, for any errors
- Check for archive log destination/file system full
- Check for database locks
- Check server performance (CPU/IO)
- Check network performance
- Check if statistics is up to date
- If new SQL, then tune SQL (maybe take trace)
- Check if any parameters have been modified recently
- Check if any new updates/changes as been done from the Application team