Oracle Database Performance Tuning

Effective data collection and analysis is essential for identifying and correcting performance problems. This guide also describes performance best practices for creating an initial database and includes performance-related reference information. You will learn the tools to gather, monitor, diagnose problems and tune applications.

 

The Completion Level of Your Training.

0.00%

Start Here

Note From Author

How To Get The Most Out Of Your execution Plan

Firstly, if you are a member of Digital Marketer Lab, please bring questions about this Execution Plan (or any other marketing question) to the weekly Office Hours call. This call takes place every Thursday at 3 PM Eastern Time.

Or post questions in the Digital Marketer Engage Facebook Group.

Here's how to get the most out of the content in this Execution Plan,

Read the entire EP once - Read through this entire EP, watch any videos and download the resources. Don't execute on the steps until you have finished reading the entire EP. This will help you understand the progression of the steps and put them into context.

Complete the steps - This Execution Plan is a checklist. Each step builds upon the next. Complete each step in order.

Lastly, here's how to use the Execution Plan interface.

 

View the example Execution Plan below...

Next

How To Use Your Execution Plan

Here’s how this Execution Plan will work. It is divided into five parts. Each part helps you answer one of the Big 5 questions laid out above.

Section 1: Introduction - Start Here

Section 2: How To Identify Your Identify Your Database Requirements By Working With Your Users.

Section 3: How To Identify The Storage Requirements For Your Database

Section 4: How To Identify The Server On Which The Database Will be Hosted

Section 5: How To Create You Database Using DBCA

Section 6: How To Identify The Post Database Creation Steps

This Execution Plan will walk you through each of these five major sections and provide you with worksheets, tools and exercises to get you the answers you need.

 

Next

Download Worksheets

What Is Performance Tunning

Collecting and Maintaining Baselines

With regards to pro-active avoidance, there are 2 different types of 'baselines' you should collect.

  1. Systemwide 'performance' AWR Baselines recording the resource usage of the system running normallyIf your system is performing well, then this is a good time to record that information to form a baseline for comparison against in the event of any issue in the future. The automatic workload repository (AWR) allows you to capture baseline data and enables you to specify and preserve a pair or a range of snapshots as a baseline. The snapshots contained in a baseline are excluded from the automatic AWR purging process and are retained indefinitely. Reports can then be created from these baselines allowing you to compare them with current situations to identify differences. The details for creating such a baseline can be found here:
    Oracle Database Online Documentation 12c Release 1 (12.1)
    Database Administration
    Database 2 Day + Performance Tuning Guide
    Chapter 9 Resolving Performance Degradation Over Time
    http://docs.oracle.com/database/121/TDPPT/tdppt_degrade.htm#TDPPT089

    In addition to providing you with a comparison to a previous situation, baselines can provide a number of other benefits outlined in the Monitor for Potential Problems section below. There are more extensive suggestions to potential baselines you may wish to collect in the following article:

    Document 1477599.1 Best Practices: Proactive Data Collection for Performance Issues

    Use of the Automatic Workload Repository requires the Diagnostics Pack License. See:

    Document 1490798.1 AWR Reporting - Licensing Requirements Clarification

Next

SQL Plan Baselines to maintain plan stability and allow the restoration of a recorded plan in the event of a change

With any change to a system, you want to create a situation where you can quickly and easily restore the previous performance in the event of change. The best way to ensure that stability is to use SQL Plan Management (SPM) to ensure that critical operations use known good plans and perform the same before and after the change. For systems with relatively static data and usage profiles, support would recommend that you record SQL Plan Baselines for key application queries so as to fix their access paths avoiding unexpected change. If data volumes and usage profiles are variable, then such baselines can be useful to provide a stable fallback position, but you may need the optimizer to be able to change plans to reflect changing data distributions. For details see:

Document 1359841.1 Plan Stability Features (Including SPM) Start Point

https://blogs.oracle.com/optimizer/entry/sql_plan_management_part_1_of_4_creating_sql_plan_baselines

Oracle Database Online Documentation 12c Release 1 (12.1)
Database Administration
Database SQL Tuning Guide
Chapter 23 Managing SQL Plan Baselines
http://docs.oracle.com/database/121/TGSQL/tgsql_spm.htm#TGSQL94621

Note that for statistical changes, the database automatically retains the last 30 days worth of statistics, which can be restored in the event of a dramatic change. See:

Document 452011.1 Restoring table statistics in 10G onwards

Also Note that SPM is available as part of Oracle Database Enterprise Edition 11g, so no additional licenses are needed to use SQL Plan Management (SPM) or any of the procedures in the DBMS_SPM package. See:

Next

Upgrades

Upgrades can introduce significant changes in terms of software and hardware usage. Prior to any upgrade it makes good sense to ensure that provision for performance baselines are in place so that the system performs at least as well as the previous iteration. Additionally we recommend using Real Application Testing RAT to enable 'trial' testing on real workloads to ensure that the system will work as expected on transfer. Key articles in these areas are:

Document 1904820.1 Things to Consider Before Upgrading to Avoid Poor Performance, Wrong Results or SQL Plan Management (SPM) Issues (11.2.0.X and above)
Document1905086.1 Oracle Upgrade CompanionsDocument 562899.1 Using SQL Performance Analyzer to Test SQL Performance Impact of an Upgrade
Document 445116.1 Using Workload Capture and Replay
Document 456518.1 How to Use SQL Plan Management (SPM) - Plan Stability Worked Example

There is an example of the capabilities of this suite of tools in the following Oracle Open World Presentation entitled "Load Testing" which provides a Case Study of Capture / Replay. There is further explanation in the manuals:

Oracle Database Online Documentation 12c Release 1 (12.1)
Database Administration
Database Testing Guide
Chapter 1 Introduction to Oracle Database Testing
http://docs.oracle.com/database/121/RATUG/rat_intro.htm#RATUG101Chapter 7 Testing a Database Upgrade
http://docs.oracle.com/database/121/RATUG/spa_upgrade.htm#RATUG210
Performance improvement is an iterative process. Removing the first bottleneck (a
point where resource contention is highest) may not lead to performance
improvement immediately because another bottleneck might be revealed that has an
even greater performance impact on the system. Accurately diagnosing the
performance problem is the first step toward ensuring that your changes improve
performance.
Typically, performance problems result from a lack of throughput (the amount of
work that can be completed in a specified time), unacceptable user or job response
time (the time to complete a specified workload), or both. The problem might be
localized to specific application modules or it might span the system.
Before looking at database or operating system statistics, it is crucial to get feedback
from the system users and the people in charge of the application. This feedback
makes it easier to set performance goals. Improved performance can be measured in
terms of business goals rather than system statistics.
The Oracle performance method can be applied until performance goals are met or
deemed impractical. Because this process is iterative, some investigations may have
little impact on system performance. It takes time and experience to accurately
pinpoint critical bottlenecks quickly. Automatic Database Diagnostic Monitor
(ADDM) implements the Oracle performance method and analyzes statistics to
provide automatic diagnosis of major performance problems. Because ADDM can
significantly shorten the time required to improve the performance of a system, it is
the method used in this guide.

Next

Performance Issues

Gather Information

Problem Description

The first step in troubleshooting any performance issue is to clearly describe the issue.  Proceed to create an electronic file using any text editor, and document in detail the symptoms of the performance issue.  Keep in mind that you may want to use your electronic document if you later need to report the performance issue to Oracle for further analysis.  Document and differentiate factual information and user perceptions.  You may want to use the templates provided in the related documents section at the bottom of this note, to start gathering your information in a well organized manner.  You will first need to categorize your issue however.

Your detailed description should include, at least, the following information:

  1. What is the application group or module affected by your performance issue?  Examples: 'AP', or 'ONT and QP', or 'all manufacturing modules', 'just this Form', 'this list of transactions', etc.
  2. Instance or instances in which it can be observed.  Does it happen in Production?  Development?  Test?  All of them?  If it does not happen in all your environments, document what is different among them.  Try to determine if the difference among them can be isolated.  This may narrow the problem to a very specific area.
  3. Determine if the poor performance is equally observed when the system load is either low or high.  What if there is only one active user?  Is it equally slow?  Document if the poor performance keeps any relation to the system load, or not at all.
  4. Is the performance issue affecting one user only?  If no, document how many users are affected.
  5. If your application is used on multiple locations:  Does the location seem to affect the performance?  Do all users in all locations experience the same performance?  Can you state that poor performance has nothing to do with the user location?
  6. Can you reproduce the issue systematically?  Document how can the issue be systematically reproduced.  If you can't, document why not.  In any case, try to reproduce it systematically and document your findings.
  7. Do you have a workaround available?  What is it?
  8. When was the last time you could complete the process or transaction without experiencing poor performance?  Document what has changed since then.
  9. Determine if any software has been installed or upgraded in your server or instance since the problem started.  Include any RDBMS, Applications or 3rd party software in your analysis.
  10. Document any patches applied recently which could have affected your performance.  Include Operating System patches as well as patches from RDBMS or Apps.

Next

Isolate The Issue

ategories of common Tuning Issues

The detailed description of the performance issue should be sufficient to categorize it into one of the following 3 high-level areas.  Determine which category best describe your issue.  Review and document the Certify and Statistics Gathering sections below.  Then proceed to the tuning section corresponding to the high-level category.

  1. Transaction Tuning:  One specific transaction denotes poor performance.  It may be a Form, a Concurrent Program, or a specific operation within a Form (i.e. the click of a button, saving one row, displaying a list of values, etc.).  If your issue affects more than one transaction but just a few of them, it can still be classified as transaction tuning.  You may want to diagnose and document each issue separately.  Transaction Tuning usually translates into SQL Tuning.
  2. Back-End Tuning:  Overall poor performance is observed, or several transactions perform poorly; usually from more than one application group.  This category typically includes issues where system load has an impact in the overall performance, or it degraded after a major software upgrade.  Back-End Tuning usually translates into DB Server Tuning and/or OS Tuning.
  3. Tech-Stack Tuning:  Navigation between Forms or within Forms performs poorly affecting several Forms.  Opening a Form takes an unusual long time.  Different performance is observed from one location to another.  Some users are affected but no others.  Back-End has been reviewed and ruled out.  Tech-Stack Tuning is also known as Middle-Tier Tuning.

ertify

Use Certify within My Oracle Support to verify that your specific combination of Platform/Operating System, RDBMS Release and Oracle Applications Release, is fully certified.  On My Oracle Support main 'Certify - Platform Selection page' select your back-end server platform.  On the 'Product Group selection page', select 'E-Business Suite'.  Review the General Notes.  Select your combination of Apps Release (Oracle E-Business Suite Version), RDBMS Release (Oracle Server Version), and  'Certified combinations only'.  Locate your OS Release in the 'Database Tiers Certifications page' and review the hotlinks under 'Additional Info' and 'Issues' columns.  If there are 'Interoperability Notes' for your implementation, please review them.  Under the 'Issues' hot link you may encounter a list of known Bugs and Issues affecting your particular combination of OS/RDBMS/Apps Releases.  Please review the list of known Bugs and Issues carefully and document in your electronic file:

  1. List of known Bugs and Issues according to your OS/RDBMS/Apps Releases that may relate to your performance issue.
  2. Which of the related Bugs have been applied?
  3. Which ones have not yet been applied?  Explain why.

Note: Be aware that the list of known Bugs and Issues changes periodically.  Therefore, it is a good practice to review this list of known Bugs and Issues affecting your very specific Product combination every time you need to troubleshoot a new performance issue.

Next

Statistics Gathering

Statistics Gathering

Oracle Applications 11i and later uses the Cost Based Optimizer to generate execution plans for SQL statements.  In order to generate optimal execution plans, the CBO requires updated statistics regarding your data volume and distribution.  Statistics used by the CBO are stored in the data dictionary and can be queried using several available views.  Oracle Applications 10.7 and 11.0 mostly use the Rule Base Optimizer.  Still a handful of SQL statements from these earlier releases of Oracle Apps invoke the CBO by using embedded CBO Hints.  Therefore, all Oracle Applications Releases must have current CBO statistics available for pertinent schema objects belonging to the installed Apps modules.

There are several tools available to gather CBO statistics.  All of them allow to gather stats either by reading all the data on the table or index (compute method), or just a sample of the data (estimate method).  For Oracle Applications there is no need to gather exact stats using the 'compute statistics' method.  When gathering CBO stats you should generally use the 'estimate' method with a sample size of 10%.

Regarding the frequency of the CBO statistics gathering, the right schedule really depends on your data, based on how often it changes.  Typically, gathering CBO statistics at least once per month, with an estimated sample of 10%, on all pertinent schema objects belonging to Apps installed modules, has proved to be sufficient for most clients.  Some clients prefer to gather CBO statistics weekly, during a quiet system load interval.  Other clients prefer to optimize the gathering of CBO stats, by scheduling the frequency and estimate sample percentage according to the current size of their tables.

In any case, if you suspect that your CBO stats may be affecting your process performing poorly, a more aggressive CBO stats gathering is usually worth attempting.  Measure the performance again if you refreshed your CBO statistics for one or more schema objects accessed by your process performing poorly.  Be aware that prior measurements, Traces, Trace Analyzer and TKPROF files, may become invalid.

Also keep in mind that when an object has its CBO stats refreshed, all references to that object in the shared pool or library cache become invalid, requiring a new hard parse for each SQL statement referencing the object.  Therefore, in order to avoid temporarily affecting the performance of all active users in a production environment, you must refrain from gathering CBO stats during times of intensive system usage.  Always schedule the CBO stats gathering during periods of time with very low system load, and when the number of active users is at its minimum.  In other words: DO NOT GATHER CBO STATS WHEN NUMBER OF ACTIVE USERS IS MEDIUM TO HIGH.

Note: Try gathering stats at least once per month and with an estimate sample size of 10% for all your schema objects belonging to Apps.  If you can afford gathering stats every week, do so (it is preferred, but not required).  Always gather stats with no active users, or when system load is very low.

Regarding your CBO statistics gathering, document in your electronic file:

  1. Frequency of the CBO stats gathering on the pertinent schema objects accessed by your process performing poorly (monthly, weekly, daily, etc.)
  2. Method used (per table, per schema, all schemas, etc.)
  3. Tool used (coe_stats.sql, FND_STATS, DBMS_STATS, ANALYZE command, DBMS_UTILITY) NOTE: While ANALYZE and the DBMS_UTILITY which can call the ANALYZE command was used in past RDBMS releases before DBMS_STATs was first created, the actual statistics collected are different. For this reason we strongly recommend not using the older ANALYZE command or DBMS_UTIL which calls the ANALYZE for collecting statistics. The ANALYZE is a subset and would not provide the statistics that the optimizer needs for optimal functionality. ANALYZE is still used for collecting information on CHAINED ROWS so should not be considered completely defunct, just not a good choice for statistics collection.
  4. Estimate sample size percentage used (or if compute method, specify so)
  5. When was the last time the CBO stats where gathered for the affected schema objects?

Note: Using 8i, never gather CBO statistics for data dictionary objects owned by user 'SYS'.  The only exception is the table DUAL owned by SYS, for which FND_STATS gathers stats when executed for one or all schemas.

Statistics Gathering in 11i/R12

From all the tools available, Oracle Apps 11i mandates the exclusive use of the FND_STATS package to gather the CBO stats.  This package can be invoked either from a seeded Concurrent Program, or directly from SQL*Plus.  When invoked using the seeded Concurrent Programs, use only the 'Gather Schema Statistics' or the 'Gather Table Statistics'.

When using the 'Gather Schema Statistics' concurrent program, pass only the schema name parameter.  Let the other parameters default automatically.  The schema name passed can be a specific schema or 'ALL' if you prefer to gather CBO stats for the pertinent objects belonging to all Apps installed modules, using the estimate method with a sample size of 10% (default).  Be aware this process may take several hours to complete. Stats collection really needs to be estimated at 25% - 30%, particulary for large tables, to give CBO enough information to derive good execution plan.

When using the 'Gather Table Statistics' concurrent program, pass only the owner of the table (schema name) and the table name.  Let all other parameters default automatically, except when the table has been partitioned.  When gathering CBO stats for a partitioned table, pass 'PARTITION' in the Granularity parameter, otherwise FND_STATS will calculate global stats (plus partition stats) instead of rolling up the global stats from the partitions.  If this happens, you may have to delete the global stats (with cascade equals 'false') and gather the stats for one partition to once again enable the automatic rolling up into the global stats.

To execute the corresponding FND_STATS procedures from SQL*Plus to gather CBO stats for one or all schemas, or for a particular table, use the following examples:

# sqlplus apps/<apps_pwd>
SQL> exec fnd_stats.gather_schema_statistics('MRP');		    <- One schema
SQL> exec fnd_stats.gather_schema_statistics('ALL');		    <- All schemas
SQL> exec fnd_stats.gather_table_stats('MRP','MRP_FORECAST_DATES'); <- One table
SQL> begin 							    <- Partitioned table
  2      fnd_stats.gather_table_stats(ownname     => 'APPLSYS',
  3                                   tabname     => 'WF_ITEM_ACTIVITY_STATUSES',
  4                                   granularity => 'PARTITION');
  5  end;
  6  /

There is also a public script available that may help you automate the CBO statistics gathering.  This is the coe_stats.sql script, included and documented in Note:156968.1.  Thecoe_stats.sql script uses the FND_STATS package and schedules the CBO stats gathering according to table sizes.  It uses the estimate method with a variable sample size based also on table size.  It gathers stats more accurately for small tables (larger sample percent) and uses a smaller sample size percent for larger tables.  The main benefit of this script is that it has the potential to reduce the overall CBO stats gathering execution time without sacrificing stats accuracy.  If your total CBO stats gathering time for all pertinent schema objects is acceptable using plain FND_STATS procedures, then there is no need to explore using the coe_stats.sql script.  In the other hand, if yours is a 24x7 operation and you need to minimize the window to gather CBO stats, consider using the coe_stats.sql script.

If you are not confident of the current status of your overall CBO stats in your Apps 11i instance, download and execute the bde_last_analyzed.sql script from Note:163208.1.  This script reports the current status of the CBO stats for all schema objects owned by Apps installed modules.  It summarizes by schema name (application group) and by date, where at least one schema object got its stats refreshed.  It warns you of possible erroneous stats gathering on schema objects owned by SYS.  It also reports and warns on partitioned tables which global and partition level stats are out of sync.  You can execute this bde_last_analyzed.sql script at any time.  By reviewing the summary page at the beginning of the report produced, you can quickly get the status of the CBO stats on your instance.

Statistics Gathering in 11.0 and 10.7

For earlier Releases of Oracle Applications you can use any tool available to gather CBO statistics.  The recommended tool is the DBMS_STATS package, documented in the corresponding 'Supplied PL/SQL Packages Reference' manual for your RDBMS Release.  The FND_STATS package did not exist on 11.0 or 10.7, but it is available through back-port patch for Bug 1268797.  If you don't have to have FND_STATS installed on your 11.0 or 10.7 instance, use DBMS_STATS instead.

Besides the DBMS_STATS package, the ANALYZE command docume

Next

Using the TNSPING Utility to Test Connectivity from the Client

The TNSPING utility determines whether the listener for a service on an Oracle Net
network can be reached successfully.

If you can connect successfully from a client to a server (or a server to another server)
using the TNSPING utility, then it displays an estimate of the round trip time (in
milliseconds) it takes to reach the Oracle Net service.

If it fails, then it displays a message describing the error that occurred. This enables
you to see the network error that is occurring without the overhead of a database
connection.

syntax of command:

tnsping {net service alias}

use the Oracle Net utility tnsping to validate the Net Service Alias is properly defined in your client's TNSNAMES.ORA (or other Naming Service):

The output will is displayed below

cfdbsnd01:/home/oracle>tnsping db1tst

TNS Ping Utility for Linux: Version 12.1.0.1.0 - Production on 22-FEB-2016 14:16:45

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:
/apps/oracle/product/12.1.1/network/admin/sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = hostname.domain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = db1tst.domain)))
OK (10 msec)

If this Step fails, make sure you are using the correct TNSNAMES.ORA file.  If you are not using the correct TNSNAMES.ORA file, validate that the TNS_ADMIN variable is properly set (or not set). Also, make sure you have used the same hostname / IP address  as the ADDRESS for the Net Service Alias in the TNSNAMES.ORA file.

 

Note: net_service_name must exist in tnsnames.ora file or the name service in use, such as
db1.domain.

If the net service name specified is a database name, then TNSPING attempts to
contact the corresponding listener. It does not actually determine whether the database
is running.

Check the output for an Invalid Net Service Name with tnsping below :

hostname:/home/oracle>tnsping db2tst

TNS Ping Utility for Linux: Version 12.1.0.1.0 - Production on 22-FEB-2016 15:00:04

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:
/apps/oracle/product/12.1.1/network/admin/sqlnet.ora

TNS-03505: Failed to resolve name

Checking the output for a valid Net Service Name but No Listener with TNSPING:

hostname:/home/oracle>tnsping db2tst

TNS Ping Utility for Linux: Version 12.1.0.1.0 - Production on 22-FEB-2016 15:00:04

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = hostname.domain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = db1tst.domain)))

TNS-12541: TNS:no listener

Next

Transaction Tuning

Transaction Tuning

Once you have validated Certify and Statistics Gathering, proceed with this next section if your performance issue qualifies as this high-level tuning category.

Data Gathering (files and information)

Gather the indicated files and document in your electronic file the following information:

  1. How long does it take for the process to complete (specify hours/mins/secs)?
  2. How long did it previously take (before having the performance issue)?
  3. What is the expected performance for this process (specify hours/mins/secs)?
  4. If you have any customization related to this process, document it in your electronic file, in full detail.
  5. Determine module information requested below, for specific Form, Report, Package, Main Pro*C, etc.
    1. Module internal name (short name):  For a Form, use the menu to find the short name and version.  For a concurrent program, use the 'Concurrent Program Define' Form from the SYSADMIN responsibility to find short and long name.
    2. Module title (descriptive or long name):  For a Form, use the navigation path or the title displayed in the Form.
    3. Module version:  For a concurrent program in UNIX, navigate to directory (i.e. $AP_TOP/reports or $PO_TOP/bin) and use strings command:
    4. # strings -a <module> | grep -i '$Header'
    5. Latest version available according to My Oracle Support:  Use 'Patches' option on My Oracle Support main menu.
    6. Current patchset level for application group owning the affected module:  Ask your System Administrator or DBA.
    7. Latest patchset available according to My Oracle Support for the application group:  Use 'Patches' option on My Oracle Support main menu.

    Note:  If you find that you have an old version of the module, be aware that quite often a newer version of it may fix a known performance issue.  This may be true even if you don't find a direct hit in the list of issues fixed between your version and the latest version.  If possible, upgrade the affected module to the latest version available.  Also be aware that in many cases, due to intricate file dependencies, Oracle Development requires you have the latest version of the module applied, in order to troubleshoot a new issue.

  6. When the affected module is a Pro*C program, generate a text file with the list of modules (components) linked to the Pro*C program.  Use this or similar command:

# strings -a <Pro*C module> | grep -i '$Header' > MODULES.TXT

  1. On a multi-org environment, determine the ORG_ID used while monitoring the performance of the affected module.  This ORG_ID or Operating Unit is usually required to later execute an isolated SQL statement performing poorly, using SQL*Plus.  If you don't know the ORG_ID, use this command to produce a list of Operating Units, and determine the ORG_ID from the list:

SQL> select organization_id org_id, name from hr_operating_units;

  1. If your transaction performing poorly is a Concurrent Program, determine if your application group provides a Profile Option to turn ON and OFF some sort of debugging information, if it does, execute your Concurrent Process with debugging information turned ON and recover the Log file generated (this is in addition to the Trace file requested below).  Review your Log file.
  2. If yours is a Concurrent Program, document in your electronic file all the parameters requested by the execution of your process, indicating which values you passed, including which values were left NULL, or automatically defaulted.  Include all parameter names and values.  Keep in mind that the number, name, or order of the parameters may change from one version of the module to the next.
  3. For online transactions, document in your electronic file, in full detail, the complete navigation path, as well as step-by-step instructions to reproduce your issue.  If the transaction performing poorly is a query, document which parameters are passed to the query, as well as, which parameters are NULL, or automatically defaulted.  Be as specific as possible.
  4. If your transaction has been running for several hours or days, and you did not turn SQL Trace at the beginning of it, you can still capture the expensive SQL statements for further analysis.  Download, familiarize yourself, and execute the bde_session.sql script (Note:169630.1) and/or the SQLAREAT.SQL script (Note:238684.1 for 8.1 and Note:163209.1 for 8.0).  These scripts can be executed even a few minutes after the process has been killed.  The former requires the session_id, the latter has no parameters.
  5. All Apps Transaction Tuning issues require, at the very least, one raw SQL Trace.  If tracing a Form, turn Trace ON using the menu (Help → Diagnostics → Trace → Trace with Binds and Waits), and set the trace size to unlimited (Help → Diagnostics → Trace → Unlimited Trace File Size).  If tracing a Concurrent Program, use whatever method is available for your Apps Release (usually a check box at the Concurrent Program Define Form).  Under some specific conditions, Oracle Development requires a raw SQL Trace generated with Event 10046 (Trace with Binds and Waits).  If you can provide that special Trace up front, it helps to expedite the whole process.  Once you generate the raw SQL Trace (standard for Concurrent Programs, or with Event 10046 for any Form), compress it and have it available in case you have to provide it to Oracle Support.  This file is usually large.  Traces are found in the 'user_dump_dest' directory.

Note: It is common to iterate in this step because the raw SQL Trace generated does not have statistics turned ON, or because it was truncated due to its size.  To avoid this unnecessary loop in the process, verify these two init.ora parameters settings: 'timed_statistics' set to TRUE, and 'max_dump_file_size' set to UNLIMITED.  On the other hand, if your process 'hangs' and you killed it, be aware that even an incomplete raw SQL Trace may be useful to pin-point the SQL Statement(s) performing poorly.

  1. If you created a Trace with Binds and Waits, use the Trace Analyzer tool (Note:224270.1) to analyze your Trace.  This tool, when used on the same db instance where the Trace was generated, produces a comprehensive report that can be used to identify expensive SQL in terms of service and/or wait times.
  2.      # sqlplus apps/<apps_pwd> SQL> START TRCANLZR.sql UDUMP prod_ora_9105.trc;
  3. For all Apps Transaction Tuning issues, generate and be ready to provide to Oracle Support, one TKPROF file generated with the Explain Plan option.  TKPROF reports must be generated on the same db instance where the raw SQL Trace was created.  If you had to kill the process because it never completed, don't destroy the raw SQL Trace generated, proceed to create a TKPROF from it as well.  To generate one TKPROF, unsorted, and with Explain Plan, use this syntax: # tkprof 12345.trc 12345.prf explain=apps/<apps_pwd>  Note: Read the TKPROF and determine if it corresponds to the transaction performing poorly.  Providing to Oracle a TKPROF which does not correspond to the problematic transaction is very common, and it causes unnecessary delays in the resolution of performance issues.  In the TKPROF, you should recognize table names and possibly the transaction.  The total TKPROF Elapsed Time should be close to the 'user' Elapsed Time.

Next

Researching

At this point, you can pursue your performance issue with Oracle Support.  Provide as many of the requested files as possible.  Or, you may opt to participate more pro-actively in the research phase by performing the following steps before contacting Oracle Support:

  1. Use the Trace Analyzer and/or TKPROF file(s) to find the expensive SQL statements.  In most cases you want to focus your attention in those SQL statements causing more than 5 to 20% of the overall logical reads or elapsed time totals (summarized in the first page of the Trace Analyzer report, or the last page of the TKPROF).  If you are using the Trace Analyzer, you may also want to review SQL statements with large non-idle wait times.
  2. Document in your electronic file the most expensive SQL statement(s) found.  Include from the Trace Analyzer or TKPROF the block showing the SQL statement; the block showing the parse, execute and fetch statistics for the SQL statement; and the block that shows the Explain Plan for it.
  3. For each expensive SQL statement (in most cases it is just one), search on My Oracle Support for known issues.  Review the SQL statement and grab from it significant and not-so-common columns to make your search criteria as selective as possible.  Take pieces from the FROM clause and the WHERE clause.  Be aware that you may be experiencing a performance issue already reported by another customer and for which either a fix or a workaround exists.  While doing your search on My Oracle Support, you may want to use also the short name of the module (Form or Concurrent Program).
  4. Document in your electronic file all My Oracle Support hits regarding your poorly performing SQL statement(s).  Even if they seem to be unrelated or never fixed.

Initial Troubleshooting

If you decide to be pro-active in the initial troubleshooting phase, perform the following steps for each SQL statement identified from the Trace Analyzer or TKPROF as expensive (according to the number of logical reads performed, or according to the elapsed time for its complete execution, or the non-idle wait time).  Start with the very most expensive SQL statement that is not a BEGIN procedure or data dictionary recursive SQL.  In other words, focus only on DML commands (SELECT, UPDATE, INSERT or DELETE) accessing Apps tables and indexes.

Note: If the most expensive statement in your Trace Analyzer or TKPROF is NOT a DML command (SELECT, UPDATE, INSERT or DELETE), in other words, it is a PL/SQL library call, use the profiler.sql script from Note:243755.1.

  1. Create a flat file (text type) pasting the DML command (SQL statement) directly from the Trace Analyzer or TKPROF report.  Leave one and only one blank line at the end of the SQL statement.  Do not leave the statement without a single blank line at the end, and do not include more than one blank line at the end.  This is required by the SQLTXPLAIN.SQL or coe_xplain_xx.sql scripts.  Create your first flat file with the name of sql1.txt, the second with sql2.txt and so on.  The SQLTXPLAIN.SQL and coe_xplain_xx.sql scripts can handle any file name, but the standard is sql<n>.txt.  Bind variables (those with colons, i.e. ':b1',':2') should be left intact.  And you should not have a semicolon ';' at the end of your SQL statement.
  2. For RDBMS Release 8.1 or later, download script SQLTXPLAIN.SQL from Note:215187.1.  For 8.0 download coe_xplain_80.sql from Note:156959.1.  And for 7.3 downloadcoe_xplain_73.sql from Note:156960.1.  Read the downloaded version of the script and familiarize yourself with it.
  3. Place your SQLTXPLAIN.SQL set of files or your coe_xplain_xx.sql script and your sql<n>.txt file(s) into a dedicated directory.
  4. Execute SQLTXPLAIN.SQL or coe_xplain_xx.sql script from SQL*Plus connecting as apps/apps_pwd, passing as the inline parameter the name of the file containing your SQL statement sql<n>.txt as indicated by the instructions on the corresponding script (see commands below).  The SQLTXPLAIN.SQL or coe_xplain_xx.sql script will not execute your SQL statement included into sql<n>.txt.  They just parse your SQL statement and proceed to explode it into pieces for a detailed analysis.SQL> start coe_xplain_xx.sql sql<n>.txt
  5. SQL> start SQLTXPLAIN.SQL sql<n>.txt
  6. If you need to provide to Oracle Support the output of the SQLTXPLAIN.SQL or coe_xplain_xx.sql scripts, compress and send the whole directory with all spool files within it.
  7. From the Trace Analyzer or TKPROF, and from the spool file created by the SQLTXPLAIN.SQL or coe_xplain_xx.sql script, determine and compare the Optimizer used.  It should be consistent.  Document in your electronic file which Optimizer is being used: Rule Based - RBO or Cost Based - CBO.
  8. If using CBO, good statistics of the schema objects accessed are crucial to generate an optimal execution plan.  Locate in your spool file the column 'Last Analyzed'.  This column tells you when you last gathered stats for each table accessed by your SQL statement.  (You can do the same to review all indexes).  Look also at the column that reads 'Delta Percent' to determine gap between actual number of rows in your tables (dynamically calculated with COUNT function) and the number of rows recorded in your data dictionary as part of the CBO stats for your tables accessed by your SQL statement.  If your stats for the schema objects accessed by your SQL statement are more than one month old, or the gap reported under the 'delta percent' column is more then 10%, you need to gather fresh stats for your affected schema objects.
  9. Only for CBO: If you determine that some or all the schema objects accessed by your SQL statement require refreshed stats, you must use the appropriate tool to gather stats according to your Apps Release.  If your Apps Release is 11i, you may want to use the SQLTGSTATS.SQL script included in the SQLT.zip file.
  10. Only for CBO: If you had to refresh stats, execute the SQLTXPLAIN.SQL or coe_xplain_xx.sql script again to produce a new Explain Plan.  If the Explain Plan changed, measure again the performance of your original transaction, as it may have changed as well.
  11. If you are using CBO, are on 8.1 or later, and have only identified one expensive SQL statement, there are two files that you want to recover and have available for Oracle Support.  Be aware that second file is Binary, therefore you must copy across servers as such.
    1. Find in 'user_dump_dest' directory a raw SQL Trace generated by the SQLTXPLAIN.SQL script automatically.  This raw SQL Trace file is completely unrelated to the first raw SQL Trace file you generated when executing your original transaction.  If SQLTXPLAIN.SQL was executed using SQL*Plus on the db server, the raw SQL Trace generated by it may had been already copied into the same dedicated directory from which the script was executed.
    2. Generate Binary file SQLT.dmp with your CBO statistics for affected objects, by executing Export command (exp) as per INSTRUCTIONS.TXT included in SQLT.zip.  Use command below.  Execute export using ORACLE_HOME 8.0.6.# exp apps/<apps_pwd> file=SQLT tables='SQLT$STATTAB'
  12. If you have a vanilla instance, or one in which the same transaction performs fine, follow the same steps to reproduce the Explain Plan, and compare them to verify that you can produce the same Explain Plan in both instances.  If not, focus first on indexes.  If you find index discrepancies among instances, solve such discrepancies.
  13. If you are using RBO and see in your Explain Plan that a custom index is being accessed, drop the custom index and measure the performance again.  Be aware that once you drop an index being accessed according to the Explain Plan, all prior measurements and files become invalid.  The Explain Plan will change, as well as the performance.
  14. If on an 11i instance you notice that your SQL statement makes references to Apps Views, find corresponding view definitions in the spool file created by the SQLTXPLAIN.SQL script.  You may optionally execute the coe_view.sql to generate scripts which can be used later to clone your views from one instance into another.  Be aware there may exist several versions of the same view depending on the version of the corresponding ODF file used to create the view.  You can use the syntax of the command below to search from the corresponding APPL_TOP for the specific ODF file that creates a view.  Once you know the file and find its version, you can search on My Oracle Support for newer versions: # find . -type f -exec grep -i "CZ_COMPONENT_SELECTIONS_V" {} \; -print
  15. If on an 11i instance, you may want to ensure all required and recommended init.ora parameters for 11i are set correctly.  Since you already have at least one SQLTXPLAIN.SQL orcoe_xplain_xx.sql report, near the end of them you will find a list of init.ora parameters affecting the behavior of the CBO.  The init.ora parameters required for your Apps Release are clearly identified.  If necessary, fix any parameter showing an incorrect setting, and repeat your test.

Apps 11i init.ora parameters

Development has provided an official list under Note:216205.1.

You may optionally download the bde_chk_cbo.sql script from Note:174605.1.  This script allows to quickly validate all database initialization parameters according to Note:216205.1.  This script includes which EVENTs must be set or unset for Oracle Apps 11i as well.

Next

Advanced Troubleshooting

This phase requires special skills, and at this point most performance issues are raised to Oracle Support.  If you are proficient in SQL*Plus and you understand the Explain Plan, you may want to review this section; otherwise collect the requested files and provide them to Oracle Support.

Fully read the output of the SQLTXPLAIN.SQL or coe_xplain_xx.sql script and make sense of the Explain Plan and all related information.  Familiarize yourself with this report and make a sanity check on its contents.

To proceed with this phase, you need to prepare a tuning environment.  This tuning environment can be located on the same instance on which the performance issue is observed, or it can be on a different instance.  If the issue is observed in a Production instance, try to set the tuning environment on the Test or Development instances.  Tune on the Production instance only when you have failed to reproduce the issue on a non-production environment.  Reproducing an issue does not necessarily mean reproducing its performance.  In most cases it is sufficient to reproduce the same 'bad' Explain Plan, rather than the slow access itself.

In general, a good tuning environment is one in which you can perform the following two independent activities at will.  You may end up with two tuning environments, one for each activity.

  1. Reproduce the exact same Explain Plan from original version of SQL statement.
  2. Execute the expensive SQL statement in its original version and on several different 'modified' versions (hopefully improved).

Reproducing the exact same Explain Plan on a different instance usually represents a significant challenge, as the CBO decides the plan based on: CBO statistics, init.ora parameters, schema object attributes, RDBMS Release, and in a very few cases, in the Platform used.  The latter is particularly true when hitting a platform specific OS or RDBMS Bug.  With RBO, reproducing the same explain plan is much easier, since it depends mostly on the schema objects defined and accessed.  Therefore, this advanced troubleshooting phase relates mostly to issues regarding the CBO.

The focus of the tuning effort is usually in or around the Explain Plan Operation with the largest number of rows, according to the Explain Plan from the Trace Analyzer or TKPROF report.  If the column 'Rows' on the Explain Plan from the Trace Analyzer or TKPROF report shows all zeroes (meaning zeroes for all Operations), then it is almost indispensable to isolate the SQL statement, identify, define and assign the values of the bind variables, and execute from SQL*Plus with SQL Trace enabled.  Then create a new Trace Analyzer or TKPROF from new raw SQL Trace.  The new Trace Analyzer or TKPROF will have the Rows column of the Explain Plan populated.  This relates to how SQL*Plus handles cursors compared to other tools.  The cursor must be closed in order to get the number of rows column in the Explain Plan, and SQL*Plus keeps open one cursor at a time, forcing the closure of the prior cursor.

To reproduce the exact same Explain Plan from original version of SQL statement, try the following:

  1. Copy the CBO statistics from the source instance (where the SQL performs poorly)  into the destination instance (tuning environment):
    1. When you ran the SQLTXPLAIN.SQL on the source instance, it updated a staging table SQLT$STATTAB with the CBO stats for all schema objects related to the SQL statement (tables, indexes, columns and histograms).
    2. Use the Export command on the source instance, according to the INSTRUCTIONS.TXT file provided inside the SQLT.zip file.  Generate an external binary file SQLT.dmp with the following command:
      # exp apps/<apps_pwd> file=SQLT tables='SQLT$STATTAB'
    3. Copy this binary file from source to destination instance.  Do not use ASCII.  Treat always as BINARY.
    4. Use the Import command on destination instance, as documented on the SQLTSTATTAB.SQL script, also included inside the SQLT.zip file.
      #imp apps/<apps_pwd> file=SQLT tables='SQLT$STATTAB' ignore=y
    5. Execute script SQLTSTATTAB.SQL on the destination instance to update the data dictionary CBO stats from imported SQLT$STATTAB table.

      Note: To restore the stats in the destination instance, simply gather new stats for affected schema objects.  You may also want to use the SQLTGSTATS.SQL script included in the SQLT.zip file.  This means you don't need to backup CBO stats on destination instance prior to overriding them with stats from source instance.

  2. Review and compare the init.ora parameters files from source and destination instances.  If these instances are Production and Test, you may have the exact same parameters.  If not, annotate the differences in case you have to adjust the CBO relevant parameters in the destination instance.  You don't have to take action right away, as you may produce the same Explain Plan without changing any init.ora parameter.  Even if you adjust an init.ora parameter, you may be able to do so with an ALTER SESSION command for most of them, instead of modifying the init.ora file and bouncing the database altogether.
  3. Review and compare schema object attributes such as 'Partitioned' and Parallel 'Degree'.  If you find discrepancies, sync them up.
  4. Annotate the RDBMS Release version (up to the fifth digit), as well as the Platform.  You must be at least on the same RDBMS Release up to the 3rd digit before trying to reproduce the same Explain Plan.  It would be better, if you are on sync up to the 4th digit.
  5. Now try, using the SQLTXPLAIN.SQL script, to generate the same Explain Plan in source and destination.  If you don't get the same Explain Plan, adjust CBO related init.ora parameters in destination and try again (use ALTER SESSION if parameter allows).  If you still cannot obtain the same Explain Plan using common CBO stats, init.ora parameters, and schema object attributes, try then ruling out differences among the source and destination instances (one at a time).  Determine what is different between source and destination instances.   Focus on the discrepancies that may be causing the 'bad' Explain Plan (assuming the plan on destination instance performs better, of course), and rule them out (one by one) until you find which of the discrepancies causes the Explain Plan to switch from 'good' to 'bad'.

    Note: In most cases, finding the root cause of a ' bad' Explain Plan, is the same than finding the solution to the performance issue.

  6. If you find yourself in a situation in which CBO stats, schema object attributes, and init.ora, are all the same, but Platform and RDBMS Release are different, and instance in which RDBMS is newer performs better, you can be almost certain that upgrading the RDBMS engine will solve your performance issue.
  7. If you have the same CBO stats, schema object attributes, init.ora and Platform, and only RDBMS Release is different, and the instance with the newer Release performs better, try to upgrade your RDBMS Release on the older instance.
  8. If you, or Oracle Support, can reproduce the same 'bad' Explain Plan on the same or different Platform (common up to the 3rd digit RDBMS Release), using your CBO stats, most likely your issue is an Application Bug.  In such case, the issue needs to be reported to Oracle Development and you will be given a new Bug number.
  9. Once your performance issue has been cataloged as a new Application Bug, the next steps in the troubleshooting process require to explain and execute the SQL statement in its original form and on several different modified versions, trying to create one execution plan delivering a better performance.

    Note: If you have two similar instances.  One performing well and the other poorly, and they have similar data but producing different Explain Plans, as a workaround you can force the 'good' plan into the slow instance by migrating the CBO stats using SQLTXPLAIN.SQL together with SQLTSTATTAB.SQL.

To execute the expensive SQL statement in its original version and on several different modified versions, try the following:

  1. You need to be able to isolate the expensive SQL statement for execution from SQL*Plus, at will.  To do this, you need first to find the values of the bind variables referenced.  If you can deduce the values by reviewing the SQL statement, do so.  Otherwise, you might have to use one of the methods available for tracing with bind variables according to Note:171647.1, and then use the Trace Analyzer (Note:224270.1) to process the raw SQL Trace and identify the bind variables from your raw SQL Trace created with Event 10046 on your transaction.
  2. Assign the values of the bind variables referenced in the SQL statement.  Be careful conserving the same data types.  You may need to define and assign values to bind variables.  Avoid replacing bind variables with literals.
  3. If your Explain Plan shows any table with suffix '_ALL', this means you need to set up the multi-org environment.  Using the corresponding Operating Unit (ORG_ID), set multi-org with this command:
    SQL> exec fnd_client_info.set_org_context('&org_id');
  4. Use ALTER SESSION commands to turn SQL_TRACE ON and OFF, and execute your SQL statement.  To facilitate the whole process, you may want to create a script with the setting of multi-org, the 'ALTER SESSION SET SQL_TRACE = TRUE;' command, the assignment of the bind variable values, your SQL statement, and the command to terminate the SQL Trace.  This way you can execute the SQL statement systematically.
  5. For INSERT, UPDATE or DELETE SQL statements, you need to focus on the subquery performing poorly (usually the main query feeding the insert/update/delete).  Transform the original SQL into an isolated stand-alone query.  If this is not possible, add the ROLLBACK command to the script with your INSERT, UPDATE or DELETE SQL statement.
  6. Tuning the SQL statement requires a lot of practice and patience.  All methods converge to the same principle: apply your knowledge to create a modified and improved version of the original SQL statement and determine if it performs better for every situation.  Some analysts mostly use the Explain Plan leaving the benchmark of a candidate to the end.  Others prefer to execute and measure the performance of each candidate (modified SQL statement).  It becomes a matter of style at this level.
  7. While iterating in this process, generating explain plans for several versions of the same SQL statement, you can use the SQLTX.SQL script (included in SQLT.zip), or the bde_x.sqlscript from Note:174603.1.  The latter script generates a very simple Explain Plan and their execution is faster than complex SQLTXPLAIN.SQL.
  8. Things to try in order to improve the Explain Plan and ultimately the performance of the SQL statement:
    1. Verify all tables referenced in the FROM clause are actually joined in the WHERE clause.
    2. Improve CBO stats, either by using a higher sample size or with histograms for columns that are filtered with literals in the WHERE clause.  You can also temporarily modify the CBO stats for an index or column (only as a short term workaround).
    3. Indexes with better selectivity for specific filter or join conditions.  These indexes may ultimately be custom indexes.
    4. Switch the optimizer from RBO to CBO, or from CBO to RBO.  The latter as a temp solution only.
    5. Use one or more CBO Hints.
    6. Rewording the SQL statement.
    7. Avoid overuse of UNION, ORDER BY, DISTINCT and other clauses that may not be necessary.
    8. Using dynamic SQL to avoid poorly written code with functions like NVL or DECODE in the WHERE clause, which may affect the selectivity of the predicates.
    9. If the SQL statement has been fully tuned, and the reason of the poor performance is purely the volume of data necessarily retrieved, then you may want to consider data partitioning or parallel query.  Keep in mind that data partitioning or parallel processing are not the right solution to fix a poorly tuned SQL.

Next

Back-end Tuning

Once you have validated Certify and Statistics Gathering, proceed with this section if your performance issue qualifies as this high-level tuning category.

Data Gathering (files and information)

Gather the indicated files and document in your electronic file the following information:

  1. Architecture information: Basically how are the database server and the middle-tier configured?  Are they in the same box?  If not, how many boxes you have?  Which type? etc.  Try answering: Where do you have what?
  2. Hardware Profile: CPU(s) number, type and speed.  Amount of memory.  How is the I/O subsystem configured?  What is the network type and speed? etc.  Provide high-level information of your hardware and components.
  3. Server workload profile:  What do you have running on same box?  Databases in use on same server.  Number of concurrent active users.  Number of concurrent active processes at a given time (usually peak times).  Basically, how busy is your box.
  4. Do other applications or databases you may have running in the same box also perform poorly?  If not, explain.
  5. What is the current and projected system load?  What is the current vs. projected number of active concurrent users.  Same for active concurrent processes.
  6. What are the concurrent processing policies?  Have you moved as much of the concurrent processing to lower online user activity periods?  Do you have any restrictions to concurrent processing at all?  Do you use concurrent managers to restrict this intensive processing activities during the day?
  7. Have you validated any Operating System resource contention?  This includes CPU, memory and disk.  Your comments should take into consideration all your boxes (back-end and middle-tier).  Validate and document if you are experiencing CPU spikes, memory paging, hot disks, etc.  If you have noticed memory swapping, document in detail, as well as any action being taken, including short-term actions like borrowing hardware from Development or Test servers.
  8. Make a list of all application modules (application groups), installed and in use on this Apps instance.  Example: AP, GL, FND, ONT, etc.
  9. For the application modules (groups) affected by poor performance, document currently installed patchset level.
  10. For same affected application modules, research on My Oracle Support and document in your electronic file what is the latest patchset available.  Use the 'Patches' option on My Oracle Support main menu.  Document if you can upgrade to latest patchset levels shortly.
  11. What is the Operating System patching level in your server box?  Try to rule out any known performance issues on your hardware platform.  In general, try to keep your OS patching level as current as possible.  It is known that several overall performance issues are caused by inadequate OS patching level.  Consult your hardware vendor in this regard.
  12. If you have any prior Performance related Report with specific recommendations regarding hardware, configuration sizing, benchmark, stress test or similar, include the report  in your electronic documentation of your performance issue and provide it to Oracle Support.  This includes any formal or informal recommendations made by any Oracle or 3rd party entity.  Especially important if you are considering or in the process of implementing such recommendations.
  13. Review init.ora parameters file doing a sanity check on it, and have it ready to make it available to Oracle Support.  If you find that some Events are set in this file, determine if there is a strong valid reason why.  If none, delete them.  If your init.ora file references another file by using the command IFILE, review the referenced file and have it available as well.
  14. Review ALERT.LOG for possible server errors or any other evident abnormalities.  If the ALERT.LOG is large, have the last 48 hours of it available for Oracle Support.  Be sure theALERT.LOG includes the monitored interval where the performance was poor.
  15. Make file APPLPTCH.TXT available to Oracle Support.  This file keeps track of patches applied to Apps.
  16. Identify up to the top 10 user transactions performing poorly.  This transactions are usually what is causing your users to complain of the poor performance in the first place.  Examples: entering an order, saving a line, performing a query, etc.  Document for each of this up to 10 'critical' user transactions:
    1. Transaction name or short description.  Example: booking an order
    2. Performance during normal system load (secs/mins)
    3. Expected performance (secs/mins)
    4. Performance when system load is almost zero (when only one or very few users are active on instance)

Initial Troubleshooting

At this point, you can pursue your performance issue with Oracle Support.  Provide as many of the requested files as possible.  Or, you may opt to participate more pro-actively in the initial troubleshooting phase by performing the steps in this section before contacting Oracle Support.

  1. For 11i instances: Verify required and recommended init.ora parameters are set correctly.  Use the provided script AFCHKCBO.sql and Interoperability Notes as well.  Generate theAFCHKCBO.TXT file containing the Apps 11i required init.ora parameters names and values.  Make this file available to Oracle Support.  Fix any discrepancy, and document possible reason why 'current' and 'required' columns don't have the same value.  If the AFCHKCBO.sql script and the Interoperability Notes require different values, set the values of the Note.  To execute the script use the syntax below:
# sqlplus apps/<apps_pwd>
SQL> SPOOL AFCHKCBO.TXT;
SQL> start $FND_TOP/sql/AFCHKCBO.sql
SQL> SPOOL OFF;
SQL> QUIT;
  1. For 11i instances: There is another script that validates all required and recommended init.ora parameters according to RDBMS Release.  Use script bde_chk_cbo.sql from Note:174605.1 as an extension to AFCHKCBO.sql.  Be aware that script bde_chk_cbo.sql provides more detail than AFCHKCBO.sql.
  2. For 11i instances: Verify CBO statistics by executing the bde_last_analyzed.sql script from Note:163208.1.  This script reports CBO stats per application group (schema name) and per date.  It also creates a summary at the beginning indicating how old the CBO stats are, if data dictionary objects are free of CBO stats, and if you have partitioned tables requiring you fix their global stats.  Review BDE_LAST_ANALYZED.TXT reports and make them available to Oracle Support.
  3. For 10.7 and 11.0 instances: Verify you are gathering your CBO stats at least one per month, all schema objects, with an estimate of 10%
  4. For 8.0 and later: when the system is performing poorly, take one snapshot of the SQL area, to easily identify if there is any evident expensive SQL being executed, or recently executed.  For 8.1 and later, use SQLTAREAT.SQL from Note:238684.1.  For 8.0 use coe_sqlarea_80.sql from Note:163209.1.  Read and get yourself familiarized with the specific version ofSQLTAREAT.SQL script and its output.  Compress the whole directory which contains the SQLAREAT.SQL generated spool file(s).

Advanced Troubleshooting

This phase is not complex, but it requires you to invest more time initially, monitoring the performance of your instance for up to one wor

Next

Advanced Troubleshooting

Advanced Troubleshooting

This phase is not complex, but it requires you to invest more time initially, monitoring the performance of your instance for up to one working day.  Therefore, you may want to proceed toreporting to Oracle Support your overall bad performance issue at this time.  Once your issue has been reported, proceed  immediately with this advanced troubleshooting phase, in order to quickly generate the necessary files to pursue a final resolution.

  1. For 7.3 and 8.0: Generate and provide at least one REPORT.TXT file from UTL scripts 'ULTBSTAT/UTLESTAT'.  Your DBA should be familiar with these common performance monitoring scripts.
  2. For 8.1 and later: Install the latest version available of the StatsPack package.  This package is automatically available on 8.1, but it requires it be installed from its location at $ORACLE_HOME/rdbms/admin into the database (as any other package).  Look for detailed instructions in the document spdoc.txt within the same directory.  Your DBA should already either be familiar with this package, or get familiar with it since it replaces former UTL scripts 'ULTBSTAT/UTLESTAT'.  Read Note:153507.1 for more information on StatsPack for Oracle Apps.  Once installed, monitor poor performance during 4-8 hours, taking snapshots every 30 mins during the whole monitored interval (4-8 hours).  Then generate one or moreStatsPack Report based on the snapshots while performance was worse (usually between 1 and 2 hours within the 4-8 hours monitored interval).  Provide these reports to Oracle Support.
  3. For all RDBMS Releases, monitor OS performance at the same time database performance is monitored.  For 8.1 and later, every 30 mins during the whole monitored interval (4-8 hours).  For 7.3 and 8.0, every 30 mins during the same interval of 'ULTBSTAT/UTLESTAT' execution.  Use standard OS performance monitoring tools like: vmstat, iostat, mpstat and top.
  4. If there is an obvious resource contention in your OS, stop here and try to alleviate it with permanent or temporary actions at the OS level.
  5. Have your DBA read and analyze your ULTBSTAT/UTLESTAT or StatsPack Report.  Search on My Oracle Support for possible known issues with the same characteristics.
  6. If you opt to be pro-active reducing the number of performance issues due to known problems, keep your code as recent as possible, starting by the OS and moving towards RDBMS, leaving Apps code last.  Upgrading the OS software is usually painless, the RDBMS requires minor testing, and the Apps layer requires significant user testing.
  7. Provide all your gathered files, performance template, and dial-in to Oracle Support.  Familiarize yourself with Oracle Direct Connect ODC

Tech-Stack Tuning

Once you have validated Certify and Statistics Gathering, proceed with this section if your performance issue qualifies as this high-level tuning category.

Data Gathering (files and information)

Gather the indicated files and document in your electronic file the following information:

  1. How long does it take for the process to complete (specify hours/mins/secs)?
  2. How long did it use to take (before having the performance issue)?
  3. What is the expected performance for this process (specify hours/mins/secs)?
  4. Architecture information: Basically how are the database server and the middle-tier configured?  Are they in the same box?  If not, how many boxes you have?  Which type? etc.  Try answering: Where do you have what?
  5. Hardware Profile: CPU(s) number, type and speed.  Amount of memory.  How is the I/O subsystem configured?  What is the network type and speed? etc.  Provide high-level information of your hardware and components.
  6. Server workload profile:  What do you have running on same box?  Databases in use on same server.  Number of concurrent active users.  Number of concurrent active processes at a given time (usually peak times).  Basically, how busy is your box.
  7. Do other applications or databases you have running on the same box also perform poorly?  If no, explain.
  8. Do other applications running on the same client also perform poorly?  If no, explain.
  9. If the issue relates to slowness in loading a Form or navigating, does it reproduce when the client is connected directly to the network hub closest to the server?
  10. What is the current and projected system load?  What is the current vs. projected number of active concurrent users.  Same for active concurrent processes.
  11. What are the concurrent processing policies?  Have you moved as much of the concurrent processing to lower online user activity periods?  Do you have any restrictions to concurrent processing at all?  Do you use concurrent managers to restrict this intensive processing activities during the day?
  12. Have you validated any Operating System resource contention?  This includes CPU, memory and disk.  Your comments should take into consideration all your boxes (back-end and middle-tier).  Validate and document if you are experiencing CPU spikes, memory paging, hot disks, etc.  If you have noticed memory swapping, document in detail as well as any action being taken, including short-term actions like borrowing hardware from Development or Test servers.
  13. Make a list of all application modules (application groups), installed and in use on this Apps instance.  Example: AP, GL, FND, ONT, etc.
  14. For the application modules (groups) affected by poor performance, document the currently installed patchset level.
  15. For the same affected application modules, research on My Oracle Support and document in your electronic file what is the latest patchset available.  Use 'Patches' option on My Oracle Support main menu.  Document if you can upgrade to latest patchset levels shortly.
  16. What is the Oracle Forms Release version?
  17. Which is the JINITIATOR version?
  18. Browser name and version?
  19. Document in your electronic file, in full detail, the complete navigation path, as well as step-by-step instructions to reproduce your issue.  If the transaction performing poorly is a query, document which parameters are passed to the query as well as which parameters are NULL, or automatically defaulted.  Be as specific as possible.

Proceed to report your Tech-Stack performance issue to Oracle Support.


Reporting to Oracle

Providing to Oracle well organized, accurate, and comprehensive information and files, helps to expedite the total resolution time.  Try to determine the right balance between the initial time invested in gathering as much information and files early in the process, with the benefit they provide to the overall process reducing the number of iterations between the end-user, the technical user, Oracle Support, and Oracle Development.  Reports like the one produced by the SQLTXPLAIN.SQL script consolidate pieces of information like CBO stats, indexes, init.ora parameters, etc.  Having all this information gathered systematically and into one single place, certainly reduces the number of iterations and therefore the total resolution time.

Requested Files for Transaction Tuning Issues

At the very minimum, provide files 1 to 5 below.  If you pro-actively participated on the initial troubleshooting phase, or Oracle Support has guided you through it, provide files 6 to 9 accordingly.

  1. Apps Performance Bug Template - Transaction Tuning
  2. For Pro*C Concurrent Programs, MODULES.TXT with versions of modules
  3. For Concurrent Programs, Log file with debugging information
  4. Raw SQL Trace from the transaction, with or without Event 10046 details (compressed), complete or incomplete
  5. Trace Analyzer and/or TKPROF file(s) with Explain Plans
  6. SQL<n>.TXT file(s) with identified expensive SQL
  7. Compressed file with spool files generated by SQLTXPLAIN.SQL
  8. Only for CBO and SQL1.TXT: Raw SQL Trace produced by SQLTXPLAIN.SQL
  9. Only for CBO and SQL1.TXT: Binary file SQLT.dmp with CBO stats

Requested Files for Back-End Tuning Issues

At the very minimum, provide files 1 to 5 below.  If you pro-actively participated on the initial troubleshooting phase, or Oracle Support has guided you through it, provide files 6 to 8 accordingly.  If you opted to, or Oracle Support instructed you to perform the advanced troubleshooting steps, provide files 9-11 accordingly.

  1. Apps Performance Bug Template - Back-End Tuning
  2. Any prior Performance related Report available
  3. File init.ora, including any ifile(s) referenced on the init.ora
  4. ALERT.LOG file, including last 48 hours
  5. APPLPTCH.TXT file
  6. For 11i, AFCHKCBO.TXT and/or BDE_CHK_CBO.TXT with required init.ora parameters
  7. For 11i, BDE_LAST_ANALYZED.TXT with summary of CBO stats
  8. For 8.1 or later, SQLAREAT.SQL spool files with expensive SQL statements
  9. For 7.3 or 8.0, REPORT.TXT produced by bstat/estat tool
  10. For 8.1 or later, StatsPack Report
  11. Set of stats from OS performance monitoring tools, like: vmstat, iostat, mpstat and top

Requested Files for Tech-Stack Tuning Issues

  1. Apps Performance Bug Template - Tech-Stack Tuning

Next

Troubleshooting Oracle Applications Performance Issues (Doc ID 169935.1)

Tools for Tuning the Database

Database views

Master Note For Privileges And Roles (Doc ID 1347470.1)

Security Checklist: 10 Basic Steps to Make Your Database Secure from Attacks (Doc ID 1545816.1)

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=483409173288344&id=398838.1&displayIndex=9&_afrWindowMode=0&_adf.ctrl-state=814x5iaj_469#aref_section210

FAQ: SQL Query Performance - Frequently Asked Questions (Doc ID 398838.1)

Tuning Queries: 'Quick and Dirty' Solutions (Doc ID 207434.1)

How to Investigate Slow or Hanging Database Performance Issues (Doc ID 1362329.1)

Master Note: Troubleshooting Structured Query Language (SQL) (Doc ID 1517773.1)

Master Note: SQL Query Performance Overview (Doc ID 199083.1)

TROUBLESHOOTING: Possible Causes of Poor SQL Performance (Doc ID 33089.1)

TROUBLESHOOTING: Possible Causes of Poor SQL Performance (Doc ID 33089.1)

How to Diagnose High CPU Usage Problems to the Module Level (Doc ID 352648.1)

TROUBLESHOOTING: Tuning Slow Running Queries (Doc ID 179668.1)

Script to Show Objects That are Missing Statistics (Doc ID 957993.1)

Master Note For Privileges And Roles (Doc ID 1347470.1)

SQL Tuning Health-Check Script (SQLHC) (Doc ID 1366133.1)

Master Note: SQL Query Performance Overview (Doc ID 199083.1)

Archive of Database Performance Related Webcasts and Videos (Doc ID 1597373.1)

Master Note For Privileges And Roles (Doc ID 1347470.1)

Security Checklist: 10 Basic Steps to Make Your Database Secure from Attacks (Doc ID 1545816.1)

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=483409173288344&id=398838.1&displayIndex=9&_afrWindowMode=0&_adf.ctrl-state=814x5iaj_469#aref_section210

FAQ: SQL Query Performance - Frequently Asked Questions (Doc ID 398838.1)

Tuning Queries: 'Quick and Dirty' Solutions (Doc ID 207434.1)

How to Investigate Slow or Hanging Database Performance Issues (Doc ID 1362329.1)

Master Note: Troubleshooting Structured Query Language (SQL) (Doc ID 1517773.1)

Master Note: SQL Query Performance Overview (Doc ID 199083.1)

TROUBLESHOOTING: Possible Causes of Poor SQL Performance (Doc ID 33089.1)

TROUBLESHOOTING: Possible Causes of Poor SQL Performance (Doc ID 33089.1)

How to Diagnose High CPU Usage Problems to the Module Level (Doc ID 352648.1)

TROUBLESHOOTING: Tuning Slow Running Queries (Doc ID 179668.1)

Script to Show Objects That are Missing Statistics (Doc ID 957993.1)

Master Note For Privileges And Roles (Doc ID 1347470.1)

SQL Tuning Health-Check Script (SQLHC) (Doc ID 1366133.1)

Master Note: SQL Query Performance Overview (Doc ID 199083.1)

Archive of Database Performance Related Webcasts and Videos (Doc ID 1597373.1)

Next

Oracle Enterprise Manager Cloud Control

The primary tool to manage the database is Enterprise Manager Cloud Control
(Cloud Control), a web-based interface. After you install the Oracle software, create
or upgrade a database, and configure the network, you can use Cloud Control to
manage the database. In addition, Cloud Control provides an interface for
performance advisors and for database utilities, such as SQL*Loader and Recovery
Manager (RMAN).

Next

Oracle Diagnostics Pack

Oracle Diagnostics Pack offers a complete, cost-effective, and easy-to-use solution
to manage the performance of Oracle Database environments by providing unique
features, such as automatic identification of performance bottlenecks, guided
problem resolution, and comprehensive system monitoring. Key features of Oracle
Diagnostics Pack used in this guide include Automatic Workload Repository
(AWR), Automatic Database Diagnostic Monitor (ADDM), and Active Session
History (ASH).

Next

Oracle Database Tuning Pack

Oracle Database Tuning Pack automates the database application tuning process,
thereby significantly lowering database management costs while enhancing. performance and reliability. Key features of Oracle Database Tuning Pack that are
used in this guide include the following:
– SQL Tuning Advisor
This feature enables you to submit one or more SQL statements as input and
receive output in the form of specific advice or recommendations for how to
tune statements, along with a rationale for each recommendation and its
expected benefit. A recommendation relates to collection of statistics on objects,
creation of new indexes, restructuring of the SQL statements, or creation of SQL
profiles.
– SQL Access Advisor
This feature enables you to optimize data access paths of SQL queries by
recommending the proper set of materialized views and view logs, indexes, and
partitions for a given SQL workload.

Next

Oracle Real Application Testing

Oracle Real Application Testing consists of the following key features:
– Database Replay
This feature enables you to capture the database workload on a production
system, and replay it on a test system with the exact same timing and
concurrency as the production system on the same or later release of Oracle
Database.
– SQL Performance Analyzer
This feature enables you to assess the effect of system changes on SQL
performance by identifying SQL statements that have regressed, improved, or
remained unchanged.

Next

ADDM

ADDM is diagnostic software built into Oracle Database. ADDM examines and analyzes data captured in Automatic Workload Repository (AWR) to determine possible database performance problems. ADDM then does the following:

  • Locates the root causes of the performance problems
  • Provides recommendations for correcting them
  • Quantifies the expected benefits
  • Identifies areas where no action is necessary.

This section contains the following topics:

ADDM Analysis

An ADDM analysis is performed after each AWR snapshot (every hour by default), and the results are saved in the database. You can then view the results using Cloud Control.

The ADDM analysis is performed from the top down, first identifying symptoms and then refining the analysis to reach the root causes of performance problems. ADDM uses the DB time statistic to identify performance problems. Database time (DB) time is the cumulative time spent by the database in processing user requests, including both the wait time and CPU time of all user sessions that are not idle.

The goal of database performance tuning is to reduce the DB time of the system for a given workload. By reducing DB time, the database can support more user requests by using the same or fewer resources. ADDM reports system resources that are using a significant portion of DB time as problem areas and sorts them in descending order by the amount of related DB time spent. For more information about the DB time statistic, see "Time Model Statistics".

 

ADDM Recommendations

In addition to diagnosing performance problems, ADDM recommends possible solutions. When appropriate, ADDM recommends multiple solutions from which you can choose. ADDM recommendations include the following:

  • Hardware changesAdding CPUs or changing the I/O subsystem configuration
  • Database configurationChanging initialization parameter settings
  • Schema changesHash partitioning a table or index, or using automatic segment space management (ASSM)
  • Application changesUsing the cache option for sequences or using bind variables
  • Using other advisorsRunning SQL Tuning Advisor on high-load SQL statements or running the Segment Advisor on hot objects

ADDM benefits apply beyond production systems. Even on development and test systems, ADDM can provide an early warning of potential performance problems.

Performance tuning is an iterative process. Fixing one problem can cause a bottleneck to shift to another part of the system. Even with the benefit of the ADDM analysis, it can take multiple tuning cycles to reach a desirable level of performance.

 

ADDM for Oracle Real Application Clusters

In an Oracle Real Application Clusters (Oracle RAC) environment, you can use ADDM to analyze the throughput performance of a database cluster. ADDM for Oracle RAC considers DB time as the sum of database times for all database instances and reports findings that are significant at the cluster level. For example, the DB time of each cluster node may be insignificant when considered individually, but the aggregate DB time may be a significant problem for the cluster as a whole.

Next

Types Of Database Statistics

What Are Database Statistics

Database statistics provide information about the type of load on the database and the
internal and external resources used by the database. To accurately diagnose
performance problems with the database using ADDM, statistics must be available.
A cumulative statistic is a count such as the number of block reads. Oracle Database
generates many types of cumulative statistics for the system, sessions, and individual
SQL statements. Oracle Database also tracks cumulative statistics about segments and
services. Automatic Workload Repository (AWR) automates database statistics
gathering by collecting, processing, and maintaining performance statistics for
database problem detection and self-tuning purposes.

By default, the database gathers statistics every hour and creates an AWR snapshot,
which is a set of data for a specific time that is used for performance comparisons. The
delta values captured by the snapshot represent the changes for each statistic over the
time period. Statistics gathered by AWR are queried from memory. The gathered data
can be displayed in both reports and views.
The following initialization parameters are relevant for AWR:
• STATISTICS_LEVEL
Set this parameter to TYPICAL (default) or ALL to enable statistics gathering by
AWR. Setting STATISTICS_LEVEL to BASIC disables many database features,
including AWR, and is not recommended. To learn more about this initialization
parameter, see Oracle Database Reference.
• CONTROL_MANAGEMENT_PACK_ACCESS
Set to DIAGNOSTIC+TUNING (default) or DIAGNOSTIC to enable automatic
database diagnostic monitoring. Setting CONTROL_MANAGEMENT_PACK_ACCESS to
NONE disables many database features, including ADDM, and is strongly
discouraged. To learn more about this initialization parameter, see Oracle Database

SQL> sho parameter TATISTICS_LEVEL

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
statistics_level string TYPICAL
SQL> sho parameter CONTROL_MANAGEMENT_PACK_ACCESS

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_management_pack_access string DIAGNOSTIC+TUNING

 

 

Next

Types Of Statistics

Time Model Statistics

Time model statistics measure the time spent in the database by operation type. The most important time model statistic is database time (DB time). DB time represents the total time spent in database calls by foreground sessions, and is an indicator of the total instance workload. As shown in Figure 2-1, database time makes up a portion of an application's overall user response time.

Figure 2-1 DB Time in Overall User Response Time

Description of Figure 2-1 follows
Description of "Figure 2-1 DB Time in Overall User Response Time"

A session is a logical entity in the database instance memory that represents the state of a current user login to a database. Database time is calculated by aggregating the CPU time and wait time of all active sessions (sessions that are not idle). For any database request, the CPU time is the sum of the time spent working on the request, while the wait time is the sum of all the waits for various database instance resources. DB time includes only time spent on client processes and does not include time spent on background processes such as PMON.

For example, a user session may involve an online transaction made at an online bookseller consisting of the actions shown in Figure 2-2.

Figure 2-2 DB Time in User Transaction

Description of Figure 2-2 follows
Description of "Figure 2-2 DB Time in User Transaction"

  1. Query for novels by authorThe user performs a search for novels by a particular author. This action causes the application to perform a database query for novels by the author.
  2. Browse results of queryThe user browses the returned list of novels by the author and accesses additional details, such as user reviews and inventory status. This action causes the application to perform additional database queries.
  3. Add item to cartAfter browsing details about the novels, the user decides to add one novel to the shopping cart. This action causes the application to make a database call to update the shopping cart.
  4. CheckoutThe user completes the transaction by checking out, using the address and payment information previously saved at the bookseller's website from a previous purchase. This action causes the application to perform various database operations to retrieve the user's information, add a new order, update the inventory, and generate an email confirmation.

For each of the preceding actions, the user makes a request to the database, as represented by the down arrow in Figure 2-2. The CPU time spent by the database processing the request and the wait time spent waiting for the database are considered DB time, as represented by the shaded areas. After the request is completed, the results are returned to the user, as represented by the up arrow. The space between the up and down arrows represents the total user response time for processing the request, which contains other components besides DB time, as illustrated in Figure 2-1.

Note:

DB time is measured cumulatively from when the instance started. Because DB time combines times from all non-idle user sessions, DB time can exceed the time elapsed since the instance started. For example, an instance that has run 5 minutes could have four active sessions whose cumulative DB time is 20 minutes.

The objective of database tuning is to reduce DB time. In this way, you can improve the overall response time of user transactions in the application.

Next

Wait Event Statistics

Wait events are incremented by a session to indicate that the session had to wait for an event to complete before being able to continue processing. When a session has to wait while processing a user request, the database records the wait by using one of a set of predefined wait events. The events are then grouped into wait classes, such as User I/O and Network. Wait event data reveals symptoms of problems that might be affecting performance, such as latch, buffer, or I/O contention.

Next

Session and System Statistics

A large number of cumulative database statistics are available on a system and session level. Some of these statistics are collected by AWR.

Next

Active Session History Statistics

The Active Session History (ASH) statistics are samples of session activity in the database. The database samples active sessions every second and stores them in a circular buffer in the System Global Area (SGA). Any session that is connected to the database and using CPU, or is waiting for an event that does not belong to the idle wait class, is considered an active session. By capturing only active sessions, a manageable set of data is represented. The size of the data is directly related to the work being performed, rather than the number of sessions allowed on the database.

Using the DB time example described in "Time Model Statistics", samples of session activity are collected from the online transaction made at the bookseller's website, represented as vertical lines below the horizontal arrow in Figure 2-3.

Figure 2-3 Active Session History

Description of Figure 2-3 follows
Description of "Figure 2-3 Active Session History"

The light vertical lines represent samples of inactive session activity that are not captured in the ASH statistics. The bold vertical lines represent samples of active sessions that are captured at:

  • 7:38, while novels by the author are being queried
  • 7:42, while the user is browsing the query results
  • 7:50, when one novel is added to the shopping cart
  • 7:52, during the checkout process

Table 2-1 lists ASH statistics collected for the active sessions, along with examples of the session ID (SID), module, SQL ID, session state, and wait events that are sampled.

Table 2-1 lists ASH statistics collected for the active sessions, along with examples of the session ID (SID), module, SQL ID, session state, and wait events that are sampled.


Table 2-1 Active Session History

Time SID Module SQL ID State Event
7:38 213 Book by author qa324jffritcf Waiting db file sequential read
7:42 213 Get review ID aferv5desfzs5 CPU n/a
7:50 213 Add item to cart hk32pekfcbdfr Waiting buffer busy wait
7:52 213 Checkout abngldf95f4de Waiting log file sync

 

High-Load SQL Statistics

Next

High-Load SQL Statistics

SQL statements that are consuming the most resources produce the highest load on the system, based on criteria such as elapsed time and CPU time.

Next

Common Connectivity Issues From a Remote Client to a Database

Diagnosing Server Problems

Check the following:

  • Is it an isoalted system? meaning are other users able to connect to thesame database or is it just this one user who is unable to connect.
  • Has the server, database, or listener configuration remained the same for some
    time? Or Have there been a recent maintenance or changes to the configuration?

Next

Verify That The Database Is Running

To logon to the Linux/Unix oracle server, you will need the following information:

  1. your Linux/Unix username/password.
  2. The ability to "su" as the oracle user.
  3. The Oracle password.

oracle

To check that the database is up, log in to the database and connect with a valid
username and password. For example:
SQLPLUS system
Enter password: password

A message appears, confirming that you are connected with the database. If you
receive the following errors, then ask your Database Administrator to assist you:
■ ORA-1017: invalid U/P
■ ORA-1034: Oracle not available

Next

Diagnosing Client Problems

Verify at least one of the following statements. This will help you decide if it is a client
problem.
■ The database server passed a loopback test, showing that the connection worked.
■ Other computers connect also using Oracle Net Services to this same database.
■ Connections from this workstation worked before making changes on this
computer, such as the installation of a new product or modification to the network
configuration.

The following procedure describes how to perform diagnostics on the client:
1. Check that you have installed the same protocol support that was installed on the
database server.
On Linux and UNIX platforms you can use the ADAPTERS utility to verify protocol
support. On the database server, run the following command from the ORACLE_HOME/bin directory to display the protocol support, naming methods, and security
options linked with the oracle executable:

run the command as shown below

hostname:/apps/oracle/product/12.1.1/bin>adapters ./oracle

Oracle Net transport protocols linked with ./oracle are:

IPC
BEQ
TCP/IP
SSL
SDP/IB
RAW

Oracle Net naming methods linked with ./oracle are:

Local Naming (tnsnames.ora)
Oracle Directory Naming
Oracle Host Naming

Oracle Advanced Security options linked with ./oracle are:

RC4 40-bit encryption
RC4 56-bit encryption
RC4 128-bit encryption
RC4 256-bit encryption
DES40 40-bit encryption
DES 56-bit encryption
3DES 112-bit encryption
3DES 168-bit encryption
AES 128-bit encryption
AES 192-bit encryption
AES 256-bit encryption
MD5 crypto-checksumming
SHA-1 crypto-checksumming
Kerberos v5 authentication
RADIUS authentication

On the client, run the adapters command from the ORACLE_HOME/bin directory to
display the configured Oracle protocol support, naming methods, and security
options. The ADAPTERS utility displays output similar to the following:

 

Ensure that the Oracle Net foundation layer and the appropriate Oracle protocol
support are present by verifying that all Oracle Net Services software has been
installed for the client.
4. Ensure that the client computer has the tnsnames.ora and the sqlnet.ora files in
the correct locations.

If you have any other working client computers connecting to the selected Oracle
Database, then back up your existing files and copy both the working
tnsnames.ora and sqlnet.ora files from the working client computer to the
non-working clients. This eliminates the possibility of errors in the files.
5. Test the Oracle Net foundation layer. You can test using the following command to
connect to SQL*Plus:
sqlplus user/password@connect_string

Note: Do not use the TNSPING utility. The TNSPING utility
works like the TCP/IP PING utility and does not create and open a
socket, nor does it connect with the listener. It ensures that the
listener is present on the database server.

Next

ORA-03113: TNS:end-of-file on communication channel

Cause: An error has occurred on the database server.
Action: Check the alert_sid.log file on the server. An unexpected end of file was processed on the communication channel. This may be an indication that the communications link may have gone down at least temporarily, or it may indicate that the server has gone down.You may need to modify your retransmission count.

 

 

Next

ORA-12154: TNS:could not resolve the connect identifier specified

ORA-12154: TNS:could not resolve the connect identifier specified
Cause: A connection to a database or other service was requested using a connect
identifier, and the connect identifier specified could not be resolved into a connect
descriptor using one of the naming methods configured. For example, if the type
of connect identifier used was a net service name then the net service name could
not be found in a naming method repository, or the repository could not be located
or reached.
Action: Perform the following steps:
1. Check the type of naming adapters listed in the names.directory_path
parameter in the sqlnet.ora file. If none are configured, then use the
adapters command to determine which adapters are in use. The following
example shows the adapters:
$ adapters
...
Installed Oracle Net naming methods are:
Local Naming (tnsnames.ora)
Oracle Directory Naming
Oracle Host Naming
NIS Naming
The net service name given in the connect string should be defined for at least
one of the naming methods.
2. Check the resolution path for each adapter for possible problems. For
example, ensure that the name given in the connect string is correct and
complete, using the full name of the net service if necessary.
When using the local naming method, do the following:
1. Verify that the tnsnames.ora file exists and is in the correct location. The
location is either the ORACLE_HOME/network/admin directory or the directory
specified by the TNS_ADMIN environment variable.
2. Verify there is an entry in the tnsnames.ora file for the name given in the
connect string. This net service name should match the name in the
tnsnames.ora file exactly if the name is simple and there is not NAMES_
DEFAULT_DOMAIN in the sqlnet.ora file, or the net service name is a
fully-qualified name. If the net service name in the connect string is simple,
then check the NAMES_DEFAULT_DIRECTORY parameter in the sqlnet.ora
file. Its value is appended to the net service name given in the connect string.
This fully-qualified name should be the entry in the tnsnames.ora file.
3. If you are connecting from a login dialog box, then verify that you are not
placing an at sign (@) before your connect net service name.

 

Activate client tracing and repeat the operation.
When using the directory naming method, do the following:
1. Verify the ldap.ora file exists and is in the correct location. The following
directories are searched for ldap.ora file in the order given. The ldap.ora file
found will be used.
– The directory specified by the TNS_ADMIN environment variable.
– The ORACLE_HOME/network/admin directory.
– The directory specified by the LDAP_ADMIN environment variable.
– The ORACLE_HOME/ldap/admin directory.
2. Verify that the parameters defined in the ldap.ora file are correct, as follows:
– The DIRECTORY_SERVERS parameter defines the correct host and port
for one or more valid LDAP servers.
– The DEFAULT_ADMIN_CONTEXT parameter defines the location of the
Oracle Context in this directory which should include the net service
entry.
If the ldap.ora file does not exist, then these parameters will be resolved
using automatic discovery.
3. Verify that the LDAP server host and port are defined in DNS.
4. Verify that the directory has the default Oracle Context defined.
5. Use the ldapsearch utility or a directory administration tool to verify that the
net service object exists in the Oracle Context at the location given by the value
of the DEFAULT_ADMIN_CONTEXT parameter.
When using the Easy Connect naming method, do the following:
1. Verify that the host name give is correct, and is defined in the local host name
resolution service, such as local hosts file, DNS, and so on.
When using the external naming method, do the following:
1. Verify that the NIS file for tnsnames is properly set up.
2. Check that the net service name matches the tnsnames entry as described in
the preceding local naming section.

■ "Example of Troubleshooting a TNS-12154 Error" on page 16-19
for additional information about troubleshooting the error
■ "Using Localized Management" on page 3-1 for configuration
file location information
■ Chapter 8, "Configuring Naming Methods" for naming
information

Next

ORA-12170: TNS:Connect timeout occurred

Cause: The client failed to establish a connection and complete authentication in
the time specified by the SQLNET.INBOUND_CONNECT_TIMEOUT parameter in the
sqlnet.ora file. This error may be a result of network or system delays, or it may
indicate that a malicious client is trying to cause a denial-of-service attack on the
database server.

Action: If the error occurred due to system or network delays that are normal for
the particular environment, then perform the following steps:
1. Turn on tracing to determine which clients are timing out.
2. Reconfigure the SQLNET.INBOUND_CONNECT_TIMEOUT, SQLNET.SEND_TIMEOUT, or
SQLNET.RECV_TIMEOUT parameters in sqlnet.ora to a larger value.
If you suspect a malicious client, then perform the following steps:
1. Restrict access to the client. For example, you can configure parameters for
access rights in the sqlnet.ora file.
2. Locate the IP address of the client in the sqlnet.log file on the database server
to identify the source. Remember that an IP address can be forged.
For example, the following sqlnet.log excerpt shows a client IP address of
192.168.2.35.
Fatal NI connect error 12170.
VERSION INFORMATION:
TNS for Linux: Version 11.2.0.0.0
Oracle Bequeath NT Protocol Adapter for Linux: Version 11.2.0.0.0
TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.0.0
Time: 03-MAY-2009 13:51:12
Tracing to file: /ora/trace/svr_13279.trc
Tns error struct:
nr err code: 0
ns main err code: 12637
TNS-12637: Packet receive failed
ns secondary err code: 12604

nt main err code: 0
nt secondary err code: 0
nt OS err code: 0
Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.35)(PORT=52996))
If the time out occurs before the IP address can be retrieved by the database
server, then enable listener tracing to determine the client that made the
request.

Next

TNS-12500/ORA-12500: TNS: listener failed to start a dedicated server process

Cause: The listener failed to start the Oracle program. Possible reasons include:
■ The maximum number of processes allowed for a single user was exceeded

The listener does not have execute permission on the Oracle program
■ The associated Microsoft Windows service is not started
In some cases, these errors can be caused by the same conditions which cause the
following errors:
■ TNS-12549/ORA-12549
■ TNS-00519
■ TNS-12540/ORA-12540
■ TNS-00510
■ TNS-12560/ORA-12560
Action: Perform the appropriate action:
■ Increase the number of processes by setting the PROCESSES parameter in the
database initialization file to a larger value.
■ Check the listener.log file for detailed error stack information

Next

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

Cause: The listener received a request to establish a connection to a database or
other service. The connect descriptor received by the listener specified a service
name for a service (usually a database service) that has either not yet dynamically
registered with the listener or has not been statically configured for the listener.
This may be a temporary condition such as after the listener has started, but before
the database instance has registered with the listener.
Action: Perform the following steps:
1. Wait a moment, and then try to connect a second time.
2. Check which services are currently known by the listener by running the
Listener Control utility STATUS or SERVICES command.
3. Check that the SERVICE_NAME parameter in the connect descriptor specifies a
service name known by the listener.
4. Check for an event in the listener.log file.

Next

ORA-12520: TNS:listener could not find available handler for requested type of server

Cause: The type of service handler requested by the client is incorrect or not
registered for the requested SERVICE_NAME/INSTANCE_NAME, or the database
instance is not registered with the listener.
Action: If you suspect the problem is the wrong type of service handler, then
perform the following steps:
1. If (server=value) is set in the connect descriptor, then ensure that the value is
set to the appropriate service handler type for the database, that is, dedicated
for dedicated server or shared for dispatchers. You can use the Listener.

Control utility SERVICES command to see what service handlers are currently
registered with the listener.
2. If USE_DEDICATED_SERVER is set to ON in the sqlnet.ora file, then ensure the
database is configured to use dedicated servers. If it is not, then set this
parameter to OFF.
3. Ensure that the database instance is running. If the instance not running, then
start it so that it can register with the listener

Next

ORA-12521: TNS:listener does not currently know of instance requested in connect descriptor

Cause: The instance name in the connect descriptor is incorrect, or the database
instance is not registered with the listener.
Action: Perform the following steps:
1. Ensure that the service name specified in the connect descriptor is correct.
2. Ensure that the database instance is running. If the instance not running, then
start it so that it can register with the listener. You can use the Listener Control
utility SERVICES

Next

ORA-12525: TNS:listener has not received client's request in time allowed

Cause: The client failed to complete its connect request in the time specified by
the INBOUND_CONNECT_TIMEOUT_listener_name parameter in the listener.ora file.
This error may be a result of network or system delays, or it may indicate that a
malicious client is trying to cause a denial-of-service attack on the listener.
Action: If the error occurred due to system or network delays that are normal for
the particular environment, then reconfigure the INBOUND_CONNECT_TIMEOUT_
listener_name parameter in listener.ora to a larger value.
If you suspect a malicious client, then perform the following steps:
1. Locate the IP address of the client in the listener.log file to identify the
source. Remember that an IP address can be forged.
For example, the following listener.log excerpt shows a client IP address of
192.168.2.35.
03-MAY-2009 16:42:35 * <unknown connect data> *
(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.35)(PORT=53208)) * establish *
<unknown sid> * 12525
TNS-12525: TNS:listener has not received client's request in time
allowed
TNS-12604: TNS: Application timeout occurred

Restrict access to the client. For example, you can configure parameters for
access rights in the sqlnet.ora file.

Next

ORA-12533: TNS:illegal ADDRESS parameters

Cause: The protocol specific parameters in the ADDRESS section of the designated
connect descriptor are incorrect.
Action: Correct the protocol address.

Note: This error is often caused by hand-editing of the tnsnames.ora
file.

 

Next

TNS-12540/ORA-12540: TNS:internal limit restriction exceeded and TNS-00510: Internal limit restriction exceeded

Cause: An internal limit has been exceeded. Possible limits include:
■ Number of open connections that Oracle Net can process simultaneously
■ Number of memory buffers which can be used simultaneously
■ Number of processes a particular database instance is allowed
The first two are examples of hard limits. The third is an example of a limit which
can be increased by setting PROCESSES parameter in the database initialization file
to a larger value. In this case, a TNS-12500/ORA-12500 error is also returned.
In some cases, these errors can be caused by the same conditions which cause
TNS-12549/ORA-12549 and TNS-00519 errors.
Action: Wait for the open connections to close and retry. If the error persists, then
check the sqlnet.log or listener.log file for detailed error stack information.

Next

TNS-12541/ORA-12541: TNS:no listener

Cause: The connection request could not be completed because the listener is not
running.
Action: Perform the following actions:
■ Ensure that the supplied destination address matches one of the addresses
used by the listener.
■ Verify that the listener is running at the address specified by the request.
■ Ensure the listener is listening on the host and port specified by the request.
■ Verify the client is pointing to the listener.

Next

TNS-12549/ORA-12549: TNS:operating system resource quota exceeded and TNS-00519: Operating system resource quota exceeded

Cause: A quota or hard limit imposed by the operating system has been exceeded.
Possible limits include:
■ The maximum number of processes allowed for a single user
■ The operating system is running low on paging space

Action: Perform the appropriate action:
■ Increase the number of processes by setting the PROCESSES parameter in the
database initialization file to a larger value.
■ Check the sqlnet.log or listener.log file for detailed error stack
information, such as an operating system error code to help identify which
quota has been exceeded.

Next

TNS-12560/ORA-12560: TNS:protocol adapter error occurred

Cause: There was an error when using a particular protocol. This error may be
due to incorrect configuration of an ADDRESS parameter or may occur due to errors
returned from the underlying protocol or operating system interface.
In some cases, these errors are caused by the same conditions which cause
TNS-00510, TNS-00519, TNS-12540/ORA-12540, TNS-12549/ORA-12549 errors.
Action: This error occurs on Microsoft Windows systems only. Perform the
following actions:
1. Select Run from the Microsoft Windows Start menu.
2. Enter MSCONFIG in the Open field.
3. Go to the Services tab.
4. Enable OracleServicesid if it is disabled.
5. Restart the computer.
6. Check that Oracle Services has started

Next

What Is AWR

What SI AWR

please remember in order to produce reports, access AWR views, or use the diagnostic information from any part of the Automatic Workload Repository, the Diagnostic Pack License is required. This includes the production of AWR reports, ADDM reports and ASH reports even if these are requested by product support or other agencies.

 

AWR reports are an extremely useful diagnostic tool for the determination of the potential cause of database wide performance issues.

Typically when a performance issue is detected, you would collect an AWR report covering the period of the poor performance. It is best to use a reporting period no longer than 1 hour as otherwise specifics can be lost.

t is also prudent to Gather AWR reports during times when performance is acceptable to provide baselines for comparison when there is a problem.  Ensure that the baseline snapshot duration is the same as the problem duration to facilitate like with like comparison

Automatic Workload Repository (AWR) is a licensed feature that allows information to be recorded on a database for multiple purposes including detection and elimination of performance issues.

Next

How to Generate an AWR Report and Create Baselines

How To Generate A Basic Report

Automatic Workload Repository (AWR) is a collection of persistent system performance statistics owned by the SYS user.
It resides in SYSAUX tablespace.
By default snapshot are generated once every 60min and maintained for 8 days to ensure the capture of an entire week of performance data (7 days in Oracle 10g).

An AWR report outputs a series of statistics based on the differences between snapshots that may be used to investigate performance and other issues.

Running a Basic Report

With appropriate licenses for AWR, you may generate an AWR report by executing
the following script and pick the two snapshots you want to use for the sample;

Steps To Generate a report:

Run the Following against the database with issues:

$ORACLE_HOME/rdbms/admin/awrrpt.sql

Depending on the reasons for collecting the report, the default can be used, or for a more focused view, a short 10-15 minute snapshot could be used.

You will also be asked for the format of the report (text or html) along with the report name.

Generating Various Types of AWR Reports

AWR reports can be generated by running various SQL scripts to satisfy various requirements. Each report is available in HTML or TXT format:

  • awrrpt.sql
    Displays various statistics for a range of snapshots Ids.
  • awrrpti.sql
    Displays statistics for a range of snapshot Ids on a specified database and instance.
  • awrsqrpt.sql
    Displays statistics of a particular SQL statement for a range of snapshot Ids. Run this report to inspect or debug the performance of a particular SQL statement.
  • awrsqrpi.sql
    Displays statistics of a particular SQL statement for a range of snapshot Ids on a specified SQL.
  • awrddrpt.sql
    Compares detailed performance attributes and configuration settings between two selected time periods.
  • awrddrpi.sql
    Compares detailed performance attributes and configuration settings between two selected time periods on a specific database and instance.

 

Next

AWR Snapshots

How to Modify the AWR SNAPSHOT SETTINGS:

BEGIN
  DBMS_WORKLOAD_REPOSITORY.modify_snapshot_settings(
    retention => 43200,        -- Minutes (43200 = 30 Days).
                               -- Current value retained if NULL.
    interval  => 30);          -- Minutes. Current value retained if NULL.
END;
/

Next

Creating a SNAPSHOT Manually

BEGIN
  DBMS_WORKLOAD_REPOSITORY.create_snapshot();
END;
/

Next

Dropping the AWR snaps in range

BEGIN
  DBMS_WORKLOAD_REPOSITORY.drop_snapshot_range(
(low_snap_id=>40,
High_snap_id=>80);
END;
/

Next

New Lesson

AWR Baselines

Creating a Baseline

BEGIN
  DBMS_WORKLOAD_REPOSITORY.create_baseline (
    start_snap_id => 10, 
    end_snap_id   => 100,
    baseline_name => 'AWR First baseline');
END;
/

In 11g, there is a newly introduced procedure DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE_TEMPLATE that specifies a template for how baselines should be created for future time periods:

BEGIN
DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE_TEMPLATE (
start_time => to_date('&start_date_time','&start_date_time_format'),
end_time => to_date('&end_date_time','&end_date_time_format'),
baseline_name => 'MORNING',
template_name => 'MORNING',
expiration => NULL ) ;
END;
/

 

"expiration => NULL" means that this baseline will be kept forever.

Next

Dropping an AWR baseline

BEGIN
DBMS_WORKLOAD_REPOSITORY.DROP_BASELINE (baseline_name => 'AWR First baseline');
END;
/

 

ou can also drop a baseline created on a different or old database:

BEGIN
DBMS_WORKLOAD_REPOSITORY.DROP_BASELINE (baseline_name => 'peak baseline',cascade => FALSE, dbid => 3310949047);
END;
/

 

We can also specify a template for creating and dropping baseline based on repeating time periods:

 

BEGIN
DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE_TEMPLATE (
day_of_week => 'MONDAY',
hour_in_day => 9,
duration => 3,
start_time => to_date('&start_date_time','&start_date_time_format'),
end_time => to_date('&end_date_time','&end_date_time_format'),
baseline_name_prefix => 'MONDAY_MORNING'
template_name => 'MONDAY_MORNING',
expiration => 30 );
END;
/[Insert code here]

Next

New Lesson

Workload Repository Views

Workload Repository Views

Workload Repository Views

The following workload repository views are available:

  • V$ACTIVE_SESSION_HISTORY - Displays the active session history (ASH) sampled every second.
  • V$METRIC - Displays metric information.
  • V$METRICNAME - Displays the metrics associated with each metric group.
  • V$METRIC_HISTORY - Displays historical metrics.
  • V$METRICGROUP - Displays all metrics groups.
  • DBA_HIST_ACTIVE_SESS_HISTORY - Displays the history contents of the active session history.
  • DBA_HIST_BASELINE - Displays baseline information.
  • DBA_HIST_DATABASE_INSTANCE - Displays database environment information.
  • DBA_HIST_SNAPSHOT - Displays snapshot information.
  • DBA_HIST_SQL_PLAN - Displays SQL execution plans.
  • DBA_HIST_WR_CONTROL - Displays AWR settings.

Automation of AWR reports ?

There is no product functionality to produce the AWR reports in an automated way. In regards to the Oracle product, the production of a report is a manual step. However, one could use the dbms_workload_repository.awr_report_text in a (bash for instance for Unix like OS's) script. It would be scheduled (using the crontab for Unix like OS's) and be instructed with or determine the variables to provide to the awr_report_text function. There are such scripts available on the web, but not officially provided by Oracle as part of the product.

License Needed to Use AWR

Please remember that in order to use AWR license is needed.  Statspack can be used if AWR license is not acquired. See:

Document 1490798.1 AWR Reporting - Licensing Requirements Clarification

Next

How to Generate an AWR Report and Create Baselines (Doc ID 748642.1)

New Lesson

AWR Report Interpretation Checklist

Implement findings from an ADDM report from the same snapshot interval

The ADDM report for the same period as that covered by the snapshot interval can identify and suggest potential resolution options for many issues. The ADDM report provides a number of recommendations on various areas such as CPU bottlenecks, undersized memory structures, I/O capacity issues, high-load SQL statements etc. that otherwise may need experience and/or be difficult and time consuming to produce. For more on ADDM reports see

 

AWR1

Next

Review Overall picture from AWR header information

The header section contains useful information that can help set the context of the report you are looking at. For example, the report contains a number of sections that quote specific counts of various statistics. Without a timescale, these numbers are meaningless.

awr3

 

  • Release
    Depending on the problem, the database version may be important. If the version is old or is not the latest patchset release then the most up to date fixes may not be applied which has the potential to open the database up to issues.
  • RAC
    If the database is running in a Real Application Cluster configuration then you may need to look at information from the other instances to get a full picture of the database performance
  • Platform
    There may be platform specific issues that have a bearing on the system
  • CPUs/Cores
    In a multi-processor environment, the "wall clock" time is not necessarily a good indicator of how much work the database can do since multiple operations can be pursued simultaneously. You can use cores for an indication of how much CPU work can likely be done at once.
  • Snap Time
    The Snap time shows the times for the starting and ending snapshots for the report period. Does this cover the time of problem that is being encountered?
  • Elapsed time
    The elapsed time indicates the duration of the report between the 2 selected snapshots. Any other duration figures can be compared back to this. When looking at this figure, is the duration reasonable? If the duration is too short then important information may be missed. If it is too long then findings may be diluted. A 30-60 minute reporting period is usually recommended. In terms of AWR snapshots, as much as possible snapshots should be minimum 10 minutes, maximum 30 minutes.
  • DB time
    The DB Time is the time spent in the database for the period of the report. If this is significantly higher than the Elapsed time then this is a good indicator of a heavily loaded system. Remember that on a multi-processor system, you might expect the DB Time to be able to exceed the elapsed time. Additionally, the db time includes the time waiting for the CPU to become available, so this number can be higher than the Elapsed time X Cores.
    In the example above, the numbers say that the database worked for 2193 minutes in 15 minutes of elapsed time. Whether that is an indication of a problem depends on the capacity and concurrency capabilities of the system. Looking at the numbers, 2193:15 is a ratio of 146:1, so, in this case, if they had significantly less than 146 cpus it is likely that there is some overloading issues.  Remember that the user perception is also a significant factor in whether there is a "performance issue" - if the system delivers what the users want then there might not be a problem!
  • Sessions
    You can use the sessions information along with the DB time to give an average amount of DB time per session. Are there a large number or a small number of connections?

 

Next

Check the Load profile to use later in the context of the top waits

The load profile section can provide you with a more detailed impression of where the database is loaded. Information is provided "Per Second" and "Per Transaction" for most statistics and also "Per Exec" and "Per Call" for DB Time and CPU.

 

awr4

 

Suggested interpretations:

  • DB CPU(s)
    The DB CPU(s) figure shows the amount of the CPU being used by the database. You can use this alongside the actual number of cores to give you an idea of how much of the total available machine CPU is actually being used by this instance.
  • DB Time(s) Here the "Per Second" information gives you another version of the total DB time used, just in this case expressed as every second as opposed to the full elapsed period.

Other statistics should be looked at within the context of the overall elapsed time and also in the context of the top waits, once you have looked at these later. For example:

  • Top events indicate library cache or cursor contention
    In this case it would be sensible to look at the load in terms of Parse and Hard Parse statistics. The number of parses per execution could also be a relevant indicator
  • Top events are related to reading of blocks
    In this case, do we see mainly physical or logical reads? If it is physical then are the explain plans for top queries such as to encourage more logical reads?

Next

Instance Efficiency Percentages

Looking at these in the context of a specific wait is far more beneficial than attempting to reach 100%. If the bottleneck is elsewhere, attempting to change individual statistics will have little or no impact on the overall system. For example, in the Instance Efficiency Percentages above, the "Buffer Hit %" is 99.88%. If there is no contention for buffers and no waits for buffers, then what is the benefit in making changes to try to improve this number? 

You should also look at the numbers in the context of the other numbers. For example, in the case above, let us say that there is a performance issue and the top timed events showed that CPU usage was a significant resource. Looking at the "Parse CPU to Parse Elapsd %" alone, this says that 26.87% of the total parse time is CPU and maybe you would prefer a lower percentage (although 26% seems quite reasonable).  Since the:  "% Non-Parse CPU" is 98.07% this means that only 1.03% of the total CPU usage is parsing, so even if you reduced that 26.87% to the impossible value of zero then you would only gain 1% extra CPU overall. It is likely that you would need to look elsewhere for the cause of your CPU resource issue.

 

Examine Top 5 Timed Events for highest resource users

Once you have looked at the background information, the Top 5 Timed Events section is the place to start in order to tell what is taking up the largest proportion of the database time. Based upon the general feeling for the system, the top resource users are put in context and can be investigated to determine a root cause. This topic is covered in more detail in the following article:

Document 1359094.1 How to Use AWR Reports to Diagnose Database Performance Issues
awr5 awr6

Again, instance efficiency stats are more use for general tuning as opposed to addressing specific issues (unless waits point at these).

Instance Efficiency Percentages (Target 100%)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           Buffer Nowait %:   99.91       Redo NoWait %:  100.00
           Buffer  Hit   %:   98.14    In-memory Sort %:   99.98
           Library Hit   %:   99.91        Soft Parse %:   94.48
        Execute to Parse %:   99.45         Latch Hit %:   99.97
Parse CPU to Parse Elapsd %:   71.23     % Non-Parse CPU:   99.00

The most important Statistic presented here from the point of view of our example is the '% Non-Parse CPU' because this indicates that almost all the CPU  time that we see in the Top Waits section is attributable to Execution and not parse, which means that tuning SQL may help to improve this.

If we were tuning, then 94.48% soft parse rate would show a small proportion of hard parsing which is desirable.  The high execute to parse % indicates good usage of cursors.  Generally, we want the statistics here close to 100%, but remember that a few percent may not be relevant dependent on the application.  For example, in a data warehouse environment, hard parsing may be higher due to usage of materialized views and, or histograms.  So again comparing to baseline report when performance was good is important.

Next

Examine Top 5 Timed Events for highest resource users

Once you have looked at the background information, the Top 5 Timed Events section is the place to start in order to tell what is taking up the largest proportion of the database time. Based upon the general feeling for the system, the top resource users are put in context and can be investigated to determine a root cause. This topic is covered in more detail in the following article:

Document 1359094.1 How to Use AWR Reports to Diagnose Database Performance Issues
awr6

The Top 5 Timed Foreground Events  is ordered by percentage of the total database time used. Something with a high percentage and a high time is likely to be  using the most database resource. The "avg wait(ms)" is the average time for all the waits in the period. The average could be made up with everything close to the average, a few peaks and lots of lower values or a mixture. Whether an average is a high value or not is dependent on the operation. Without significant contention, you would expect latches to be waited on for less than 1 or 2 milliseconds. If they are being held for long periods then that is likely to be causing significant problems. For ther waits it may be possible to have longer waits and still have acceptable overall performance. Remember to keep any waits in context of the overall time spent and proportion of the total database time. A single 50 millisecond wait for a latch in an hour is unlikely to even register in the top 5. Don't focus on that at the expense of the 500 million 2 millisecond waits for the different latch that is taking all your resources!

Note that some waits for wait events will be expected based upon your activity. For example if you are running a large number of SQL statements heavily using Parallel Execution, then you will start to see Parallel Query events appearing in your Top 5 events simply because the management of the parallel query infrastructure takes up resource. It does not necessarily mean that there is a problem. However, if your users start to report performance degradation at this time then you might want to look at how efficiently these queries are running and whether it is unrealistic to expect the system to cope with the load being imposed on it at that time.

Where do we find the "event XYZ" in the AWR? It is not listed in the top waits.

If an event did not account for any "meaningful" amount of time then it might not show up at all. Remember AWR shows only what is significant to your system.

op 5 Timed Events

As mentioned, the Top waits section is the most important single section in the whole report being as it quantifies and allows comparison of the primary diagnostic: what each session is waiting for. An example output is provided below:

Top 5 Timed Events                                         Avg %Total
~~~~~~~~~~~~~~~~~~                                        wait   Call
Event                                 Waits    Time (s)   (ms)   Time Wait Class
------------------------------ ------------ ----------- ------ ------ ----------
db file scattered read           10,152,564      81,327      8   29.6   User I/O
db file sequential read          10,327,231      75,878      7   27.6   User I/O
CPU time                                         56,207          20.5
read by other session             4,397,330      33,455      8   12.2   User I/O
PX Deq Credit: send blkd             31,398      26,576    846    9.7      Other
         -------------------------------------------------------------

The Top 5 Waits section reports on a number of useful topics related to Events. It records the number of waits encountered in the period and the total time spent waiting together with the average time waited for each event. The section is ordered by the %age of the total call time that each Event is responsible for.

Dependent on what is seen in this section, other report sections may need to be referenced in order to quantify or check the findings. For example, the wait count for a particular event needs to be assessed based upon the duration of the reporting period and also the number of users on the database at the time; 10 Million waits in 10 minutes is far more significant than 10 Million in 10 hours, or if shared among 10 users as opposed to 10,000.

In this example report, almost 60% of the time is spent waiting for I/O related reads.

  • Event 'db file scattered read ' is typically used when fetching blocks for a full table scan index fast full scan and performs multi-block IO.
  • Event 'db file sequential read'  is a single block read and is typically engaged for any activity where  multi-block IO is unavailable (for example index reads).

Another 20% of the time is spent waiting for or using CPU time. High CPU usage is often a symptom of poorly tuned SQL (or at least SQL which has potential to take less resource) of which excessive I/O can also be a symptom. More on CPU usage follows later.

Based on this, we would investigate whether these waits indicate a problem or not. If so, resolve the problem, if not, move on to the next wait to determine if that is a potential cause.

There are 2 main reasons why I/O related waits are going to be top of the waits:

  • The database is doing lots of reads
  • The individual reads are slow

The Top 5 events show us information that helps us here :

  • Is the database doing lots of reads?:
    The section shows > 10 Million reads for each of these events in the period.
    Whether this is a lot depends on whether the report duration is 1 hour or 1 minute.
    Check the report duration to asses this.
    If the reads do seem excessive, then why would the database do a lot of reads?
    The database only reads data because the execution of SQL statements has instructed it to do so. To investigate further refer to the SQL Statistics Section.
  • Are the individual reads slow?
    The section shows waits of <=8 ms for the 2 I/O related events.
    Whether this is fast or slow is dependent on the hardware underlying the I/O subsystem, but typically anything under 20 ms is acceptable.If the I/O was slow, then you can get further information from the 'Tablespace IO Stats ' section:

    Tablespace IO Stats                       DB/Inst: VMWREP/VMWREP  Snaps: 1-15
    -> ordered by IOs (Reads + Writes) desc
    
    Tablespace
    ------------------------------
                    Av      Av     Av                       Av     Buffer Av Buf
            Reads Reads/s Rd(ms) Blks/Rd       Writes Writes/s      Waits Wt(ms)
    -------------- ------- ------ ------- ------------ -------- ---------- ------
    TS_TX_DATA
       14,246,367     283    7.6     4.6  145,263,880    2,883  3,844,161    8.3
    USER
          204,834       4   10.7     1.0   17,849,021      354     15,249    9.8
    UNDOTS1
           19,725       0    3.0     1.0   10,064,086      200      1,964    4.9
    AE_TS
        4,287,567      85    5.4     6.7          932        0    465,793    3.7
    TEMP
        2,022,883      40    0.0     5.8      878,049       17          0    0.0
    UNDOTS3
        1,310,493      26    4.6     1.0      941,675       19         43    0.0
    TS_TX_IDX
        1,884,478      37    7.3     1.0       23,695        0     73,703    8.3
    SYSAUX
          346,094       7    5.6     3.9      112,744        2          0    0.0
    SYSTEM
         101,771       2    7.9     3.5       25,098        0        653    2.7

    Specifically, look for the timing under Rd(ms).  If it is higher than 20 milliseconds per read and reads are high, then you may want to start investigating a potential I/O bottleneck from the os.

Next

New Lesson

How to Use AWR Reports to Diagnose Database Performance Issues (Doc ID 1359094.1)

New Lesson

Oracle Performance Method

Intro

Performance tuning using the Oracle performance method is driven by identifying and eliminating bottlenecks in the database, and by developing efficient SQL statements. Database tuning is performed in two phases: proactively and reactively.

In the proactive tuning phase, you must perform tuning tasks as part of your daily database maintenance routine, such as reviewing ADDM analysis and findings, monitoring the real-time performance of the database, and responding to alerts.

In the reactive tuning phase, you must respond to issues reported by users, such as performance problems that may occur for only a short duration of time, or performance degradation to the database over a period of time.

SQL tuning is an iterative process to identify, tune, and improve the efficiency of high-load SQL statements.

Applying the Oracle performance method involves the following:

To improve database performance, you must apply these principles iteratively.

Next

Step 1: Preparing the Database for Tuning

Step 2: Tuning the Database Proactively

Step 1: Preparing the Database for Tuning

Get feedback from users.

Determine the scope of the performance project and subsequent performance goals, and determine performance goals for the future. This process is key for future capacity planning.

Next

Check the operating systems of all systems involved with user performance

Check for hardware or operating system resources that are fully utilized. List any overused resources for possible later analysis. In addition, ensure that all hardware is functioning properly

Next

Ensure that the STATISTICS_LEVEL

Ensure that the STATISTICS_LEVEL initialization parameter is set to TYPICAL (default) or ALL to enable the automatic performance tuning features of Oracle Database, including AWR and ADDM.

Next

Check The CONTROL_MANAGEMENT_PACK_ACCESS

Ensure that the CONTROL_MANAGEMENT_PACK_ACCESS initialization parameter is set to DIAGNOSTIC+TUNING (default) or DIAGNOSTIC to enable ADDM

Next

Step 2: Tuning the Database Proactively

Review the ADDM findings

ADDM automatically detects and reports on performance problems with the database, including most of the "Common Performance Problems Found in Databases". The results are displayed as ADDM findings on the Database Home page in Oracle Enterprise Manager Cloud Control (Cloud Control). Reviewing these findings enables you to quickly identify the performance problems that require your attention.

ADDM is diagnostic software built into Oracle Database. ADDM examines and analyzes data captured in Automatic Workload Repository (AWR) to determine possible database performance problems. ADDM then does the following:

  • Locates the root causes of the performance problems
  • Provides recommendations for correcting them
  • Quantifies the expected benefits
  • Identifies areas where no action is necessary.

This section contains the following topics:

 

 

ADDM Analysis

An ADDM analysis is performed after each AWR snapshot (every hour by default), and the results are saved in the database. You can then view the results using Cloud Control.

The ADDM analysis is performed from the top down, first identifying symptoms and then refining the analysis to reach the root causes of performance problems. ADDM uses the DB time statistic to identify performance problems. Database time (DB) time is the cumulative time spent by the database in processing user requests, including both the wait time and CPU time of all user sessions that are not idle.

The goal of database performance tuning is to reduce the DB time of the system for a given workload. By reducing DB time, the database can support more user requests by using the same or fewer resources. ADDM reports system resources that are using a significant portion of DB time as problem areas and sorts them in descending order by the amount of related DB time spent. For more information about the DB time statistic, see "Time Model Statistics".

 

 

ADDM Recommendations

In addition to diagnosing performance problems, ADDM recommends possible solutions. When appropriate, ADDM recommends multiple solutions from which you can choose. ADDM recommendations include the following:

  • Hardware changesAdding CPUs or changing the I/O subsystem configuration
  • Database configurationChanging initialization parameter settings
  • Schema changesHash partitioning a table or index, or using automatic segment space management (ASSM)
  • Application changesUsing the cache option for sequences or using bind variables
  • Using other advisorsRunning SQL Tuning Advisor on high-load SQL statements or running the Segment Advisor on hot objects

ADDM benefits apply beyond production systems. Even on development and test systems, ADDM can provide an early warning of potential performance problems.

Performance tuning is an iterative process. Fixing one problem can cause a bottleneck to shift to another part of the system. Even with the benefit of the ADDM analysis, it can take multiple tuning cycles to reach a desirable level of performance.

 

 

ADDM for Oracle Real Application Clusters

In an Oracle Real Application Clusters (Oracle RAC) environment, you can use ADDM to analyze the throughput performance of a database cluster. ADDM for Oracle RAC considers DB time as the sum of database times for all database instances and reports findings that are significant at the cluster level. For example, the DB time of each cluster node may be insignificant when considered individually, but the aggregate DB time may be a significant problem for the cluster as a whole.

See Also:

 

Configuring Automatic Database Diagnostic Monitor

 

 

Setting Initialization Parameters to Enable ADDM

Automatic database diagnostic monitoring is enabled by default and is controlled by the CONTROL_MANAGEMENT_PACK_ACCESS and the STATISTICS_LEVEL initialization parameters.

Set CONTROL_MANAGEMENT_PACK_ACCESS to DIAGNOSTIC+TUNING (default) or DIAGNOSTIC to enable automatic database diagnostic monitoring. Setting CONTROL_MANAGEMENT_PACK_ACCESS to NONE disables many Oracle Database features, including ADDM, and is strongly discouraged.

Set STATISTICS_LEVEL to TYPICAL (default) or ALL to enable automatic database diagnostic monitoring. Setting STATISTICS_LEVEL to BASIC disables many Oracle Database features, including ADDM, and is strongly discouraged.

To determine whether ADDM is enabled:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Administration menu, select Initialization Parameters.If the Database Login page appears, then log in as a user with administrator privileges. The Initialization Parameters page appears.
  3. In the Name field, enter statistics_level and then click Go.The Initialization Parameters table shows the setting of this initialization parameter.

  4. Do one of the following:
    • If the Value list shows ALL or TYPICAL, then do nothing.
    • If the Value list shows BASIC, then select ALL or TYPICAL, and then click Apply.
  5. In the Name field, enter control_management_pack_access, and then click Go.The table shows the setting of this initialization parameter.
  6. Do one of the following:
    • If the Value column shows DIAGNOSTIC or DIAGNOSTIC+TUNING, then do nothing.
    • If the Value column shows NONE, then select DIAGNOSTIC or DIAGNOSTIC+TUNING and click Apply.

See Also:

 

 

Setting the DBIO_EXPECTED Parameter

ADDM analysis of I/O performance partially depends on a single argument, DBIO_EXPECTED, that describes the expected performance of the I/O subsystem. The value of DBIO_EXPECTED is the average time it takes to read a single database block, in microseconds. Oracle Database uses the default value of 10 milliseconds, which is an appropriate value for most hard drives. You can choose a different value based on the characteristics of your hardware.

To determine the correct setting for the DBIO_EXPECTED initialization parameter:

  1. Measure the average read time of a single database block for your hardware.This measurement must be taken for random I/O, which includes seek time if you use standard hard drives. Typical values for hard drives are between 5000 and 20000 microseconds. See Oracle Database Performance Tuning Guide to learn how to assess the I/O capability of the storage subsystem.
  2. Set the value one time for all subsequent ADDM executions.For example, if the measured value is 8000 microseconds, then execute the following PL/SQL code as the SYS user:
    EXECUTE DBMS_ADVISOR.SET_DEFAULT_TASK_PARAMETER(
                         'ADDM', 'DBIO_EXPECTED', 8000);
    

 

Next

Implement the ADDM recommendations

Implement the ADDM recommendations, as described in Automatic Database Performance Monitoring.

With each ADDM finding, ADDM automatically provides a list of recommendations for reducing the impact of the performance problem. Implementing a recommendation applies the suggested changes to improve the database performance

Next

Monitor performance problems with the database in real time

The Performance page in Cloud Control enables you to identify and respond to real-time performance problems. By drilling down to the appropriate pages, you can identify and resolve performance problems with the database in real time, without having to wait until the next ADDM analysis.

10/22

4 Monitoring Real-Time Database Performance

The Automatic Database Diagnostic Monitor (ADDM) automatically identifies performance problems with the database, as described in Automatic Database Performance Monitoring. Information on performance appears on the Performance page in Oracle Enterprise Manager Cloud Control (Cloud Control).

By drilling down to other pages from the Performance page, you can identify database performance problems in real time. If you find a problem, then you can run ADDM manually to analyze it immediately without having to wait until the next ADDM analysis. To learn how to run ADDM manually, see "Manually Running ADDM to Analyze Current Database Performance".

This chapter describes how to monitor some aspects of database activity. It contains the following sections:

 

Monitoring User Activity

As described in Oracle Database Performance Method , database time (DB time) is an indicator of the total database instance workload. The average active sessions for a time period equals the total database time of all user sessions during the period divided by the elapsed time (wall-clock time) for the period.

The Average Active Sessions chart on the Performance page shows the average active sessions for CPU usage and wait classes in the time period. By following the performance method explained in Oracle Database Performance Method , you can drill down from the chart to identify the causes of instance-related performance issues and resolve them.

To monitor user activity:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Performance menu, select Performance Home.If the Database Login page appears, then log in as a user with administrator privileges. The Performance page appears.
  3. Locate any spikes or other areas of interest in the Average Active Sessions stacked area chart.Figure 4-1 shows an example of the Average Active Sessions chart on the Performance page.

    Figure 4-1 Average Active Sessions Chart

    Description of Figure 4-1 follows
    Description of "Figure 4-1 Average Active Sessions Chart"

    Each color-filled area on the stacked area chart shows the average active sessions for the specified event at the specified time. In the chart, the average active sessions amount for each event is stacked upon the one below it. The events appear on the chart in the order shown in the legend, with CPU starting at zero on the y-axis and the other events stacked in ascending order, from CPU Wait to Other. The wait classes show how much database activity is consumed by waiting for a resource such as disk I/O.

    For example, in Figure 4-1 at approximately 1:26 p.m., five events consume database time in the sampled time interval: CPU, CPU Wait, Scheduler, Concurrency, and Other. The combined average active sessions total is 2.1. The average active sessions value for CPU is about 1.52, for CPU Wait it is about .38, for Scheduler it is about .03, for Concurrency it is about .16, and for Other it is about .01.

    The CPU Cores line at 2 on the y-axis indicates the number of CPUs on the host system. When the CPU value reaches the CPU Cores line, the database instance is consuming 100 percent of CPU time on the system.

    In Figure 4-1, the chart shows that most of the activity occurred from 1:20 to 1:28 and from about 1:53 to 2:20. Most of the activity between 1:20 and 1:28 was CPU usage, as was most of the activity after about 1:59. Wait class activity spiked a few times between 1:56 and 2:12, and consumed a significant amount of database time from about 1:52 to about 2:08.

  4. To identify each wait class, move your cursor over the area in the Average Active Sessions chart that corresponds to the class.The corresponding wait class is highlighted in the chart legend.
  5. Click the largest area of color on the chart or the corresponding wait class in the legend to drill down to the wait class with the most average active sessions.If you click CPU or CPU Wait, then the Active Sessions Working: CPU + CPU Wait page appears. If you click a different wait class, such as User I/O, then an Active Sessions Waiting page for that wait class appears. Figure 4-2 shows the Active Sessions Working: CPU + CPU Wait page.

    Figure 4-2 Active Sessions Working Page

    Description of Figure 4-2 follows
    Description of "Figure 4-2 Active Sessions Working Page"

    The Active Sessions Working page shows a 1-hour timeline. Details for each wait class are shown in 5-minute intervals under Detail for Selected 5 Minute Interval.

    You can view the details of wait classes in different dimensions by proceeding to one of the following sections:

  6. To change the selected time interval, drag the shaded area on the chart to a different interval.The information contained in the Detail for Selected 5 Minute Interval section is automatically updated to display the selected time period.In the example shown in Figure 4-2, the 5 -minute interval from 9:59 to 10:04 is selected for the CPU and CPU wait class.
  7. If you discover a performance problem, then you can attempt to resolve it in real time. On the Performance page, do one of the following:

 

 

Monitoring Top SQL

On the Active Sessions Working page, the Top Working SQL table shows the database activity for actively running SQL statements that are consuming CPU resources. The Activity (%) column shows the percentage of this activity consumed by each SQL statement. If one or several SQL statements are consuming most of the activity, then you should investigate them.

To monitor the top working SQL statements:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click the CPU or CPU Wait area on the chart or the corresponding wait class in the legend.The Active Sessions Working page appears.
  3. In the Top Working SQL table, click the SQL ID link of the most active SQL statement. For example, in Figure 4-2, the SQL ID of the most active SQL statement is ddthrb7j9a63f.The SQL Details page appears.For SQL statements that are consuming the majority of the wait time, use SQL Tuning Advisor or create a SQL tuning set to tune the problematic SQL statements.

 

 

Monitoring Top Sessions

A session is a logical entity in the database instance memory that represents the state of a current user login to the database. A session lasts from the time a user logs in to the database until the user disconnects. For example, when a user starts SQL*Plus, the user must provide a valid database user name and password to establish a session. If a single session is consuming the majority of database activity, then you should investigate it.

To monitor the top working sessions:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click the CPU or CPU Wait area on the chart or the corresponding wait class in the legend.The Active Sessions Working: CPU + CPU Wait page appears, as shown in Figure 4-2.
  3. Under Detail for Selected 5 Minute Interval, in the Top Working Sessions section, from the View list select Top Sessions.The Top Working Sessions table appears. The table displays the top sessions waiting for the corresponding wait class during the selected time period.
  4. In the Top Working Sessions table, click the Session ID link of the session consuming the most database activity.The Session Details page appears.This page contains information such as session activity, session statistics, open cursors, blocking sessions, wait event history, and parallel SQL for the selected session.If a session is consuming too much database activity, then consider clicking Kill Session, and then tuning the SQL statement.

See Also:

 

 

Monitoring Top Services

A service is a group of applications with common attributes, service-level thresholds, and priorities. For example, the SYS$USERS service is the default service name used when a user session is established without explicitly identifying a service name. The SYS$BACKGROUND service consists of all database background processes. If a service is using the majority of the wait time, then you should investigate it.

To monitor a service:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click a colored area on the chart or the corresponding wait class in the legend.The Active Sessions Working page appears.
  3. Under Detail for Selected 5 Minute Interval, select Top Services from the View list.The Top Services table appears.

    Figure 4-3 Monitoring Top Services

    Description of Figure 4-3 follows
    Description of "Figure 4-3 Monitoring Top Services"

    The Top Services table displays the top services waiting for the corresponding wait event during the selected time period. For example, in Figure 4-3, the SYS$USERS service is consuming 86.47% of database activity.

  4. Click the Service link of the most active service.The Service page appears.This page contains information about the modules, activity, and statistics for the selected service.

 

 

Monitoring Top Modules

Modules represent the applications that set the service name as part of the workload definition. For example, the DBMS_SCHEDULER module may assign jobs that run within the SYS$BACKGROUND service. If a single module is using the majority of the wait time, then it should be investigated.

To monitor a module:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click a colored area on the chart or the corresponding wait class in the legend.The Active Sessions Working page appears.
  3. Under Detail for Selected 5 Minute Interval, select Top Modules from the View list.The Top Modules table appears.

    Figure 4-4 Monitoring Top Modules

    Description of Figure 4-4 follows
    Description of "Figure 4-4 Monitoring Top Modules"

    The Top Modules table displays the top modules waiting for the corresponding wait event during the selected time period. For example, in Figure 4-4, the SQL*Plus module is consuming over 84% of database activity and should be investigated. As shown in Figure 4-2, the SQL*Plus sessions for user HR are consuming a huge percentage of database activity.

  4. Click the Module link of the module that is showing the highest percentage of activity.The Module page appears.This page contains information about the actions, activity, and statistics for the selected module.

 

 

Monitoring Top Actions

Actions represent the jobs that are performed by a module. For example, the DBMS_SCHEDULER module can run the GATHER_STATS_JOB action to gather statistics on all database objects. If a single action is using the majority of the wait time, then you should investigate it.

To monitor an action:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click a colored area on the chart or the corresponding wait class in the legend.The Active Sessions Working page appears.
  3. Under Detail for Selected 5 Minute Interval, select Top Actions from the View list.The Top Actions table appears.

    Figure 4-5 Monitoring Top Actions

    Description of Figure 4-5 follows
    Description of "Figure 4-5 Monitoring Top Actions"

    The Top Actions table displays the top actions waiting for the corresponding wait event during the selected time period. For example, in Figure 4-5, the SALES_INFO action associated with the SQL*Plus module is consuming 40.3% of the database activity, while EMP_DML is consuming 39.55% and EMP_Query is consuming 4.48%. This information is consistent with Figure 4-2, which shows that the database sessions for user HR are consuming over 82% of database activity.

  4. Click the Action link of the most active action.The Action page appears.This page contains statistics for the selected action.

 

 

Monitoring Top Clients

A client can be a web browser or any client process that initiates a request for the database to perform an operation. If a single client is using the majority of the wait time, then you should investigate it.

To monitor a client:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click a colored area on the chart or the corresponding wait class in the legend.The Active Sessions Working page appears.
  3. Under Detail for Selected 5 Minute Interval, select Top Clients from the View list.The Top Clients table appears.

    Figure 4-6 Monitoring Top Clients

    Description of Figure 4-6 follows
    Description of "Figure 4-6 Monitoring Top Clients"

    The Top Clients table displays the top clients waiting for the corresponding wait event during the selected time period. For example, in Figure 4-6, client1 and client2 are consuming the majority of the database activity.

  4. Click the Client ID link of the most active client.The Clients page appears.This page contains statistics for the selected client process.

 

 

Monitoring Top PL/SQL

If a single PL/SQL subprogram is using the majority of the wait time, then you should investigate it.

To monitor a PL/SQL subprogram:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click a colored area on the chart or the corresponding wait class in the legend.The Active Sessions Working page appears.
  3. Under Detail for Selected 5 Minute Interval, select Top PL/SQL from the View list.The Top PL/SQL table appears.

    Figure 4-7 Monitoring Top PL/SQL

    Description of Figure 4-7 follows
    Description of "Figure 4-7 Monitoring Top PL/SQL"

    The Top PL/SQL table displays the top PL/SQL subprograms waiting for the corresponding wait event during the selected time period. For example, in Figure 4-7, the SYS.DBMS_AQ.LISTEN#2 subprogram is consuming 100% of database activity.

  4. Click the PL/SQL Subprogram link of the most active subprogram.The PL/SQL Subprogram page appears.This page contains statistics for the selected subprogram.

 

 

Monitoring Top Files

Data on the average wait time for specific files is available from the Active Sessions Waiting: User I/O page.

To monitor a file:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click the User I/O area on the chart or the corresponding wait class in the legend.The Active Sessions Waiting: User I/O page appears.
  3. Under Detail for Selected 5 Minute Interval, select Top Files from the View list.The Top Files table appears.

    Figure 4-8 Monitoring Top Files

    Description of Figure 4-8 follows
    Description of "Figure 4-8 Monitoring Top Files"

    The Top Files table displays the average wait time for specific files during the selected time period. For example, in Figure 4-8 75% of the wait times are associated with I/O to the files in the SYSTEM and SYSAUX tablespaces.

  4. Click the Tablespace link of the file with the highest average wait time.The View Tablespace page appears.

 

 

Monitoring Top Objects

Data on the top database objects waiting for resources is available from the Active Sessions Waiting: User I/O page.

To monitor an object:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click the User I/O area on the chart or the corresponding wait class in the legend.The Active Sessions Waiting: User I/O page appears.
  3. Under Detail for Selected 5 Minute Interval, select Top Objects from the View list.The Top Objects table appears.

    Figure 4-9 Monitoring Top Objects

    Description of Figure 4-9 follows
    Description of "Figure 4-9 Monitoring Top Objects"

    The Top Objects table displays the top database objects waiting for the corresponding wait event during the selected time period.

    For example, Figure 4-9 shows that over 84% of the waits are for an object whose name is unavailable. Based on the information in Figure 4-2, you can conclude that the performance problem is caused by the query and modification DML statements.

  4. Click the Object Name link of the object with the highest average wait time.The View page for the object appears.

 

Monitoring Instance Activity

Below the Average Active Sessions chart on the Performance page are other charts that you can use to monitor database instance activity. As explained in "Customizing the Database Performance page", you can also customize the Performance page so that the most useful instance activity charts are displayed by default.

You can use the instance activity charts to perform the following tasks:

 

 

Monitoring Throughput

Database throughput measures the amount of work the database performs in a unit of time. The Throughput charts show any contention that appears in the Average Active Sessions chart.

Compare the peaks on the Throughput charts with the peaks on the Average Active Sessions chart. If the Average Active Sessions chart displays a large number of sessions waiting, indicating internal contention, but throughput is high, then the situation may be acceptable. The database is probably also performing efficiently if internal contention is low but throughput is high. However, if internal contention is high but throughput is low, then consider tuning the database.

To monitor throughput:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Performance menu, select Performance Home.If the Database Login page appears, then log in as a user with administrator privileges. The Performance page appears.
  3. Click the Throughput tab.
  4. Select one of the following Instance Throughput Rate options.
    • Per SecondTwo charts appear. One shows the number of logons and transactions per second and the other shows the physical reads and redo size per second.Figure 4-10 shows the Throughput charts with the Instance Throughput Rate of Per Second selected. The bar in the middle of the figure indicates a portion of the charts (from approximately 1:37 to 1:52) that has been removed for space considerations. In Figure 4-10, the most transactions occurred from 1:15 to 1:27 p.m. and from 2:08 to 2:12 p.m.
    • Per TransactionOne chart appears that shows the number of physical reads and redo size per transaction.

Figure 4-10 Monitoring Throughput

Description of Figure 4-10 follows
Description of "Figure 4-10 Monitoring Throughput"

 

 

Monitoring I/O

The I/O charts show I/O statistics collected from all database clients. The I/O wait time for a database process represents the amount of time that the process could have been doing useful work if a pending I/O had completed. Oracle Database captures the I/O wait times for all important I/O components in a uniform fashion so that every I/O wait by any Oracle process can be derived from the I/O statistics.

Figure 4-11 Monitoring I/O

Description of Figure 4-11 follows
Description of "Figure 4-11 Monitoring I/O"

The Latency for Synchronous Single Block Reads chart shows the total perceived I/O latency for a block read, which is the time difference between when an I/O request is submitted and when the first byte of the transfer arrives. Most systems are performing satisfactorily if latency is fewer than 10 milliseconds. This type of I/O request is the best indicator of I/O performance for the following reasons:

  • Write operations may exhibit good performance because of write caches in storage.
  • Because multiblock I/O requests have varying sizes, they can take different amounts of time.
  • The latency of asynchronous I/O requests does not represent the full I/O wait time.

The other charts shown depend on your selection for I/O Breakdown, as described in the following sections:

 

 

Monitoring I/O by Function

The I/O Function charts determine I/O usage level by application or job. The component-level statistics give a detailed view of the I/O bandwidth usage, which you can then use in scheduling jobs and I/O provisioning. The component-level statistics fall in the following categories:

  • Background typeThis category includes ARCH, LGWR, and DBWR.
  • ActivityThis category includes XDB, Streams AQ, Data Pump, Recovery, and RMAN.
  • I/O typeThe category includes the following:
    • Direct WritesThis write is made by a foreground process and is not from the buffer cache.
    • Direct ReadsThis read is physical I/O from a data file that bypasses the buffer cache and reads the data block directly into process-private memory.
    • Buffer Cache Reads
  • OthersThis category includes I/Os such as control file I/Os.

To monitor I/O by function:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the instance activity chart, click I/O.The Latency for Synchronous Single Block Reads, I/O Megabytes per Second, and I/O Requests per Second charts appear.
  3. For I/O Breakdown, select I/O Function.The I/O Megabytes per Second by I/O Function and I/O Requests per Second by I/O Function charts appear.The example in Figure 4-11 shows that a significant amount of I/O is being performed by the log writer. The log writer activity peaked at approximately 600 I/O requests per second.
  4. Click the largest colored area on the chart or the corresponding function in the legend to drill down to the function with the highest I/O rate.An I/O Throughput by I/O Function page appears with details about the selected category.You can view real-time or historical data for details on I/O megabytes or I/O requests.

See Also:

 

 

Monitoring I/O by Type

The I/O Type charts enable you to monitor I/O by the types of read and write operations. Small I/Os are requests smaller than 128 KB and are typically single database block I/O operations. Large I/Os are requests greater than or equal to 128 KB. Large I/Os are generated by database operations such as table/index scans, direct data loads, backups, restores, and archiving.

When optimizing for short transaction times, such as in an OLTP environment, monitor latency for small I/Os. High latencies typically indicate that the storage system is a bottleneck.

When optimizing for large queries, such as in a data warehouse, performance depends on the maximum throughput the storage system can achieve rather than the latency of the I/O requests. In this case, monitor the I/O megabytes per second rather than the synchronous single-block I/O latencies.

To monitor I/O by type:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the instance activity chart, click I/O.The I/O Megabytes per Second and I/O Requests per Second charts appear.
  3. For I/O Breakdown, select I/O Type.The I/O Megabytes per Second by I/O Type and I/O Requests per Second by I/O Type charts appear.In the above sample chart, the number of small writes per second increased to more than 600. These writes correspond to the log writer I/O requests shown in Figure 4-11.
  4. Click the largest colored area on the chart or the corresponding function in the legend to drill down to the function with the highest I/O rate.The I/O Details page appears.You can view real-time or historical data for details on I/O megabytes or I/O requests.

 

 

Monitoring I/O by Consumer Group

When Oracle Database Resource Manager is enabled, the database collects I/O statistics for all consumer groups that are part of the currently enabled resource plan. The Consumer Group charts enable you to monitor I/O by consumer group.

A resource plan specifies how the resources are to be distributed among various users (resource consumer groups). Resource consumer groups enable you to organize user sessions by resource requirements. Note that the _ORACLE_BACKGROUND_GROUP_ consumer group contains I/O requests issued by background processes.

To monitor I/O requests by consumer group:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the instance activity chart, click I/O.The I/O Megabytes per Second and I/O Requests per Second charts appear.
  3. For I/O Breakdown, select Consumer Group.The I/O Megabytes per Second by Consumer Group and I/O Requests per Second by Consumer Group charts appear.

 

 

Monitoring Parallel Execution

The Parallel Execution charts show system metrics related to parallel queries. Metrics are statistical counts per unit. The unit could be a time measure, such as seconds, or per transaction, or session.

A parallel query divides the work of executing a SQL statement across multiple processes. The charts show parallel queries that were waiting for a particular wait event that accounted for the highest percentages of sampled session activity.

Figure 4-12 Monitoring Parallel Execution

Description of Figure 4-12 follows
Description of "Figure 4-12 Monitoring Parallel Execution"

To monitor parallel execution:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the instance activity chart, click Parallel Execution.The Parallel Execution charts appear.Two pairs of charts are shown. The first pair shows the number of sessions on the y-axis, whereas the second pair shows the per second rate on the y-axis.In the example shown in Figure 4-12, query parallelization was active from 12:30 p.m. to 4 p.m.

 

 

Monitoring Services

Services represent groups of applications with common attributes, service-level thresholds, and priorities. For example, the SYS$USERS service is the default service name used when a user session is established without explicitly identifying a service name.

Figure 4-13 Monitoring Services

Description of Figure 4-13 follows
Description of "Figure 4-13 Monitoring Services"

To monitor services:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the instance activity chart, click Services.The Services chart appears. The Services chart shows services waiting for the corresponding wait event during the time period shown. Only active services are shown.In Figure 4-13, the SYS$USERS service has the greatest number of active sessions.
  3. Click the largest colored area on the chart or the corresponding service in the legend to drill down to the service with the highest number of active sessions.The Service page appears, showing the Activity subpage.You can view real-time data showing the session load for all wait classes associated with the service.

 

Monitoring Host Activity

The Host chart on the Performance page displays utilization information about the system hosting the database.

Figure 4-14 Monitoring Host Activity

Description of Figure 4-14 follows
Description of "Figure 4-14 Monitoring Host Activity"

To determine if the host system has enough resources available to run the database, establish appropriate expectations for the amount of CPU, memory, and disk resources that your system should be using. You can then verify that the database is not consuming too many of these resources.

To view details about CPU, memory, and disk utilization:

  1. From the Targets menu, select Hosts.The Hosts page appears.
  2. In the list of hosts, click the name of the host on which your database resides.The hostname page appears, where hostname is the name of the host.
  3. Determine whether sufficient resources are available and whether your system is using too many resources.For example, determine the amount of CPU, memory, and disk resources the database uses in the following scenarios:
    • When your system is idle, or when little database and nondatabase activity exists
    • At average workloads
    • At peak workloads

    Workload is an important factor when evaluating the level of resource utilization for your system. During peak workload hours, 90 percent utilization of a resource, such as a CPU with 10 percent idle and waiting time, can be acceptable. However, if your system shows high utilization at normal workload, then there is no room for additional workload.

    Perform the following tasks to monitor the host activity for your database:

  4. Set the appropriate threshold values for the performance metrics so the system can automatically generate alerts when these thresholds are exceeded.For information about setting metric thresholds, see "Setting Metric Thresholds for Performance Alerts".

 

 

Monitoring CPU Utilization

To address CPU problems, first establish appropriate expectations for the amount of CPU resources your system should be using. You can then determine whether sufficient CPU resources are available and recognize when your system is consuming too many resources. This section describes how to monitor CPU utilization.

To monitor CPU utilization:

  1. Access the hostname page as explained in "Monitoring Host Activity".
  2. From the Host menu, select Monitoring, and then CPU Details.The CPU Details page appears.This page contains statistics about CPU utilization, I/O wait times, and load gathered over the last hour. The top 10 processes are listed based on CPU utilization.
  3. Verify the current CPU utilization using the CPU Utilization chart.The CPU Utilization chart shows CPU utilization over the last hour and a half. The current value is displayed below the chart. During standard workload hours, the value should not exceed the critical threshold.
  4. Click CPU Utilization.The CPU Utilization page appears.This page contains CPU utilization statistics and related alerts generated over the last 24 hours.In the following example, the CPU utilization has suddenly spiked from approximately 8% to 89.49% at 12:28 p.m., which is above the warning threshold of 80%.

    If you notice an unexpected spike in this value that is sustained through normal workload hours, then the CPU performance problem should be investigated.

  5. Return to the CPU Details page. From the Host menu, select Monitoring, and then CPU Details.
  6. Verify the current CPU I/O wait time using the CPU I/O Wait chart.The CPU I/O Wait chart shows CPU I/O wait time over the last hour and a half. The current value is displayed below the chart. During normal workload hours, the value of CPU I/O wait should not exceed the warning threshold.CPU I/O wait represents the average number of jobs waiting for I/O during an interval.
  7. Click CPU I/O Wait.The CPU in I/O Wait page appears.This page contains CPU I/O wait statistics and related alerts generated over the last 24 hours.If you notice an unexpected increase in this value that is sustained through standard workload hours, then a CPU performance problem may exist.
  8. Return to the CPU Details page. From the Host menu, select Monitoring, and then CPU Details.
  9. Verify the current CPU load using the CPU Load chart.The CPU Load chart shows the CPU load over the last hour and a half. The current value is displayed below the chart. During standard workload hours, the value of CPU load should not exceed the warning threshold.CPU load represents the average number of processes waiting to be scheduled for CPU resources in the previous minute, or the level of CPU contention time over time.
  10. Click CPU Load.The Run Queue Length (5 minute average) page appears.This page contains CPU load statistics and related alerts generated over the last 24 hours.If you notice an unexpected spike in this value that is sustained through normal workload hours, then a CPU performance problem might exist.
  11. Return to the CPU Details page. From the Host menu, select Monitoring, and then CPU Details.
  12. Review the Top 10 Processes (ordered by CPU) table.If a process is consuming too much of the CPU utilization percentage, then investigate that process.In the following example, two database processes are consuming 87.6% of CPU utilization. Therefore, the database is the likely source of a potential CPU performance problem and should be investigated.

  13. If a CPU performance problem is identified, then you can try to resolve the issue by doing the following:
    • Use Oracle Database Resource Manager to reduce the impact of peak-load-use patterns by prioritizing CPU resource allocation
    • Avoid running too many processes that use a large amount of CPU
    • Increase hardware capacity, including changing the system architecture

See Also:

 

 

Monitoring Memory Utilization

Operating system performance issues commonly involve process management, memory management, and scheduling. This section describes how to monitor memory utilization and identify problems such as paging and swapping.

To monitor memory utilization:

  1. Access the hostname page as explained in "Monitoring Host Activity".
  2. From the Host menu, select Monitoring, and then Memory Details.The Memory Details page appears.This page contains statistics about memory utilization, page scan rates, and swap utilization gathered over the last hour. The top 10 processes are also listed ordered by memory utilization. Figure 4-15 shows a portion of the Memory Details page. The Top 10 Processes (ordered by Memory) section is not shown.

    Figure 4-15 Memory Details Page

    Description of Figure 4-15 follows
    Description of "Figure 4-15 Memory Details Page"

  3. Verify the current memory page scan rate using the Memory Page Scan Rate chart.The current value of the memory page scan rate is displayed below the chart. On UNIX and Linux, this value represents the number of pages scanned per second. On Microsoft Windows, this value represents the rate at which pages are read from or written to disk to resolve hard page faults. This value is a primary indicator of the types of faults that may be causing systemwide delays.
  4. Click Memory Scan Rate (pages per second).The Memory Page Scan Rate page appears.This page contains memory page scan rate statistics and related alerts over the last 24 hours.If you notice an unexpected increase in this value that is sustained through standard workload hours, then a memory performance problem might exist.
  5. Return to the Memory Details page. From the Host menu, select Monitoring, and then Memory Details.
  6. Using the Memory Utilization chart, verify the current memory utilization.The Memory Utilization chart shows how much memory is being used. The current value of memory utilization is displayed below the chart. During standard workload hours, the value should not exceed the warning threshold (shown in yellow).
  7. Click Memory Utilization (%).The Memory Utilization page appears.This page contains memory utilization statistics and related alerts generated over the last 24 hours.

    In this example, memory utilization has exceeded 80%, so warnings appear in the Metric Alert History table.

    If you notice an unexpected spike in this value that is sustained through normal workload hours, then a memory performance problem might exist.

  8. Return to the Memory Details page. From the Host menu, select Monitoring, then Memory Details.
  9. Using the Swap Utilization chart, verify current swap utilization.The Swap Utilization chart shows how much swap space is being used. The current value of swap utilization is displayed below the chart. During normal workload hours, the value should not exceed the warning threshold.
  10. Click Swap Utilization (%).The Swap Utilization page appears.This page contains swap utilization statistics and related alerts generated over the last 24 hours.If you notice an unexpected spike in this value that is sustained through normal workload hours, then a memory performance problem might exist.
  11. Return to the Memory Details page. From the Host menu, select Monitoring, then Memory Details.
  12. Review the top processes in the Top 10 Processes (ordered by Memory) table.If a process is taking up too much memory, then this process should be investigated.
  13. If a memory performance problem is identified, then you can attempt to resolve the issue by doing the following:
    • Use Automatic Memory Management to automatically manage and distribute memory between the System Global Area (SGA) and the aggregate program global area (PGA aggregate).
    • Use the Memory Advisor to set SGA and PGA memory target values.
    • Use Automatic PGA Management to manage SQL memory execution.
    • Avoid running too many processes that consume large amounts of memory.
    • Reduce paging or swapping.
    • Reduce the number of open cursors and hard parsing with cursor sharing.

See Also:

 

 

Monitoring Disk I/O Utilization

Because the database resides on a set of disks, the performance of the I/O subsystem is very important to database performance. Important disk statistics include the disk I/Os per second and the length of the service times. These statistics show if the disk is performing optimally or if the storage system is being overworked. This section describes how to monitor disk I/O utilization.

To monitor disk I/O utilization:

  1. From the Targets menu, select Hosts.The Hosts page appears.
  2. In the list of hosts, click the name of the host on which your database resides.The hostname page appears, where hostname is the name of the host.
  3. From the Host menu, select Monitoring, then Disk Details.The Disk Details page appears.This page contains disk I/O utilization and service time statistics, and the top disk devices ordered by the percentage of time that they were in use.

  4. Verify the current disk I/O utilization using the Total Disk I/O Made Across All Disks chart.The Total Disk I/O Made Across All Disks chart shows how many disk I/Os are being performed per second. The current value for total disk I/O per second is displayed below the chart. In Figure 4-16 the value is 153.07.
  5. Click Total Disk I/O made across all disks (per second).The Total Disk I/O Made Across All Disks (Per Second) page appears.This page contains disk utilization statistics and related alerts generated over the last 24 hours.If you notice an unexpected spike in this value that is sustained through standard workload hours, then a disk I/O performance problem might exist and should be investigated.
  6. Verify the current I/O service time using the Max Average Disk I/O Service Time (ms) Among All Disks chart.The Max Average Disk I/O Service Time (ms) Among All Disks chart shows the longest service time for disk I/Os in milliseconds. The current value for longest I/O service time is displayed below the chart. In Figure 4-16 the value is 1.79.
  7. From the Host menu, select Monitoring, then Disk Details.The Disk Details page appears.
  8. Click Max Average Disk I/O (ms) Service Time Among All Disks.The Max Average Disk I/O Service Time (ms) Among All Disks page appears.This page contains I/O service time statistics and related alerts generated over the last 24 hours.If you notice an unexpected spike in this value that is sustained through normal workload hours, then a disk I/O performance problem might exist and should be investigated.
  9. From the Host menu, select Monitoring, then Disk Details.The Disk Details page appears.
  10. On the Disk Details page, verify the disk devices in the Top Disk Devices (ordered by % Busy) table.If a particular disk is busy a high percentage of the time, then this disk should be investigated.In Figure 4-16, the drives that host Oracle Database (xvda and xvda1) are only busy 12.14 and 10.93 percent of the time, so no disk performance problem appears to exist.
  11. If a disk I/O performance problem is identified, you can attempt to resolve the problem by doing the following:
    • Use Oracle Automatic Storage Management (Oracle ASM) to manage database storage.
    • Stripe everything across every disk to distribute I/O.
    • Move files such as archived redo logs and online redo logs to separate disks.
    • Store required data in memory to reduce the number of physical I/Os.

See Also:

 

Determining the Cause of Spikes in Database Activity

If you see a spike in database activity in the Performance page, then you can access the ASH Analytics page to find out which sessions are consuming the most database time. This page provides stacked area charts to help you visualize the active session activity from various dimensions, such as Wait Class, Module, Actions, SQL ID, Instance, User Session, Consumer Group, and others. You can drill down into specific members of a dimension (vertical zooming), and zoom in and out of any time period (horizontal zooming).

To view active session activity on the ASH Analytics page:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Performance menu, select ASH Analytics.If the Database Login page appears, then log in as a user with administrator privileges. The ASH Analytics page appears.Figure 4-17 shows an example of the ASH Analytics page.

    Figure 4-17 ASH Analytics Page

    Description of Figure 4-17 follows
    Description of "Figure 4-17 ASH Analytics Page"

  3. To view a high-level perspective of top activity during a selected time period, drag the entire shaded slider area in the top chart to the desired time period.

    Tip:

    You can change the amount of time selected in the shaded slider area by selecting the control at either edge of the slider and dragging it to the left or right.

    You can select a time period within the default setting of one hour or you can use the selector buttons above the chart to display time periods of one day, one week, or one month. You can also use the Calendar and Custom buttons to display a time period other than one of the preset choices.

  4. To view a more detailed perspective of your selected time period, use the Activity chart on the page. By default, the chart shows a breakdown of workload activity by wait classes.
  5. Investigate the impact by viewing detailed statistics for the top activity sessions that are adversely affecting the system.To view detailed statistics for a session:
    1. Select the largest spike in the chart or the corresponding wait class in the legend beside the chart. The viewer now filters out everything in the chart except for the wait class of interest.For example, if the chart shows that the Concurrency wait class has the biggest spike, select the chart area of the legend for Concurrency. The viewer refreshes the chart and now only shows the Concurrency value and displays a Wait Class: Concurrency icon in the Filters bar.

      Tip:

      You can create an unlimited number of filters.

    2. In the Activity section, select Top Dimensions from the dimensions list. The chart refreshes in response to your selection, displaying values for the particular category you selected.For instance, if you create a filter for Concurrency as described above, then select Top Dimensions from the list, and then select User Session, the chart shows user sessions only for Concurrency.Figure 4-18 shows the list of activities with Top Dimensions selected.

      Figure 4-18 List of Activities

      Description of Figure 4-18 follows
      Description of "Figure 4-18 List of Activities"

  6. Optionally, use the Load Map for a graphical view of system activity.The Load Map is useful for viewing activity in a single- or multi-dimensional layout when you are not interested in seeing how activity has changed over time during the selected period.Figure 4-19 shows the load map for activity by wait class and wait events.

    Figure 4-19 Load Map on the ASH Analytics Page

    Description of Figure 4-19 follows
    Description of "Figure 4-19 Load Map on the ASH Analytics Page"

  7. Optionally, click Save to save the current page view as an HTML file for offline reference. When you click Save, a Save As dialog box appears and you can specify where you want to save the report. This action creates an Enterprise Manager Active Report covering all data currently gathered as part of the analysis. You can use this later to conduct a more thorough post-mortem analysis, for instance. You can view the report without Cloud Control or database connectivity.You can also click Mail and specify an email address to send the page as an attachment.

 

Customizing the Database Performance page

You can customize the Performance page so that it specifically addresses your requirements. As explained in "Monitoring Instance Activity", you can specify which charts you want to appear by default in the Performance page, and how you want them to appear. You can also decide whether to include baseline values in the Throughput and Services charts.

Cloud Control stores persistent customization information for each user in the repository. Cloud Control retrieves the customization data when you access the Performance page and caches it for the remainder of the browser session until you change the settings.

To customize the Performance page:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Performance menu, select Performance Home.If the Database Login page appears, then log in as a user with administrator privileges. The Performance page appears.
  3. Click Settings.The Performance Page Settings page appears.

  4. In the Detailed Chart Settings section, choose the defaults for display of the instance activity charts. Complete the following steps:
    1. In Default View, select the instance activity chart to appear by default in the Average Active Session section.See "Monitoring Instance Activity" for a description of the Throughput, I/O, Parallel Execution, and Services charts.
    2. In Throughput Chart Settings, select Per Second or Per Transaction as the default instance throughput rate to be displayed in the Throughput chart.See "Monitoring Throughput" to learn how to use the Throughput charts.
    3. In I/O Chart Settings, select the default I/O option to be displayed in the I/O chart.See "Monitoring I/O" to learn how to use the I/O charts.
  5. In the Baseline Display section, choose how AWR baselines are displayed in the performance charts. Do one of the following:
    • Select Do not show the baseline values to prevent baselines from appearing.
    • Select Show the 99th percentile line using the system moving window baseline to specify a percentile to display for the Throughput and Services charts.
    • Select Show the 99th percentile line using a static baseline with computed statistics and then select a baseline name from the Baseline Name list.You can select only baselines that have undergone schedule statistics computation, as described in "Computing Threshold Statistics for Baselines".
  6. Click OK.The Performance page appears.The charts are now displayed according to your customized settings.

Previous Page

Page 10 of 22

Next Page

Next

Respond to performance-related alerts

Respond to performance-related alerts, as described in Monitoring Performance Alerts .

The Database Home page in Cloud Control displays performance-related alerts generated by the database. Typically, resolving the problems indicated by these alerts improves database performance.

 

12/22

6 Monitoring Performance Alerts

Oracle Database includes a built-in alerts infrastructure to notify you of impending problems with the database. Alerts are a type of event and events comprise incidents. A problem is a special type of incident.

By default, Oracle Database enables some alerts, including the following:

  • Archive Area Used
  • Current Open Cursors Count
  • Recovery Area Free Space
  • Tablespace Space Used

In addition to these default alerts, you can set metric thresholds so that Oracle Database generates alerts to notify you about the database performance conditions that you specify.

This chapter contains the following sections:

See Also:

 

Setting Metric Thresholds for Performance Alerts

A metric is the rate of change in a cumulative statistic. This rate can be measured against a variety of units, including time, transactions, or database calls. For example, the number of database calls per second is a metric. You can set thresholds on a metric so that an alert is generated when the threshold is passed.

Performance alerts are based on metrics that are performance-related. These alerts are either environment-dependent or application-dependent.

Environment-dependent performance alerts may not be relevant on all systems. For example, the AVERAGE_FILE_READ_TIME metric generates an alert when the average time to read a file exceeds the metric threshold. This alert may be useful on a system with only one disk. On a system with multiple disks, however, the alert may not be relevant because I/O processing is spread across the entire subsystem.

Application-dependent performance alerts are typically relevant on all systems. For example, the BLOCKED_USERS metric generates a performance alert when the number of users blocked by a particular session exceeds the metric threshold. This alert is relevant regardless of how the environment is configured.

To obtain the most relevant information from performance alerts, set the threshold values of performance metrics to values that represent desirable boundaries for your system. You can then fine-tune these values over time until your system meets or exceeds your performance goals.

To set thresholds for performance metrics:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Oracle Database menu, select Monitoring, and then Metric and Collection Settings.If the Database Login page appears, then log in as a user with administrator privileges. The Metric Settings page appears.
  3. For each performance metric relevant for your system, click the Edit icon.The Edit Advanced Settings page appears.
  4. Follow the steps of the wizard to set the threshold value.

 

Responding to Alerts

When an alert is generated by Oracle Database, it appears in the Incidents and Problems section of the Database Home page.

Figure 6-1 shows the Incidents and Problems section of the Database Home page. The section is below the SQL Monitor - Last Hour section in the default layout of the page.

Figure 6-1 Incidents and Problems Section of the Database Home Page

Description of Figure 6-1 follows
Description of "Figure 6-1 Incidents and Problems Section of the Database Home Page"

Oracle Enterprise Manager Cloud Control (Cloud Control) enables you to configure alerts to be sent by email, pager, or text messaging.

To respond to an alert:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. In the table in the Incidents and Problems section, find the alert that you want to investigate and click the link in the Summary column.If the Database Login page appears, then log in as a user with administrator privileges. An Incident Manager page appears that contains further information about the alert. For example, clicking the value in the first row of the Summary column in Figure 6-1 causes the Incident Manager Problem Details page shown in Figure 6-2 to appear. The General sub-page is selected.

    Figure 6-2 Incident Manager Problem Details Page

    Description of Figure 6-2 follows
    Description of "Figure 6-2 Incident Manager Problem Details Page"

  3. Do one or more of the following:
    • Click the other tabs to see information on the subpages.
    • Perform one or more of the actions in the Tracking section on the General subpage.
    • In the Guided Resolution section, view diagnostic information by clicking Support Workbench: Problem Details. To package and upload diagnostic data to Oracle Support, click Support Workbench: Package Diagnostic.
    • Run Automatic Database Diagnostic Monitor (ADDM) or another advisor to get more detailed diagnostics of the system or object behavior.

 

Clearing Alerts

Most alerts, such as the CPU Utilization alert, are cleared automatically when the cause of the problem disappears. However, other alerts, such as the Generic Alert Log Error or Generic Incident alert, must be acknowledged.

After taking the necessary corrective measures, you can clear an alert.

To clear alerts:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. In the Incidents and Problems section, click the link in the Summary column of the table. See Figure 6-1 for a screenshot of the section.The Incident Manager Problem Details page appears. If the incident or problem can be manually cleared, the Clear button appears in the Tracking section.What happens if the Clear button does not appear. How is the problem cleared?
  3. In the Tracking section, click Clear.

Previous Page

Page 12 of 22

Next Page

Next

Validate that any changes have produced the desired effect, and verify that the users experience performance improvements

Validate that any changes have produced the desired effect, and verify that the users experience performance improvements

Next

Common Performance Problems

CPU bottlenecks

CPU bottlenecks

Is the application performing poorly because the system is CPU-bound? Performance problems caused by CPU bottlenecks are diagnosed by ADDM, as described in Automatic Database Performance Monitoring. You can also identify CPU bottlenecks by using the Performance page in Cloud Control, as described in "Monitoring CPU Utilization".

Monitoring CPU Utilization

To address CPU problems, first establish appropriate expectations for the amount of CPU resources your system should be using. You can then determine whether sufficient CPU resources are available and recognize when your system is consuming too many resources. This section describes how to monitor CPU utilization.

To monitor CPU utilization:

  1. Access the hostname page as explained in "Monitoring Host Activity".
  2. From the Host menu, select Monitoring, and then CPU Details.The CPU Details page appears.This page contains statistics about CPU utilization, I/O wait times, and load gathered over the last hour. The top 10 processes are listed based on CPU utilization.
  3. Verify the current CPU utilization using the CPU Utilization chart.The CPU Utilization chart shows CPU utilization over the last hour and a half. The current value is displayed below the chart. During standard workload hours, the value should not exceed the critical threshold.
  4. Click CPU Utilization.The CPU Utilization page appears.This page contains CPU utilization statistics and related alerts generated over the last 24 hours.In the following example, the CPU utilization has suddenly spiked from approximately 8% to 89.49% at 12:28 p.m., which is above the warning threshold of 80%.

    If you notice an unexpected spike in this value that is sustained through normal workload hours, then the CPU performance problem should be investigated.

  5. Return to the CPU Details page. From the Host menu, select Monitoring, and then CPU Details.
  6. Verify the current CPU I/O wait time using the CPU I/O Wait chart.The CPU I/O Wait chart shows CPU I/O wait time over the last hour and a half. The current value is displayed below the chart. During normal workload hours, the value of CPU I/O wait should not exceed the warning threshold.CPU I/O wait represents the average number of jobs waiting for I/O during an interval.
  7. Click CPU I/O Wait.The CPU in I/O Wait page appears.This page contains CPU I/O wait statistics and related alerts generated over the last 24 hours.If you notice an unexpected increase in this value that is sustained through standard workload hours, then a CPU performance problem may exist.
  8. Return to the CPU Details page. From the Host menu, select Monitoring, and then CPU Details.
  9. Verify the current CPU load using the CPU Load chart.The CPU Load chart shows the CPU load over the last hour and a half. The current value is displayed below the chart. During standard workload hours, the value of CPU load should not exceed the warning threshold.CPU load represents the average number of processes waiting to be scheduled for CPU resources in the previous minute, or the level of CPU contention time over time.
  10. Click CPU Load.The Run Queue Length (5 minute average) page appears.This page contains CPU load statistics and related alerts generated over the last 24 hours.If you notice an unexpected spike in this value that is sustained through normal workload hours, then a CPU performance problem might exist.
  11. Return to the CPU Details page. From the Host menu, select Monitoring, and then CPU Details.
  12. Review the Top 10 Processes (ordered by CPU) table.If a process is consuming too much of the CPU utilization percentage, then investigate that process.In the following example, two database processes are consuming 87.6% of CPU utilization. Therefore, the database is the likely source of a potential CPU performance problem and should be investigated.

  13. If a CPU performance problem is identified, then you can try to resolve the issue by doing the following:
    • Use Oracle Database Resource Manager to reduce the impact of peak-load-use patterns by prioritizing CPU resource allocation
    • Avoid running too many processes that use a large amount of CPU
    • Increase hardware capacity, including changing the system architecture

Next

Undersized memory structures

Are the Oracle memory structures such as the System Global Area (SGA), Program Global Area (PGA), and buffer cache adequately sized? Performance problems caused by undersized memory structures are diagnosed by ADDM, as described in Automatic Database Performance Monitoring. You can also identify memory usage issues by using the Performance page in Cloud Control, as described in "Monitoring Memory Utilization".

 

Monitoring Memory Utilization

Operating system performance issues commonly involve process management, memory management, and scheduling. This section describes how to monitor memory utilization and identify problems such as paging and swapping.

To monitor memory utilization:

  1. Access the hostname page as explained in "Monitoring Host Activity".
  2. From the Host menu, select Monitoring, and then Memory Details.The Memory Details page appears.This page contains statistics about memory utilization, page scan rates, and swap utilization gathered over the last hour. The top 10 processes are also listed ordered by memory utilization. Figure 4-15 shows a portion of the Memory Details page. The Top 10 Processes (ordered by Memory) section is not shown.

    Figure 4-15 Memory Details Page

    Description of Figure 4-15 follows
    Description of "Figure 4-15 Memory Details Page"

  3. Verify the current memory page scan rate using the Memory Page Scan Rate chart.The current value of the memory page scan rate is displayed below the chart. On UNIX and Linux, this value represents the number of pages scanned per second. On Microsoft Windows, this value represents the rate at which pages are read from or written to disk to resolve hard page faults. This value is a primary indicator of the types of faults that may be causing systemwide delays.
  4. Click Memory Scan Rate (pages per second).The Memory Page Scan Rate page appears.This page contains memory page scan rate statistics and related alerts over the last 24 hours.If you notice an unexpected increase in this value that is sustained through standard workload hours, then a memory performance problem might exist.
  5. Return to the Memory Details page. From the Host menu, select Monitoring, and then Memory Details.
  6. Using the Memory Utilization chart, verify the current memory utilization.The Memory Utilization chart shows how much memory is being used. The current value of memory utilization is displayed below the chart. During standard workload hours, the value should not exceed the warning threshold (shown in yellow).
  7. Click Memory Utilization (%).The Memory Utilization page appears.This page contains memory utilization statistics and related alerts generated over the last 24 hours.

    In this example, memory utilization has exceeded 80%, so warnings appear in the Metric Alert History table.

    If you notice an unexpected spike in this value that is sustained through normal workload hours, then a memory performance problem might exist.

  8. Return to the Memory Details page. From the Host menu, select Monitoring, then Memory Details.
  9. Using the Swap Utilization chart, verify current swap utilization.The Swap Utilization chart shows how much swap space is being used. The current value of swap utilization is displayed below the chart. During normal workload hours, the value should not exceed the warning threshold.
  10. Click Swap Utilization (%).The Swap Utilization page appears.This page contains swap utilization statistics and related alerts generated over the last 24 hours.If you notice an unexpected spike in this value that is sustained through normal workload hours, then a memory performance problem might exist.
  11. Return to the Memory Details page. From the Host menu, select Monitoring, then Memory Details.
  12. Review the top processes in the Top 10 Processes (ordered by Memory) table.If a process is taking up too much memory, then this process should be investigated.
  13. If a memory performance problem is identified, then you can attempt to resolve the issue by doing the following:
    • Use Automatic Memory Management to automatically manage and distribute memory between the System Global Area (SGA) and the aggregate program global area (PGA aggregate).
    • Use the Memory Advisor to set SGA and PGA memory target values.
    • Use Automatic PGA Management to manage SQL memory execution.
    • Avoid running too many processes that consume large amounts of memory.
    • Reduce paging or swapping.
    • Reduce the number of open cursors and hard parsing with cursor sharing.

Next

I/O capacity issues

Is the I/O subsystem performing as expected? Performance problems caused by I/O capacity issues are diagnosed by ADDM, as described in Automatic Database Performance Monitoring. You can also identify disk I/O issues by using the Performance page in Cloud Control, as described in "Monitoring Disk I/O Utilization".

Monitoring Disk I/O Utilization

Because the database resides on a set of disks, the performance of the I/O subsystem is very important to database performance. Important disk statistics include the disk I/Os per second and the length of the service times. These statistics show if the disk is performing optimally or if the storage system is being overworked. This section describes how to monitor disk I/O utilization.

To monitor disk I/O utilization:

  1. From the Targets menu, select Hosts.The Hosts page appears.
  2. In the list of hosts, click the name of the host on which your database resides.The hostname page appears, where hostname is the name of the host.
  3. From the Host menu, select Monitoring, then Disk Details.The Disk Details page appears.This page contains disk I/O utilization and service time statistics, and the top disk devices ordered by the percentage of time that they were in use.

  4. Verify the current disk I/O utilization using the Total Disk I/O Made Across All Disks chart.The Total Disk I/O Made Across All Disks chart shows how many disk I/Os are being performed per second. The current value for total disk I/O per second is displayed below the chart. In Figure 4-16 the value is 153.07.
  5. Click Total Disk I/O made across all disks (per second).The Total Disk I/O Made Across All Disks (Per Second) page appears.This page contains disk utilization statistics and related alerts generated over the last 24 hours.If you notice an unexpected spike in this value that is sustained through standard workload hours, then a disk I/O performance problem might exist and should be investigated.
  6. Verify the current I/O service time using the Max Average Disk I/O Service Time (ms) Among All Disks chart.The Max Average Disk I/O Service Time (ms) Among All Disks chart shows the longest service time for disk I/Os in milliseconds. The current value for longest I/O service time is displayed below the chart. In Figure 4-16 the value is 1.79.
  7. From the Host menu, select Monitoring, then Disk Details.The Disk Details page appears.
  8. Click Max Average Disk I/O (ms) Service Time Among All Disks.The Max Average Disk I/O Service Time (ms) Among All Disks page appears.This page contains I/O service time statistics and related alerts generated over the last 24 hours.If you notice an unexpected spike in this value that is sustained through normal workload hours, then a disk I/O performance problem might exist and should be investigated.
  9. From the Host menu, select Monitoring, then Disk Details.The Disk Details page appears.
  10. On the Disk Details page, verify the disk devices in the Top Disk Devices (ordered by % Busy) table.If a particular disk is busy a high percentage of the time, then this disk should be investigated.In Figure 4-16, the drives that host Oracle Database (xvda and xvda1) are only busy 12.14 and 10.93 percent of the time, so no disk performance problem appears to exist.
  11. If a disk I/O performance problem is identified, you can attempt to resolve the problem by doing the following:
    • Use Oracle Automatic Storage Management (Oracle ASM) to manage database storage.
    • Stripe everything across every disk to distribute I/O.
    • Move files such as archived redo logs and online redo logs to separate disks.
    • Store required data in memory to reduce the number of physical I/Os.

Next

Suboptimal use of Oracle Database by the application

Is the application making suboptimal use of Oracle Database? Problems such as establishing new database connections repeatedly, excessive SQL parsing, and high levels of contention for a small amount of data (also known as application-level block contention) can degrade the application performance significantly. Performance problems caused by suboptimal use of Oracle Database by the application are diagnosed by ADDM, as described in Automatic Database Performance Monitoring. You can also monitor top activity in various dimensions—including SQL, session, services, modules, and actions—by using the Performance page in Cloud Control, as described in "Monitoring User Activity".

Monitoring Real-Time Database Performance

The Automatic Database Diagnostic Monitor (ADDM) automatically identifies performance problems with the database, as described in Automatic Database Performance Monitoring. Information on performance appears on the Performance page in Oracle Enterprise Manager Cloud Control (Cloud Control).

By drilling down to other pages from the Performance page, you can identify database performance problems in real time. If you find a problem, then you can run ADDM manually to analyze it immediately without having to wait until the next ADDM analysis. To learn how to run ADDM manually, see "Manually Running ADDM to Analyze Current Database Performance".

This chapter describes how to monitor some aspects of database activity. It contains the following sections:

 

Monitoring User Activity

As described in Oracle Database Performance Method , database time (DB time) is an indicator of the total database instance workload. The average active sessions for a time period equals the total database time of all user sessions during the period divided by the elapsed time (wall-clock time) for the period.

The Average Active Sessions chart on the Performance page shows the average active sessions for CPU usage and wait classes in the time period. By following the performance method explained in Oracle Database Performance Method , you can drill down from the chart to identify the causes of instance-related performance issues and resolve them.

To monitor user activity:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Performance menu, select Performance Home.If the Database Login page appears, then log in as a user with administrator privileges. The Performance page appears.
  3. Locate any spikes or other areas of interest in the Average Active Sessions stacked area chart.Figure 4-1 shows an example of the Average Active Sessions chart on the Performance page.

    Figure 4-1 Average Active Sessions Chart

    Description of Figure 4-1 follows
    Description of "Figure 4-1 Average Active Sessions Chart"

    Each color-filled area on the stacked area chart shows the average active sessions for the specified event at the specified time. In the chart, the average active sessions amount for each event is stacked upon the one below it. The events appear on the chart in the order shown in the legend, with CPU starting at zero on the y-axis and the other events stacked in ascending order, from CPU Wait to Other. The wait classes show how much database activity is consumed by waiting for a resource such as disk I/O.

    For example, in Figure 4-1 at approximately 1:26 p.m., five events consume database time in the sampled time interval: CPU, CPU Wait, Scheduler, Concurrency, and Other. The combined average active sessions total is 2.1. The average active sessions value for CPU is about 1.52, for CPU Wait it is about .38, for Scheduler it is about .03, for Concurrency it is about .16, and for Other it is about .01.

    The CPU Cores line at 2 on the y-axis indicates the number of CPUs on the host system. When the CPU value reaches the CPU Cores line, the database instance is consuming 100 percent of CPU time on the system.

    In Figure 4-1, the chart shows that most of the activity occurred from 1:20 to 1:28 and from about 1:53 to 2:20. Most of the activity between 1:20 and 1:28 was CPU usage, as was most of the activity after about 1:59. Wait class activity spiked a few times between 1:56 and 2:12, and consumed a significant amount of database time from about 1:52 to about 2:08.

  4. To identify each wait class, move your cursor over the area in the Average Active Sessions chart that corresponds to the class.The corresponding wait class is highlighted in the chart legend.
  5. Click the largest area of color on the chart or the corresponding wait class in the legend to drill down to the wait class with the most average active sessions.If you click CPU or CPU Wait, then the Active Sessions Working: CPU + CPU Wait page appears. If you click a different wait class, such as User I/O, then an Active Sessions Waiting page for that wait class appears. Figure 4-2 shows the Active Sessions Working: CPU + CPU Wait page.

    Figure 4-2 Active Sessions Working Page

    Description of Figure 4-2 follows
    Description of "Figure 4-2 Active Sessions Working Page"

    The Active Sessions Working page shows a 1-hour timeline. Details for each wait class are shown in 5-minute intervals under Detail for Selected 5 Minute Interval.

    You can view the details of wait classes in different dimensions by proceeding to one of the following sections:

  6. To change the selected time interval, drag the shaded area on the chart to a different interval.The information contained in the Detail for Selected 5 Minute Interval section is automatically updated to display the selected time period.In the example shown in Figure 4-2, the 5 -minute interval from 9:59 to 10:04 is selected for the CPU and CPU wait class.
  7. If you discover a performance problem, then you can attempt to resolve it in real time. On the Performance page, do one of the following:

 

 

Monitoring Top SQL

On the Active Sessions Working page, the Top Working SQL table shows the database activity for actively running SQL statements that are consuming CPU resources. The Activity (%) column shows the percentage of this activity consumed by each SQL statement. If one or several SQL statements are consuming most of the activity, then you should investigate them.

To monitor the top working SQL statements:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click the CPU or CPU Wait area on the chart or the corresponding wait class in the legend.The Active Sessions Working page appears.
  3. In the Top Working SQL table, click the SQL ID link of the most active SQL statement. For example, in Figure 4-2, the SQL ID of the most active SQL statement is ddthrb7j9a63f.The SQL Details page appears.For SQL statements that are consuming the majority of the wait time, use SQL Tuning Advisor or create a SQL tuning set to tune the problematic SQL statements.

 

 

Monitoring Top Sessions

A session is a logical entity in the database instance memory that represents the state of a current user login to the database. A session lasts from the time a user logs in to the database until the user disconnects. For example, when a user starts SQL*Plus, the user must provide a valid database user name and password to establish a session. If a single session is consuming the majority of database activity, then you should investigate it.

To monitor the top working sessions:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click the CPU or CPU Wait area on the chart or the corresponding wait class in the legend.The Active Sessions Working: CPU + CPU Wait page appears, as shown in Figure 4-2.
  3. Under Detail for Selected 5 Minute Interval, in the Top Working Sessions section, from the View list select Top Sessions.The Top Working Sessions table appears. The table displays the top sessions waiting for the corresponding wait class during the selected time period.
  4. In the Top Working Sessions table, click the Session ID link of the session consuming the most database activity.The Session Details page appears.This page contains information such as session activity, session statistics, open cursors, blocking sessions, wait event history, and parallel SQL for the selected session.If a session is consuming too much database activity, then consider clicking Kill Session, and then tuning the SQL statement.

See Also:

 

 

Monitoring Top Services

A service is a group of applications with common attributes, service-level thresholds, and priorities. For example, the SYS$USERS service is the default service name used when a user session is established without explicitly identifying a service name. The SYS$BACKGROUND service consists of all database background processes. If a service is using the majority of the wait time, then you should investigate it.

To monitor a service:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click a colored area on the chart or the corresponding wait class in the legend.The Active Sessions Working page appears.
  3. Under Detail for Selected 5 Minute Interval, select Top Services from the View list.The Top Services table appears.

    Figure 4-3 Monitoring Top Services

    Description of Figure 4-3 follows
    Description of "Figure 4-3 Monitoring Top Services"

    The Top Services table displays the top services waiting for the corresponding wait event during the selected time period. For example, in Figure 4-3, the SYS$USERS service is consuming 86.47% of database activity.

  4. Click the Service link of the most active service.The Service page appears.This page contains information about the modules, activity, and statistics for the selected service.

 

 

Monitoring Top Modules

Modules represent the applications that set the service name as part of the workload definition. For example, the DBMS_SCHEDULER module may assign jobs that run within the SYS$BACKGROUND service. If a single module is using the majority of the wait time, then it should be investigated.

To monitor a module:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click a colored area on the chart or the corresponding wait class in the legend.The Active Sessions Working page appears.
  3. Under Detail for Selected 5 Minute Interval, select Top Modules from the View list.The Top Modules table appears.

    Figure 4-4 Monitoring Top Modules

    Description of Figure 4-4 follows
    Description of "Figure 4-4 Monitoring Top Modules"

    The Top Modules table displays the top modules waiting for the corresponding wait event during the selected time period. For example, in Figure 4-4, the SQL*Plus module is consuming over 84% of database activity and should be investigated. As shown in Figure 4-2, the SQL*Plus sessions for user HR are consuming a huge percentage of database activity.

  4. Click the Module link of the module that is showing the highest percentage of activity.The Module page appears.This page contains information about the actions, activity, and statistics for the selected module.

 

 

Monitoring Top Actions

Actions represent the jobs that are performed by a module. For example, the DBMS_SCHEDULER module can run the GATHER_STATS_JOB action to gather statistics on all database objects. If a single action is using the majority of the wait time, then you should investigate it.

To monitor an action:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click a colored area on the chart or the corresponding wait class in the legend.The Active Sessions Working page appears.
  3. Under Detail for Selected 5 Minute Interval, select Top Actions from the View list.The Top Actions table appears.

    Figure 4-5 Monitoring Top Actions

    Description of Figure 4-5 follows
    Description of "Figure 4-5 Monitoring Top Actions"

    The Top Actions table displays the top actions waiting for the corresponding wait event during the selected time period. For example, in Figure 4-5, the SALES_INFO action associated with the SQL*Plus module is consuming 40.3% of the database activity, while EMP_DML is consuming 39.55% and EMP_Query is consuming 4.48%. This information is consistent with Figure 4-2, which shows that the database sessions for user HR are consuming over 82% of database activity.

  4. Click the Action link of the most active action.The Action page appears.This page contains statistics for the selected action.

 

 

Monitoring Top Clients

A client can be a web browser or any client process that initiates a request for the database to perform an operation. If a single client is using the majority of the wait time, then you should investigate it.

To monitor a client:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click a colored area on the chart or the corresponding wait class in the legend.The Active Sessions Working page appears.
  3. Under Detail for Selected 5 Minute Interval, select Top Clients from the View list.The Top Clients table appears.

    Figure 4-6 Monitoring Top Clients

    Description of Figure 4-6 follows
    Description of "Figure 4-6 Monitoring Top Clients"

    The Top Clients table displays the top clients waiting for the corresponding wait event during the selected time period. For example, in Figure 4-6, client1 and client2 are consuming the majority of the database activity.

  4. Click the Client ID link of the most active client.The Clients page appears.This page contains statistics for the selected client process.

 

 

Monitoring Top PL/SQL

If a single PL/SQL subprogram is using the majority of the wait time, then you should investigate it.

To monitor a PL/SQL subprogram:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click a colored area on the chart or the corresponding wait class in the legend.The Active Sessions Working page appears.
  3. Under Detail for Selected 5 Minute Interval, select Top PL/SQL from the View list.The Top PL/SQL table appears.

    Figure 4-7 Monitoring Top PL/SQL

    Description of Figure 4-7 follows
    Description of "Figure 4-7 Monitoring Top PL/SQL"

    The Top PL/SQL table displays the top PL/SQL subprograms waiting for the corresponding wait event during the selected time period. For example, in Figure 4-7, the SYS.DBMS_AQ.LISTEN#2 subprogram is consuming 100% of database activity.

  4. Click the PL/SQL Subprogram link of the most active subprogram.The PL/SQL Subprogram page appears.This page contains statistics for the selected subprogram.

 

 

Monitoring Top Files

Data on the average wait time for specific files is available from the Active Sessions Waiting: User I/O page.

To monitor a file:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click the User I/O area on the chart or the corresponding wait class in the legend.The Active Sessions Waiting: User I/O page appears.
  3. Under Detail for Selected 5 Minute Interval, select Top Files from the View list.The Top Files table appears.

    Figure 4-8 Monitoring Top Files

    Description of Figure 4-8 follows
    Description of "Figure 4-8 Monitoring Top Files"

    The Top Files table displays the average wait time for specific files during the selected time period. For example, in Figure 4-8 75% of the wait times are associated with I/O to the files in the SYSTEM and SYSAUX tablespaces.

  4. Click the Tablespace link of the file with the highest average wait time.The View Tablespace page appears.

 

 

Monitoring Top Objects

Data on the top database objects waiting for resources is available from the Active Sessions Waiting: User I/O page.

To monitor an object:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click the User I/O area on the chart or the corresponding wait class in the legend.The Active Sessions Waiting: User I/O page appears.
  3. Under Detail for Selected 5 Minute Interval, select Top Objects from the View list.The Top Objects table appears.

    Figure 4-9 Monitoring Top Objects

    Description of Figure 4-9 follows
    Description of "Figure 4-9 Monitoring Top Objects"

    The Top Objects table displays the top database objects waiting for the corresponding wait event during the selected time period.

    For example, Figure 4-9 shows that over 84% of the waits are for an object whose name is unavailable. Based on the information in Figure 4-2, you can conclude that the performance problem is caused by the query and modification DML statements.

  4. Click the Object Name link of the object with the highest average wait time.The View page for the object appears.

 

Monitoring Instance Activity

Below the Average Active Sessions chart on the Performance page are other charts that you can use to monitor database instance activity. As explained in "Customizing the Database Performance page", you can also customize the Performance page so that the most useful instance activity charts are displayed by default.

You can use the instance activity charts to perform the following tasks:

 

 

Monitoring Throughput

Database throughput measures the amount of work the database performs in a unit of time. The Throughput charts show any contention that appears in the Average Active Sessions chart.

Compare the peaks on the Throughput charts with the peaks on the Average Active Sessions chart. If the Average Active Sessions chart displays a large number of sessions waiting, indicating internal contention, but throughput is high, then the situation may be acceptable. The database is probably also performing efficiently if internal contention is low but throughput is high. However, if internal contention is high but throughput is low, then consider tuning the database.

To monitor throughput:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Performance menu, select Performance Home.If the Database Login page appears, then log in as a user with administrator privileges. The Performance page appears.
  3. Click the Throughput tab.
  4. Select one of the following Instance Throughput Rate options.
    • Per SecondTwo charts appear. One shows the number of logons and transactions per second and the other shows the physical reads and redo size per second.Figure 4-10 shows the Throughput charts with the Instance Throughput Rate of Per Second selected. The bar in the middle of the figure indicates a portion of the charts (from approximately 1:37 to 1:52) that has been removed for space considerations. In Figure 4-10, the most transactions occurred from 1:15 to 1:27 p.m. and from 2:08 to 2:12 p.m.
    • Per TransactionOne chart appears that shows the number of physical reads and redo size per transaction.

Figure 4-10 Monitoring Throughput

Description of Figure 4-10 follows
Description of "Figure 4-10 Monitoring Throughput"

Next

Concurrency issues

Is the database performing suboptimally due to a high degree of concurrent activities in the database? A high degree of concurrent activities might result in contention for shared resources that can manifest in the form of locks or waits for buffer cache. Performance problems caused by concurrency issues are diagnosed by ADDM, as described in Automatic Database Performance Monitoring. You can also identify concurrency issues by using Top Sessions in Cloud Control, as described in "Monitoring Top Sessions".

Monitoring Top Sessions

A session is a logical entity in the database instance memory that represents the state of a current user login to the database. A session lasts from the time a user logs in to the database until the user disconnects. For example, when a user starts SQL*Plus, the user must provide a valid database user name and password to establish a session. If a single session is consuming the majority of database activity, then you should investigate it.

To monitor the top working sessions:

  1. Access the Performance page, as explained in "Monitoring User Activity".
  2. In the Average Active Sessions chart, click the CPU or CPU Wait area on the chart or the corresponding wait class in the legend.The Active Sessions Working: CPU + CPU Wait page appears, as shown in Figure 4-2.
  3. Under Detail for Selected 5 Minute Interval, in the Top Working Sessions section, from the View list select Top Sessions.The Top Working Sessions table appears. The table displays the top sessions waiting for the corresponding wait class during the selected time period.
  4. In the Top Working Sessions table, click the Session ID link of the session consuming the most database activity.The Session Details page appears.This page contains information such as session activity, session statistics, open cursors, blocking sessions, wait event history, and parallel SQL for the selected session.If a session is consuming too much database activity, then consider clicking Kill Session, and then tuning the SQL statement.

Next

Database configuration issues

Is the database configured optimally to provide desired performance levels? For example, is there evidence of incorrect sizing of log files, archiving issues, too many checkpoints, or suboptimal parameter settings? Performance problems caused by database configuration issues are diagnosed by ADDM, as described in Automatic Database Performance Monitoring.

 

http://docs.oracle.com/database/121/TDPPT/tdppt_method.htm#TDPPT018

Next

Short-lived performance problems

Are users complaining about short-lived or intermittent performance problems? Depending on the interval between snapshots taken by AWR, performance problems that have a short duration may not be captured by ADDM. You can identify short-lived performance problems by using the Active Session History report, as described in Resolving Transient Performance Problems .

 

Resolving Transient Performance Problems

Transient performance problems are short-lived and typically do not appear in the Automatic Database Diagnostic Monitor (ADDM) analysis. ADDM tries to report the most significant performance problems during an analysis period in terms of their effect on database time (DB time). If a problem lasts for a brief time, then its severity might be averaged out or minimized by other performance problems in the entire analysis period. Therefore, the problem may not appear in the ADDM findings. Whether or not a performance problem is captured by ADDM depends on its duration compared to the interval between the Automatic Workload Repository (AWR) snapshots.

If a performance problem lasts for a significant portion of the time between snapshots, then it is captured by ADDM. For example, if the snapshot interval is one hour, then a performance problem that lasts 30 minutes should not be considered a transient performance problem because its duration represents a significant portion of the snapshot interval and is likely to be captured by ADDM.

On the other hand, a performance problem that lasts 2 minutes could be transient because its duration is a small portion of the snapshot interval and probably does not appear in the ADDM findings. For example, if the system was slow between 10:00 p.m. and 10:10 p.m., and if the ADDM analysis for the time period between 10:00 p.m. and 11:00 p.m. does not show a problem, then a transient problem may have occurred for only a few minutes of the 10-minute interval.

This chapter contains the following sections:

 

Overview of Active Session History

To capture a detailed history of database activity, Oracle Database samples active sessions each second with the Active Session History (ASH) sampler. AWR snapshot processing collects the sampled data into memory and writes it to persistent storage. ASH is an integral part of the Oracle Database self-management framework and is extremely useful for diagnosing performance problems.

ASH gathers sampled data at the session level rather than at the instance level. By capturing statistics for only active sessions, ASH collects a manageable set of data. The size of this data is directly related to the work being performed, rather than to the size of the entire database instance.

Sampled data captured by ASH can be aggregated based on the dimensions in the data, including the following:

  • SQL identifier of a SQL statement
  • Object number, file number, and block number
  • Wait event identifier and parameters
  • Session identifier and session serial number
  • Module and action name
  • Client identifier of the session
  • Service hash identifier

You can run ASH reports to analyze transient performance problems with the database that only occur during specific times. This technique is especially useful when you are trying to do either of the following:

  • Resolve transient performance problems that may last for only a short period of time, such as why a particular job or session is not responding when the rest of the instance is performing as usual
  • Perform scoped or targeted performance analysis by various dimensions or their combinations, such as time, session, module, action, or SQL identifier

See Also:

 

Running Active Session History Reports

This section describes how to generate ASH reports using Oracle Enterprise Manager Cloud Control (Cloud Control).

To run ASH reports:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Performance menu, select Performance Home.If the Database Login page appears, then log in as a user with administrator privileges. The Performance page appears.
  3. Under Average Active Sessions, click Run ASH Report.The Run ASH Report page appears.
  4. Enter the date and time for the start and end of the time period when the transient performance problem occurred.In this example, database activity increased between 9:15 p.m. and 9:20 p.m., so an ASH report should be created for that time period.

  5. Click Generate Report.The Processing: View Report page appears while the report is being generated.After the report is generated, the ASH report appears under Report Results on the Run ASH Report page.

    See Also:

    "Active Session History Reports" for descriptions of some of the reports.

  6. Optionally, click Save to File to save the report in HTML format for future analysis.

 

Active Session History Reports

You can use an ASH report to identify the source of transient performance problems. The report is divided into titled sections. The following sections of the ASH report are useful places to begin the investigation:

See Also:

 

 

Top Events

The Top Events section of the report describes the top wait events of the sampled session activity categorized by user, background, and priority. Use this information to identify the wait events that may be the cause of the transient performance problem.

The Top Events section of the report contains the following subsections:

 

 

Top User Events

The Top User Events subsection of the report lists the top wait events from client processes that accounted for the highest percentages of sampled session activity.

Figure 8-1 shows that most database activity is consumed by the CPU + Wait for CPU event. The Wait for CPU is the time the process spent in the operating system run queue. The %Event column shows the percentage of DB time consumed by this event. In this example, over 30 percent of DB time was spent either on the CPU or waiting to get on it. The Load Profile section should be examined next to determine the type of activity that is causing this CPU consumption.

Figure 8-1 Top User Events

Description of Figure 8-1 follows
Description of "Figure 8-1 Top User Events"

 

 

Top Background Events

The Top Background Events subsection lists the top wait events from the background events that accounted for the highest percentages of sampled session activity.

The example in Figure 8-2 shows that 22.81 percent of sampled session activity is consumed by the CPU + Wait for CPU event.

Figure 8-2 Top Background Events

Description of Figure 8-2 follows
Description of "Figure 8-2 Top Background Events"

 

 

Load Profile

The Load Profile section of the report describes the load analyzed in the sampled session activity. Use the information in this section to identify the service, client, or SQL command type that may be the cause of the transient performance problem.

The Top Service/Module subsection lists the services and modules that accounted for the highest percentages of sampled session activity. A service is a group of related database tasks that share common functionality, quality expectations, and priority. Services are a convenient way to monitor multiple applications. The SYS$USERS and SYS$BACKGROUND services are always defined.

Figure 8-3 shows that over half of the database activity is consumed by the SYS$USERS service running the SQL*Plus module. In this example, it appears that the user is running high-load SQL that is causing the performance problem indicated in Figure 8-1. The Top SQL section of the report should be analyzed next to determine whether a particular type of SQL statement makes up the load.

Figure 8-3 Top Service/Module

Description of Figure 8-3 follows
Description of "Figure 8-3 Top Service/Module"

 

 

Top SQL

The Top SQL section of the report describes the top SQL statements of the sampled session activity. Use this information to identify high-load SQL statements that may be the cause of the transient performance problem. The Top SQL with Top Events subsection lists the SQL statements that accounted for the highest percentages of sampled session activity. The Sampled # of Executions column shows how many distinct executions of a particular SQL statement were sampled. To view the text of the SQL statements, click the SQL ID link.

Figure 8-4 shows that over half of DB time is consumed by three DML statements. These statements were run in the SQL*Plus module shown in Figure 8-3. The Top Sessions section should be analyzed to identify the sessions running these statements.

Figure 8-4 Top SQL with Top Events

Description of Figure 8-4 follows
Description of "Figure 8-4 Top SQL with Top Events"

See Also:

 

 

Top Sessions

The Top Sessions section lists the sessions that were waiting for the wait event that accounted for the highest percentages of sampled session activity. Use this information to identify the sessions that may be the cause of the performance problem.

The # Samples Active column shows the number of ASH samples in which the session was found waiting for that particular event. The percentage is calculated based on wall-clock time.

In Figure 8-5, the # Samples Active column shows that of the 300 times that ASH sampled database activity, the HR session (SID 123) performed a sequential read 243 times and a flashback operation 36 times. So, HR was active at least 93% of the time. The session consumed 27% of the total activity (much less than 93%) because other sessions, including the SH session, were also active.

It appears that the HR and SH sessions were running the high-load SQL statement in Figure 8-4. You should investigate this session to determine whether it is performing a legitimate operation and tune the SQL statement if possible. If tuning the SQL is not possible, and if a session is causing an unacceptable performance impact on the system, then consider terminating the session.

 

 

Top DB Objects/Files/Latches

The Top Objects/Files/Latches section provides additional information about the most commonly-used database resources and contains the following subsections:

 

 

Top DB Objects

The Top DB Objects subsection lists the database objects (such as tables and indexes) that accounted for the highest percentages of sampled session activity.

The example in Figure 8-6 shows that the hr.departments and hr.employees tables account for a high percentage of activity. Enqueue waits are waits for locks. In this example, the wait is for the TM (table) lock. Sometimes these waits indicate unindexed foreign key constraints. The buffer busy waits event records waits for a buffer to become available. These waits indicate that multiple processes are attempting to concurrently access the same buffers in the buffer cache.

Figure 8-6 Top DB Objects

Description of Figure 8-6 follows
Description of "Figure 8-6 Top DB Objects"

 

 

Top DB Files

The Top DB Files subsection lists the database files that accounted for the highest percentages of sampled session activity. Only cluster and I/O events are considered. The % Event column breaks down the activity by event, so if multiple rows exist in this table, then the sampled activity is divided among multiple events.

Figure 8-7 shows that about 11 percent of DB time involves waits for the UNDOTBS tablespace. This information is consistent with Figure 8-4, which shows significant DML activity from multiple sessions.

 

 

Top Latches

The Top Latches subsection lists the latches that accounted for the highest percentages of sampled session activity. Latches are simple, low-level serialization mechanisms to protect shared data structures in the System Global Area (SGA).

 

 

Activity Over Time

The Activity Over Time section of the ASH report is particularly useful for longer time periods because it provides in-depth details about activities and workload profiles during the analysis period. The Activity Over Time section is divided into time slots. The ASH report time span is divided into 10 time slots unless the time period is short or the data is sparse.

Figure 8-8 shows an activity report for the period between 2:10 p.m. and 2:40 p.m. The report indicates that the number of sampled sessions rose sharply in the sixth inner slot (2:24 p.m.) and stayed up. During this period CPU activity and lock enqueue waits increased dramatically.

Figure 8-8 Activity Over Time

Description of Figure 8-8 follows
Description of "Figure 8-8 Activity Over Time"

Each time slot contains session and wait event activity, as described in Table 8-1.


Table 8-1 Activity Over Time

Column Description
Slot Time (Duration) Duration of the slot
Slot Count Number of sampled sessions in the slot
Event Top three wait events in the slot
Event Count Number of ASH samples waiting for the wait event
% Event Percentage of ASH samples waiting for wait events in the entire analysis period

All inner slots are the same number of minutes each for easy comparison. The first and last slots, called outer slots, are odd-sized because they do not have a fixed slot time.

When comparing the inner slots, perform a skew analysis by identifying spikes. A spike in the Slot Count column indicates an increase in active sessions and a relative increase in database workload. A spike in the Event Count column indicates an increase in the number of sampled sessions waiting for an event. Typically, when the number of active session samples and the number of sessions associated with a wait event increase, the slot may be the cause of the transient performance problem.

 

Diagnosing Serious Performance Problems in Real Time

The following procedure is useful for diagnosing serious performance problems at the moment they are occurring. This may assist you in finding a remedy to resolve the problem other than rebooting the system.

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Performance menu, select Emergency Monitoring.The Emergency Performance page appears and displays collected ASH data. The page also shows top blocking sessions in the Hang Analysis table.If the information displayed on this page does not help you resolve the problem, continue to the next step.
  3. From the Performance menu, select Real-Time ADDM.The Real-Time ADDM page appears.
  4. In the Real-Time ADDM Results section, click Start.The system responds by collecting performance data from the target database, analyzing data for problem diagnosis and resolutions, and showing you results of the analysis.
  5. Click the Findings tab for a clear and interactive summary of all of the findings the analysis has detected, and to view actionable recommendations.
  6. Optionally, click Save to save the current page view as an HTML file for offline reference. When you click Save, a Save As dialog box appears and you can specify where you want to save the report. This action creates an Enterprise Manager Active Report covering all data currently gathered as part of the analysis. You can use this later to conduct a more thorough post-mortem analysis. You can view the report without Cloud Control or database connectivity.You can also click Mail and specify an email address to send the report as an attachment.

Note:

Certain database performance problems trigger a Real-Time ADDM analysis. You can view the results of the analysis by going to the Performance Home page and selecting the clipboard icon for the ADDM run under the Average Active Sessions chart.

See Also:

Oracle Database Performance Tuning Guide for information on Real-Time ADDM analysis

Example of Diagnosing a Problem

  1. A database is currently having severe performance problems, so the DBA goes to the Database Home page in Cloud Control. From the Performance menu, the DBA selects Emergency Performance.
  2. Neither ASH nor Hang Analysis indicate the root cause or offer quick solutions, so from the Performance menu the DBA selects Real-Time ADDM.
  3. The DBA views the active report generated by Real-Time ADDM, which shows that the system is paging due to excessive PGA consumption by session S1, possibly due to a memory leak. The report recommends terminating the session immediately.
  4. The DBA terminates session S1, then returns to the Emergency Performance page to see if normal system behavior is restored.
  5. The DBA notes that the system is making progress according to the activity charts on the page.
  6. From the Performance menu, the DBA selects Performance Home and observes that database performance has improved.

Next

Degradation of database performance over time

Is there evidence that the database performance has degraded over time? For example, are you or your users noticing that the database is not performing as well as it was 6 months ago? You can generate an AWR Compare Periods report to compare the period when the performance was poor to a period when the performance is stable to identify configuration settings, workload profile, and statistics that are different between these two time periods. This technique helps you identify the cause of the performance degradation, as described in Resolving Performance Degradation Over Time .

Resolving Performance Degradation Over Time

Performance degradation of the database occurs when your database was performing optimally in the past, such as 6 months ago, but has gradually degraded to a point where it becomes noticeable to the users. The Automatic Workload Repository (AWR) Compare Periods report enables you to compare database performance between two periods of time.

While an AWR report shows AWR data between two snapshots (or two points in time), the AWR Compare Periods report shows the difference between two periods (or two AWR reports with a total of four snapshots). Using the AWR Compare Periods report helps you to identify detailed performance attributes and configuration settings that differ between two time periods. The two time periods selected for the AWR Compare Periods report can be of different durations. The report normalizes the statistics by the amount of time spent on the database for each time period and presents statistical data ordered by the largest difference between the periods.

For example, a batch workload that historically completed in the maintenance window between 10:00 p.m. and midnight is currently showing poor performance and completing at 2 a.m. You can generate an AWR Compare Periods report from 10:00 p.m. to midnight on a day when performance was good and from 10:00 a.m. to 2 a.m. on a day when performance was poor. The comparison of these reports should identify configuration settings, workload profile, and statistics that were different in these two time periods. Based on the differences identified, you can diagnose the cause of the performance degradation.

This chapter contains the following sections:

 

Managing Baselines

Baselines are an effective way to diagnose performance problems. AWR supports the capture of baseline data by enabling you to specify and preserve a pair or a range of snapshots as a baseline. The snapshots contained in a baseline are excluded from the automatic AWR purging process and are retained indefinitely.

A moving window baseline corresponds to all AWR data that exists within the AWR retention period. Oracle Database automatically maintains a system-defined moving window baseline. The default size of the window is the current AWR retention period, which by default is 8 days.

This section contains the following topics:

 

 

Creating a Baseline

Before creating a baseline, carefully consider the time period you choose as a baseline because it should represent the database operating at an optimal level. In the future, you can compare these baselines with other baselines or snapshots captured during periods of poor performance to analyze performance degradation over time.

You can create the following types of baseline:

 

 

Creating a Single Baseline

A single baseline is captured at a single, fixed time interval. For example, a single baseline may be captured on February 5, 2012 from 5:00 p.m. to 8:00 p.m.

You can choose future start and end times to create a baseline that captures future database activity. If both the start time and the end time are in the future, then a baseline template with the same name as the baseline is also created. A baseline template is a specification that enables Oracle Database to automatically generate a baseline for a future time period.

To create a single baseline:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Performance menu, select AWR and then AWR Administration.If the Database Login page appears, then log in as a user with administrator privileges. The Performance page appears.
  3. Under Manage Snapshots and Baselines, click the number next to Baselines.The AWR Baselines page appears with a list of existing baselines displayed.

  4. Click Create.The Create Baseline: Baseline Interval Type page appears.
  5. Select Single.

  6. Click Continue.The Create Baseline: Single Baseline page appears.

  7. In the Baseline Name field, enter a name for the baseline.
  8. Under Baseline Interval, select whether to use a snapshot range or a time range for the baseline. Do one of the following:
    • To use a range, select Snapshot Range. Complete the following steps:
      • Under Select Time Period, select a start time for the baseline by selecting Period Start Time and the snapshot icon below the Active Sessions chart that corresponds to the desired start time.
      • Select an end time for the baseline by selecting Period End Time and the snapshot icon below the Active Sessions chart that corresponds to the desired end time.
      • Optionally, to view older snapshots that are not displayed below the Active Sessions chart, expand Change Chart Time Period. Enter the desired start date in the Chart Start Date field and the desired end date in the Chart End Date field, and click Go.

      In this example, a snapshot range of February 7, 2012 from 10:50 a.m. to 11:20 a.m. is selected.

    • To use a time range, select Time Range. Complete the following steps:
      • In the Start Time fields, select a start time for the baseline.
      • In the End Time fields, select an end time for the baseline.

      In the following example, a time range from 12:20 p.m. to 12:35 p.m. on February 7, 2012 is selected.

  9. Click Finish.The AWR Baselines page reappears with the newly created baseline displayed.

 

 

Creating a Repeating Baseline

A repeating baseline is a baseline that repeats during a time interval over a specific period. For example, a repeating baseline may repeat every Monday from 1:00 p.m. to 3:00 p.m. from February 7, 2012 to February 7, 2013.

To create a repeating baseline:

  1. Access the AWR Baselines page, as explained in "Creating a Single Baseline".
  2. Click Create.The Create Baseline: Baseline Interval Type page appears.
  3. Select Repeating and then click Continue.The Create Baseline: Repeating Baseline Template page appears.
  4. In the Baseline Name Prefix field, enter a name prefix for the baseline.
  5. Under Baseline Time Period, specify the time of the day that you want the baseline to begin collecting AWR data and the duration of the baseline collection.
  6. Under Frequency, do one of the following:
    • Select Daily if you want the baseline to repeat on a daily basis.
    • Select Weekly if you want the baseline to repeat on a weekly basis, and then select the day of the week on which the baseline repeats.
  7. Under Interval of Baseline Creation, complete the following steps:
    1. In the Start Time fields, select a date and time in the future when the data collection should begin.
    2. In the End Time fields, select a date and time in the future when the data collection should end.
  8. Under Purge Policy, enter the number of days to retain captured baselines.
  9. Click Finish.A baseline template with the same name as the baseline name prefix is created. A baseline template is a specification that enables Oracle Database to automatically generate a baseline for a future time period.This example creates a baseline that repeats weekly on Mondays from 8:00 a.m. to 10:00 a.m. from February 6, 2009 to February 6, 2010. Every captured baseline expires after 30 days.

 

 

Deleting a Baseline

To conserve storage space, you may want to periodically delete unused baselines stored in the database.

To delete a baseline:

  1. Access the AWR Baselines page, as explained in "Creating a Single Baseline".
  2. Select a baseline and click Delete.The Confirmation page appears.
  3. Select whether to purge the underlying data associated with the baseline.The underlying data includes the individual snapshots preserved in the baseline and any statistics that are computed for the baseline. Do one of the following:
    • To delete the underlying data, select Purge the underlying data associated with the baseline.
    • To preserve the underlying data, select Do not purge the underlying data associated with the baseline.
  4. Click Yes.The AWR Baselines page reappears. A message informs you that the baseline was deleted successfully.

 

 

Computing Threshold Statistics for Baselines

Computing threshold statistics for baselines enables you to graphically display the computed statistics in the charts on the Performance page.

To compute threshold statistics for baselines:

  1. Access the AWR Baselines page, as explained in "Creating a Single Baseline".
  2. Select the baseline for which you want to compute statistics.Select a baseline that does not already have computed statistics. These baselines are identified by No in the Statistics Computed column.
  3. From the Actions list, select Schedule Statistics Computation, and then click Go.The Compute Threshold Statistics page appears.This example computes statistics for the baseline BASELINE_TUE_1120.

  4. In the Name field, enter a name for the task.Alternatively, you can choose to use the system-generated name.
  5. In the Description field, enter a description for the task.Alternatively, you can choose to use the system-generated description.
  6. Under Start, do one of the following:
    • Select Immediately to run the task immediately after it has been submitted.
    • Select Later to run the task at a later time as specified using the Date and Time fields.

    This computation is resource-intensive, so you may want to schedule it to run during off-peak hours.

  7. Click Submit.The AWR Baselines page appears. A message informs you that statistics computation has been scheduled for the selected baseline.

See Also:

 

 

Setting Metric Thresholds for Baselines

As explained in "Setting Metric Thresholds for Performance Alerts", a metric is the rate of change in a cumulative statistic. Alerts notify you when particular metric thresholds are crossed. When the metric thresholds are crossed, the system is in an undesirable state. You can edit the threshold settings for baseline metrics.

You can create the following types of baseline:

 

 

Setting Metric Thresholds for the Default Moving Baseline

This section describes the easiest technique for setting the metric thresholds for the default moving baseline. You can choose a group of basic metric threshold settings based on common database workload profiles such as OLTP, data warehousing, and OLTP with nighttime batch jobs. After choosing a workload profile, you can expand or change the threshold values as needed.

To set metric thresholds for the default moving baseline:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Performance menu, select Adaptive Thresholds.If the Database Login page appears, then log in as a user with administrator privileges.The Threshold Configuration tab of the Baseline Metric Thresholds page appears.
  3. Click Quick Configuration.The Quick Configuration: Baseline Metric Thresholds page appears.
  4. In Workload Profile, select one of the following options, depending on how you are using the database:
    • Primarily OLTP (pure transaction processing 24 hours a day)
    • Primarily Data Warehousing (query and load intensive)
    • Alternating (OLTP during the daytime and batch during the nighttime)

    In this example, Primarily OLTP was selected.

  5. Click Continue.The Quick Configuration: Review OLTP Threshold Settings page appears.

  6. Review the metric threshold settings and then click Finish.You are returned to the Baseline Metric Thresholds page, with the Threshold Configuration tab selected. The metric threshold settings are displayed.

 

 

Setting Metric Thresholds for Selected Baselines

This section explains how to select a baseline and edit its thresholds. You can configure the type of threshold, for example, whether it is based on significance levels, percentage of maximum values, or fixed values. You can also configure the threshold levels that determine when the database generates critical alerts and warnings.

You can edit thresholds for the default moving baseline or a baseline that you created in the AWR Baselines page. You can select a baseline in the Edit Thresholds page after you have scheduled statistics computation from the AWR Baselines page and the statistics have finished computing on the static baseline.

To set a metric threshold for a selected moving baseline:

  1. Access the Baseline Metric Thresholds page, as explained in "Setting Metric Thresholds for the Default Moving Baseline".
  2. In the View list, select Basic Metrics.The Baseline Metric Thresholds page appears.
  3. In the Category/Name column, click the link for the metric whose threshold you want to set or change.For example, click Number of Transactions (per second).The Edit Thresholds: Number of Transactions (per second) appears.

    The charts on this page provide simple and detailed views of metric activity for a 24-hour period. In the top simple chart, click a day to view the value of the metric plotted against a 24-hour period.

  4. Under AWR Baseline, in the Name list, select either the default SYSTEM_MOVING_WINDOW or the name of a baseline created in the AWR Baselines page.A baseline appears in the AWR Baseline list after you have scheduled statistics computation from the AWR Baselines page and the statistics have finished computing on the static baseline.In this example, BASELINE_TUE_1120 is selected.The page refreshes to show the charts for the baseline that you selected.
  5. In the Threshold Settings section, complete the following steps to change the settings:
    1. In the Threshold Type list, select a type.
    2. In the Critical list, select a level.
    3. In the Warning list, select a value.
    4. In the Occurrences list, select a value.
  6. Click Apply Thresholds.The Baseline Metric Thresholds page reappears. The page shows the altered metric threshold settings.

 

Running the AWR Compare Periods Reports

This section describes how to run the AWR Compare Periods reports using Enterprise Manager Cloud Control (Cloud Control).

You can use AWR Compare Periods reports to compare the database performance between two time periods by:

 

 

Comparing a Baseline to Another Baseline or Pair of Snapshots

When performance degradation occurs over time, you can run the AWR Compare Periods report to compare the degraded performance, captured as a new baseline or a pair of snapshots, to an existing baseline. You must have a baseline that represents the system operating at an optimal level. If an existing baseline is unavailable, then compare database performance between two periods of time using two arbitrary pairs of snapshots, as described in "Comparing Two Pairs of Snapshots".

To compare a baseline to another baseline:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Performance menu, select AWR, then AWR Administration.If the Database Login page appears, then log in as a user with administrator privileges. The Automatic Workload Repository page appears.

  3. Under Manage Snapshots and Baselines, click the link next to Baselines.The AWR Baselines page appears.
  4. Complete the following steps:
    1. Select the baseline to use for the report.At least one existing baseline must be available.
    2. From the Actions list, select Compare Periods and then click Go.

    The Compare Periods: Second Period Start page appears. Under First Period, the selected baseline is displayed.

    In this example, the baseline named BASELINE_TUE_1120 is selected.

  5. Compare the baseline selected in the first period to another baseline or a pair of snapshots. Do one of the following:
    • To compare to another baseline, select Select a Baseline and the baseline you want to use in the second period, and then click Next.The Compare Periods: Review page appears. Go to Step 7.
    • To compare to a pair of snapshots, select Select Beginning Snapshot and the beginning snapshot to use in the second period, and then click Next.This example selects snapshot 18, taken on February 7, 2012 at 1:00 p.m.

      The Compare Periods: Second Period End appears. Proceed to the next step.

  6. Select the ending snapshot for the snapshot period to include in the report and then click Next.In this example, snapshot 1500, taken on February 7, 2009 at 12:50 p.m., is selected.

    The Compare Periods: Review page appears.

  7. Review the periods to be included in the report and then click Finish.The Compare Periods: Results page appears.Data from the selected periods appears under the General subpage. You can view data per second or per transaction by selecting an option from the View Data list.

    Note:

    If the time periods have different lengths, then the data is normalized over database time before calculating the difference so that periods of different lengths can be compared.

    In this example, almost every metric shows that more resources were consumed in the first period. The bar graphs indicate the proportions of the values in the two periods. The absence of bars indicates equivalent values. The report for this example shows significantly more database block changes per second and parse time in the first period than in the second.

  8. Click Report to view the report.The Processing: View Report page appears while the report is being generated. After it completes, the report appears.
  9. Optionally, do the following:
    • To change periods, click Change Periods.
    • To save the report as an HTML file, click Save to File.

 

 

Comparing Current System Performance to a Baseline Period

You may have noticed a performance change on a production system and would like to know why, or you may have implemented a change to a production system and want to know the effect of the change, such as increased concurrency waits.

The Compare Period ADDM compares the performance of the database server in two time periods, and returns a report describing the performance changes and the root origin of the changes. The Advisor can analyze any Oracle RDBMS version 10.2.0.4 or later monitored by Cloud Control. The following procedure explains how to initiate a report from the Compare Period ADDM.

  1. From the Performance menu, select AWR, then Compare Period ADDM.
  2. From the Run Compare Period ADDM page, specify the desired comparison and base periods:
    • Comparison Period — Generally represents an improperly functioning time period. However, you could also use the advisor to understand why performance has improved now when compared with an earlier time period.
    • Base Period — Represents a known (baseline or reference) period in which the database is functioning properly. You should select a base period in which the performance was acceptable, and the workload was as similar or identical as possible.
  3. Click Run to display the Database Compare Period Report.
  4. Examine the sections of the report to understand the performance change between the two periods and the cause of the change:
    • OverviewThis portion of the report shows SQL commonality, which is the comparability between the base and comparison periods based on the average resource consumption of the SQL statements common to both periods.A commonality value of 100% means that the workload "signature" in both time periods is identical. A value of 0% means that the two time periods have no items in common for the specific workload dimension.Commonality is based on the type of input (that is, which SQL is executing) as well as the load of the executing SQL statements. Consequently, SQL statements running in only one time period, but not consuming significant time, do not affect commonality. Therefore, two workloads could have a commonality of 100% even if some SQL statements are running only in one of the two periods, provided that these SQL statements do not consume significant resources.
    • ConfigurationThe information displayed shows base period and comparison period values for various parameters categorized by instance, host, and database.
    • FindingsThe findings can show performance improvements and identify the major performance differences caused by system changes. For negative outcomes, if you understand and remove the cause, the negative outcome can be eliminated.The values shown for the Base Period and Comparison Period represent performance with regard to database time.The Change Impact value represents a measurement of the scale of a change in performance from one time period to another. It is applicable to issues or items measured by the total database time they consumed in each time period. The absolute values are sorted in descending order.If the value is positive, an improvement has occurred, and if the value is negative, a regression has occurred. For instance, a change impact of -200% means that period 2 is three times as slow as period 1.You can run performance tuning tools, such as ADDM and the SQL Tuning Advisor, to fix issues in the comparison period to improve general system performance.
    • ResourcesThe information shown here provides a summary of the division of database time for both time periods, and shows the resource usage for CPU, memory, I/O, and interconnect (Oracle RAC only).
  5. Based on your observations, decide how to proceed to resolve performance regressions, then implement your action plan.

 

 

Comparing Two Pairs of Snapshots

If an existing baseline is unavailable, then you can compare database performance by using two arbitrary pairs of snapshots. Use one pair taken when the database is performing optimally, and another pair when the database is performing poorly. At least four snapshots must be available.

To compare performance using two pairs of snapshots:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Performance menu, select AWR, then Compare Periods Reports.If the Database Login page appears, then log in as a user with administrator privileges. The Run Compare Periods Report page appears.
  3. In First Period, select By Snapshot.
  4. In Begin Snapshot, click the magnifying glass icon.The Search and Select: Snapshots page appears.
  5. Select the starting point for the first snapshot period to be included in the report, and then click Select.You are returned to the Run Compare Periods Report page.
  6. In End Snapshot, click the magnifying glass icon.The Search and Select: Snapshots page appears.
  7. Select the ending point for the first snapshot period to be included in the report, and then click Select.You are returned to the Run Compare Periods Report page.
  8. Under Second Period, repeat Step 3 through Step 7.
  9. Click Generate Report.The Report Results section appears on the Run Compare Periods Report page. The section contains the Workload Repository Compare Period Report.
  10. Optionally, do the following:
    • To change periods, repeat Step 3 through Step 9.
    • To save the report as an HTML file, click Save to File.

 

Using the AWR Compare Periods Reports

After an AWR Compare Periods report is generated for the time periods you want to compare, you can use it to analyze performance degradation. To learn how to create the report, see "Running the AWR Compare Periods Reports".

Figure 9-1 shows a portion of an AWR Compare Periods report.

Figure 9-1 AWR Compare Periods Report

Description of Figure 9-1 follows
Description of "Figure 9-1 AWR Compare Periods Report"

The AWR Compare Periods report is divided into the following sections:

 

 

Summary of the AWR Compare Periods Report

The report summary is at the beginning of the AWR Compare Periods report, and summarizes information about the snapshot sets and loads used in the report. The report summary contains the following sections:

 

 

Snapshot Sets

The Snapshot Sets section displays information about the snapshot sets used for this report, such as instance, host, and snapshot information.

In the example shown in Figure 9-1, the first snapshot period corresponds to the time when performance was stable on February 7 from 10:50 to 11:20. The second snapshot period corresponds to the time when performance degradation occurred on the same day from 12:50 to 13:00.

 

 

Host Configuration Comparison

The Host Configuration Comparison section compares the host configurations used in the two snapshot sets. For example, the report compares physical memory and number of CPUs. Differences in the configurations are quantified as percentages in the %Diff column.

 

 

Cache Sizes

The Cache Sizes section compares the database configurations used in the two snapshot sets. For example, the report compares the SGA and log buffer size. Differences in the configurations are quantified as percentages in the %Diff column.

 

 

Load Profile

The Load Profile section compares the loads used in the two snapshot sets. Differences in the loads are quantified as percentages in the %Diff column.

In this example, the DB time per second was 100% higher in the first period. CPU time per second was 100% higher.

 

 

Top Timed Events

The Top Timed Events section is one of the most useful sections in the report. This section displays the five timed events or operations that consumed the highest percentage of total DB time in each of the snapshot sets.

In this example, CPU time and the number of waits for database file sequential reads are significantly higher in the first period than in the second.

 

 

Details of the AWR Compare Periods Report

The Report Details section follows the summary of the AWR Compare Periods report, and provides statistics about the snapshot sets and loads used in the report. For example, the section includes statistics for time model statistics, wait events, SQL execution time, and instance activity.

 

 

Supplemental Information in the AWR Compare Periods Report

The supplemental information is at the end of the AWR Compare Periods report, and provides additional information about initialization parameters and SQL statements. The init.ora Parameters section lists all the initialization parameter values for

Next

Inefficient or high-load SQL statements

Are any SQL statements using excessive system resources that impact the system? Performance problems caused by high-load SQL statements are diagnosed by ADDM, as described in Automatic Database Performance Monitoring and "Identification of High-Load SQL Statements Using ADDM Findings". You can also identify high-load SQL statements by using Top SQL in Cloud Control, as described in "Identifying High-Load SQL Statements Using Top SQL". After they have been identified, you can tune the high-load SQL statements using SQL Tuning Advisor, as described in Tuning SQL Statements .

Identifying High-Load SQL Statements

High-load SQL statements may consume a disproportionate amount of system resources. These SQL statements often greatly affect database performance and must be tuned to optimize their performance and resource consumption. Even when a database is properly tuned, inefficient SQL can significantly degrade performance.

Identifying high-load SQL statements is an important SQL tuning activity that must be performed regularly. Automatic Database Diagnostic Monitor (ADDM) automates this task by proactively identifying potential high-load SQL statements. Additionally, you can use Oracle Enterprise Manager Cloud Control (Cloud Control) to identify high-load SQL statements that require further investigation. After you have identified the high-load SQL statements, you can tune them with SQL Tuning Advisor and SQL Access Advisor.

This chapter describes how to identify high-load SQL statements and contains the following sections:

 

Identification of High-Load SQL Statements Using ADDM Findings

By default, ADDM runs proactively once every hour. It analyzes key statistics gathered by the Automatic Workload Repository (AWR) over the last hour to identify any performance problems, including high-load SQL statements. When the system finds performance problems, it displays them as ADDM findings in the Automatic Database Diagnostic Monitor (ADDM) page.

ADDM provides recommendations with each ADDM finding. When a high-load SQL statement is identified, ADDM gives recommendations, such as running SQL Tuning Advisor on the SQL statement. You can begin tuning SQL statements as described in Tuning SQL Statements .

 

Identifying High-Load SQL Statements Using Top SQL

ADDM automatically identifies high-load SQL statements that may be causing systemwide performance degradation. Under normal circumstances, manual identification of high-load SQL statements is not necessary. In some cases, however, you may want to monitor SQL statements at a more granular level. The Top SQL section of the Top Activity page in Cloud Control enables you to identify high-load SQL statements for any 5-minute interval.

Figure 11-1 shows an example of the Top Activity page. The page shows a 1-hour time line of the top activity running on the database. SQL statements that are using the highest percentage of database activity are listed under the Top SQL section, and are displayed in 5-minute intervals.

Figure 11-1 Top Activity Page

Description of Figure 11-1 follows
Description of "Figure 11-1 Top Activity Page"

To access the Top Activity page:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Performance menu, select Top Activity.If the Database Login page appears, then log in as a user with administrator privileges. The Top Activity page appears.
  3. To move the 5-minute interval, drag the shaded box to the desired time.The information contained in the Top SQL section is automatically updated to reflect the selected time period.
  4. To monitor SQL statements for a longer duration than one hour, select Historical from the View Data list.In Historical view, you can view the top SQL statements for the duration defined by the AWR retention period.

This section contains the following topics:

 

 

Viewing SQL Statements by Wait Class

The SQL statements that appear in the Top SQL section of the Top Activity page are categorized into various wait classes, based on their corresponding class as described in the legend on the Top Activity chart.

To view the SQL statements for a particular wait class:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Performance menu, select Top Activity.If the Database Login page appears, then log in as a user with administrator privileges. The Top Activity page appears.
  3. In the Top Activity chart, click the block of color on the chart for the wait class, or its corresponding wait class in the legend.The Active Sessions Working page for the selected wait class appears. The Top SQL section automatically updates to show only the SQL statements for the specified wait class.

See Also:

 

 

Viewing Details of SQL Statements

The Top SQL section of the Top Activity page displays the SQL statements executed within the selected 5-minute interval in descending order based on their resource consumption. The SQL statement at the top of this table represents the most resource-intensive SQL statement during that time period, followed by the second most resource-intensive SQL statement, and so on.

To view details of SQL statements:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Performance menu, select Top Activity.If the Database Login page appears, then log in as a user with administrator privileges. The Top Activity page appears.
  3. In the Top SQL section, click the SQL ID link of the SQL statement.The SQL Details page for the selected SQL statement appears.
  4. To view SQL details for a longer period, select Historical from the View Data list.

    You can now view SQL details in the past, up to the duration defined by the AWR retention period.

  5. In the Text section, review the SQL text for the SQL statement.The Text section contains the SQL text for the selected SQL statement. Note that if only part of the SQL statement is displayed, then a plus sign (+) icon appears next to the Text heading. To view the SQL text for the entire SQL statement, click the plus sign (+) icon.In Figure 11-1, the text of the SQL statement ddthrb7j9a63f is as follows:
    SELECT E.LAST_NAME, J.JOB_TITLE, D.DEPARTMENT_NAME
    FROM   HR.EMPLOYEES E, HR.DEPARTMENTS D, HR.JOBS J
    WHERE  E.DEPARTMENT_ID = D.DEPARTMENT_ID 
    AND    E.JOB_ID = J.JOB_ID 
    AND    E.LAST_NAME LIKE 'A%'
    
  6. In the Plan Hash Value list in the Details section, do one of the following:
    • If the SQL statement has multiple plans, then select All to show SQL details for all plans.
    • Select a particular plan to display SQL details for this plan only.
  7. View the subpages available on the SQL Details page to display additional information about the SQL statement, as described in the following sections:
  8. If the SQL statement is a high-load SQL statement, then tune it as described in Tuning SQL Statements .

 

 

Viewing SQL Statistics

The Statistics subpage of the SQL Details page displays statistical information about the SQL statement.

To view statistics for the SQL statement:

  1. Access the SQL Details page, as explained in "Viewing Details of SQL Statements".
  2. Under Details, click Statistics.The Statistics subpage appears.

  3. View the statistics for the SQL statement, as described in the following sections:

 

 

SQL Statistics Summary

The Summary section displays SQL statistics and activity on a chart.

In the Real Time view, the Active Sessions chart shows the average number of active sessions executing the SQL statement in the last hour. If the SQL statement has multiple plans and All is selected in the Plan Hash Value list, then the chart displays each plan in different colors, enabling you to easily spot if the plan changed and whether this may be the cause of the performance degradation. Alternatively, you can select a particular plan to display that plan only.

In the Historical view, the chart shows execution statistics in different dimensions. To view execution statistics, select the desired dimension from the View list:

  • Elapsed time per execution
  • Executions per hour
  • Disk reads per execution
  • Buffer gets per execution

This technique enables you to track the response time of the SQL statement using different dimensions. You can determine whether the performance of the SQL statement has degraded based on the dimension selected.

To view statistics of the SQL statement for a particular time interval, click the snapshot icon below the chart. You can also use the arrows to scroll the chart to locate a desired snapshot.

 

 

General SQL Statistics

The General section enables you to identify the origin of the SQL statement by listing the following information:

  • Module, if specified using the DBMS_APPLICATION_INFO package
  • Action, if specified using the DBMS_APPLICATION_INFO package
  • Parsing schema, or the database account used to execute the SQL statement
  • PL/SQL source, or the code line if the SQL statement is part of a PL/SQL program

 

 

Activity by Waits Statistics and Activity by Time Statistics

The Activity by Waits and Activity by Time sections enable you to identify how the SQL statement spent most of its time. The Activity by Waits section contains a graphical representation of how much elapsed time is consumed by CPU and by remaining waits. The Activity by Time section breaks out the total elapsed time into CPU time and wait time by seconds.

 

 

Elapsed Time Breakdown Statistics

The Elapsed Time Breakdown section enables you to identify if the SQL statement itself is consuming a lot of time, or if the total elapsed time is inflated due to the amount of time the originating program or application spent with the PL/SQL or Java engine. If the PL/SQL time or Java time makes up a significant portion of the elapsed time, then there may be minimal benefit gained by tuning the SQL statement. Instead, you should examine the application to determine how the PL/SQL time or Java time can be reduced.

 

 

Shared Cursors Statistics and Execution Statistics

The Shared Cursors Statistics and Execution Statistics sections provide information about the efficiency of various stages of the SQL execution process.

 

 

Other SQL Statistics

The Other Statistics section provides additional information about the SQL statement, such as average persistent and run-time memory.

 

 

Viewing Session Activity

The Activity subpage contains a graphical representation of the session activity.

To view session activity for the SQL statement:

  1. Access the SQL Details page, as explained in "Viewing Details of SQL Statements".
  2. Under Details, click Activity.The SQL Details page appears, showing the Activity subpage.

    The Activity subpage displays details of various sessions executing the SQL statement. The Active Sessions chart profiles the average number of active sessions over time.

  3. Optionally, drag the shaded box to select a 5-minute interval.The Detail for Selected 5 Minute Interval section lists the sessions that executed the SQL statement during the selected 5-minute interval. The multicolored bar in the Activity % column depicts how the database time is divided for each session while executing the SQL statement.
  4. Optionally, click the link in the SID column of the session you want to view to display the Session Details page.

See Also:

 

 

Viewing the SQL Execution Plan

The execution plan for a SQL statement is the sequence of operations Oracle Database performs to run the statement. The Plan subpage displays the execution plan for the SQL statement in a graph view and a table view.

To view the execution plan for the SQL statement:

  1. Access the SQL Details page, as explained in "Viewing Details of SQL Statements".
  2. Under Details, click Plan.The SQL Details page appears, showing the Plan subpage.
  3. Click Graphical to view the SQL execution in a graph view.

  4. Optionally, select an operation in the graph to display details about the operations shown in the execution plan.The Selection Details section refreshes to show details about the selected operations.
  5. If the selected operation is on a particular database object (such as a table), then click the Object link to view further details about the database object.
  6. To view the SQL execution in a table view, click Tabular.The Plan subpage refreshes to show the explain plan in a table.

    Query rewrite is an optimization technique that transforms a user request written in terms of master tables into a semantically equivalent request that includes materialized views. The database compares the cost for the query, with and without query rewrite, and selects the least costly option. If a rewrite is necessary, then query rewrite and its cost benefit are shown in the Explain Rewrite section.

See Also:

 

 

Viewing the Plan Control

The Plan Control subpage contains information about the following items:

  • SQL profilesA SQL profile contains additional statistics for the SQL statement. The optimizer uses these statistics to generate a better execution plan for the statement.
  • SQL patchesA SQL patch is automatically generated to work around an error or performance problem for a single SQL statement.
  • SQL plan baselinesA SQL plan baseline is an execution plan proven to have acceptable performance for a given SQL statement.

To view plan control information:

  1. Access the SQL Details page, as explained in "Viewing Details of SQL Statements".
  2. Under Details, click Plan Control.The SQL Details page appears, showing the Plan Control subpage.
  3. Review the plan-related information.In the following example, the optimizer used a SQL plan baseline named STMT01 for the SQL statement.

See Also:

 

 

Viewing the Tuning History

The SQL Tuning History section displays a history of SQL Tuning Advisor and SQL Access Advisor tasks.

To view the SQL tuning history:

  1. Access the SQL Details page, as explained in "Viewing Details of SQL Statements".
  2. Under Details, click Tuning History.The SQL Details page appears, showing the Tuning History subpage.
  3. Review the information about the tuning history.The SQL Tuning History section displays a history of SQL Tuning Advisor or SQL Access Advisor tasks.The ADDM Findings for this SQL During Historic Period section displays the number of occurrences of ADDM findings that are associated with the SQL statement.The following example shows that SQL tuning task was performed by user DBA1 on February 9, 2012.

See Also:

Next

Object contention

Are any database objects the source of bottlenecks because they are continuously accessed? Performance problems caused by object contention are diagnosed by ADDM, as described in Automatic Database Performance Monitoring. You can also optimize the data access path to these objects using SQL Access Advisor, as described in Optimizing Data Access Paths .

Optimizing Data Access Paths

To achieve optimal performance for data-intensive queries, materialized views and indexes are essential for SQL statements. However, implementing these objects does not come without cost. Creation and maintenance of these objects can be time-consuming. Space requirements can be significant. SQL Access Advisor enables you to optimize query access paths by recommending materialized views and view logs, indexes, SQL profiles, and partitions for a specific workload.

A materialized view provides access to table data by storing query results in a separate schema object. Unlike an ordinary view, which does not take up storage space or contain data, a materialized view contains the rows from a query of one or more base tables or views. A materialized view log is a schema object that records changes to a master table's data, so that a materialized view defined on the master table can be refreshed incrementally. SQL Access Advisor recommends how to optimize materialized views so that they can be rapidly refreshed and make use of the query rewrite feature.

SQL Access Advisor also recommends bitmap, function-based, and B-tree indexes. A bitmap index reduces response time for many types of ad hoc queries and can also reduce storage space compared to other indexes. A function-based index computes the value of a function or expression involving one or more columns and stores it in the index. B-tree indexes are commonly used to index unique or near-unique keys.

Using SQL Access Advisor involves the following tasks:

See Also:

 

Running SQL Access Advisor

This section describes how to run SQL Access Advisor to make recommendations for a SQL workload.

To run SQL Access Advisor:

  1. Select the initial options, as described in "Selecting the Initial Options".
  2. Select the workload source you want to use for the analysis, as described in "Selecting the Workload Source".
  3. Define the filters options, as described in "Applying Filter Options".
  4. Choose the types of recommendations, as described in "Specifying Recommendation Options".
  5. Schedule the SQL Access Advisor task, as described in "Specifying Task and Scheduling Options".

 

 

Selecting the Initial Options

The first step in running SQL Access Advisor is to select the initial options on the SQL Access Advisor: Initial Options page.

To select initial options:

  1. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  2. From the Performance menu, select Advisors Home.If the Database Login page appears, then log in as a user with administrator privileges. The Advisor Central page appears.
  3. Click SQL Advisors.The SQL Advisors page appears.
  4. Click SQL Access Advisor.The SQL Access Advisor: Initial Options page appears.
  5. Do one of the following:
    • Select Verify use of access structures (indexes, materialized views, partitioning, and so on) only to verify existing structures.
    • Select Recommend new access structures to use the recommended options defined in the Oracle Enterprise Manager Cloud Control (Cloud Control) default template.If you select this option, then you can optionally complete the following steps:
      • Select Inherit Options from a previously saved Task or Template to use the options defined in an existing SQL Access Advisor task or another template.
      • In Tasks and Templates, select the task or template that you want to use.

    In this example, Recommend new access structures is selected.

  6. Click Continue.The SQL Access Advisor: Workload Source page appears.
  7. Proceed to the next step, as described in "Selecting the Workload Source".

 

 

Selecting the Workload Source

After initial options are specified for SQL Access Advisor, select the workload source that you want to use for the analysis, as described in the following sections:

 

 

Using SQL Statements from the Cache

You can use SQL statements from the cache as the workload source. However, only current and recent SQL statements are stored in the SQL cache, so this workload source may not be representative of the entire workload on your database.

To use SQL statements from the cache as the workload source:

  1. Select the initial options, as described in "Selecting the Initial Options".
  2. On the SQL Access Advisor: Workload Source page, select Current and Recent SQL Activity.

  3. Proceed to the next step, as described in "Applying Filter Options".

 

 

Using an Existing SQL Tuning Set

You can use an existing SQL tuning set as the workload source. This option is useful because SQL tuning sets can be used repeatedly as the workload source for SQL Access Advisor and SQL Tuning Advisor.

To use a SQL tuning set as the workload source:

  1. Select the initial options, as described in "Selecting the Initial Options".
  2. On the SQL Access Advisor: Workload Source page, select Use an existing SQL Tuning Set.
  3. Click the SQL Tuning Set search icon to use an existing SQL tuning set.The Search and Select: SQL Tuning Set dialog box appears.
  4. In the Schema field, enter the name of the schema containing the SQL tuning set you want to use and then click Go.A list of SQL tuning sets contained in the selected schema appears.
  5. Select the SQL tuning set to be used for the workload source and click Select.The Search and Select: SQL Tuning Set dialog box closes and the selected SQL Tuning Set now appears in the SQL Tuning Set field.
  6. Proceed to the next step, as described in "Applying Filter Options".

 

 

Using a Hypothetical Workload

A dimension table stores all or part of the values for a logical dimension in a star or snowflake schema. You can create a hypothetical workload from dimension tables containing primary or foreign key constraints. This option is useful if the workload to be analyzed does not exist. In this case, SQL Access Advisor examines the current logical schema design, and provides recommendations based on the defined relationships between tables.

To use a hypothetical workload as the workload source:

  1. Select the initial options, as described in "Selecting the Initial Options".
  2. On the SQL Access Advisor: Workload Source page, select Create a Hypothetical Workload from the Following Schemas and Tables.
  3. Leave Schemas and Tables empty and then click Add to search for tables.The Workload Source: Search and Select Schemas and Tables page appears.
  4. In the Tables section, enter a schema name in the Schema field and then click Search.A list of tables in the selected schema is displayed.
  5. Select the tables to be used in creating the hypothetical workload and then click Add Tables.The selected tables now appear in the Schemas and Tables field.
  6. Click OK.The SQL Access Advisor: Workload Source page appears with the selected tables now added.
  7. Proceed to the next step, as described in "Applying Filter Options".

See Also:

 

 

Applying Filter Options

After the workload source is selected, you can optionally apply filters to reduce the scope of the SQL statements found in the workload. Filters are beneficial for the following reasons:

  • Using filters directs SQL Access Advisor to make recommendations based on a specific subset of SQL statements from the workload, which may lead to better recommendations.
  • Using filters removes extraneous SQL statements from the workload, which may greatly reduce processing time.

To apply filters to the workload source:

  1. Select initial options, as described in "Selecting the Initial Options".
  2. Select the workload source, as described in "Selecting the Workload Source".
  3. On the SQL Access Advisor: Workload Source page, click Filter Options.The Filter Options section expands.
  4. Select Filter Workload Based on these Options.The Filter Options section is enabled.
  5. Define the filters you want to apply, as described in the following sections:
  6. Click Next.The Recommendation Options page appears.
  7. Proceed to the next step, as described in "Specifying Recommendation Options".

 

 

Defining Filters for Resource Consumption

The resource consumption filter restricts the workload to include only the number of high-load SQL statements that you specify.

To define a filter for resource consumption:

  1. On the SQL Access Advisor: Workload Source page, under User Resource Consumption, enter the number of high-load SQL statements in the Number of Statements field.
  2. From the Order by list, select one of the methods by which the SQL statements are to be ordered.

 

 

Defining Filters for Users

The users filter restricts the workload to include or exclude SQL statements executed by users that you specify.

To define a filter for users:

  1. On the SQL Access Advisor: Workload Source page, under Users, select Include only SQL statements executed by these users or Exclude all SQL statements executed by these users.
  2. To search for available users, click the Users search icon.The Search and Select: Users dialog box appears.
  3. Select the users whose SQL statements you want to include or exclude and then click Select.The Search and Select: Users dialog box closes and the selected tables now appear in the Users field.In this example, a filter is defined to include only SQL statements executed by the user SH.

 

 

Defining Filters for Tables

The tables filter restricts the workload to include or exclude SQL statements that access a list of tables that you specify. Table filters are not permitted if you selected the Create a Hypothetical Workload from the Following Schemas and Tables option, as described in "Using a Hypothetical Workload".

To define a filter for tables:

  1. To include only SQL statements that access a specific list of tables, enter the table names in the Include only SQL statements that access any of these tables field.
  2. To exclude all SQL statements that access a specific list of tables, enter the table names in the Exclude all SQL statements that access any of these tables field.
  3. To search for available tables, click the Tables search icon.The Search and Select: Schema and Table dialog box appears.
  4. Select the tables for which you want to include or exclude SQL statements and click Select.The Search and Select: Schema and Table dialog box closes and the selected tables now appear in the corresponding Tables field.

 

 

Defining Filters for SQL Text

The SQL text filter restricts the workload to include or exclude SQL statements that contains SQL text substrings that you specify.

To define a filter for SQL text:

  1. To include only SQL statements that contains specific SQL text, enter the SQL text to be included in the Include only SQL statements containing these SQL text substrings field.
  2. To exclude all SQL statements that contain specific SQL text, enter the SQL text to be excluded in the Exclude all SQL statements containing these SQL text substrings field.

 

 

Defining Filters for Modules

The module filter restricts the workload to include or exclude SQL statements that are associated with modules that you specify.

To define a filter for module ID:

  1. Do one of the following:
    • To include only SQL statements associated with a specific module ID in the workload, select Include only SQL statements associated with these modules.
    • To exclude all SQL statements associated to a specific module ID from the workload, select Exclude all SQL statements associated with these modules.
  2. In the Modules field, enter the names of the modules for which associated SQL statements are included or excluded.

 

 

Defining Filters for Actions

The actions filter restricts the workload to include or exclude SQL statements that are associated with actions that you specify.

To define a filter for actions:

  1. Do one of the following:
    • To include only SQL statements associated with a specific action in the workload, select Include only SQL statements associated with these actions.
    • To exclude all SQL statements associated with a specific action from the workload, select Exclude all SQL statements associated with these actions.
  2. In the Actions field, enter the actions for which associated SQL statements are included or excluded.

 

 

Specifying Recommendation Options

To improve the underlying data access methods chosen by the optimizer for the workload, SQL Access Advisor provides recommendations for indexes, materialized views, and partitioning. Using these access structures can significantly improve the performance of the workload by reducing the time required to read data from the database. However, you must balance the benefits of using these access structures against the cost to maintain them.

To specify recommendation options:

  1. Select initial options, as described in "Selecting the Initial Options".
  2. Select the workload source, as described in "Selecting the Workload Source".
  3. Define the filter options, as described in "Applying Filter Options".
  4. On the SQL Access Advisor: Recommendation Options page, under Access Structures to Recommend, select the type of access structures to be recommended by SQL Access Advisor:
    • Indexes
    • Materialized Views
    • Partitioning

    In this example, all of the preceding access types are selected.

  5. Under Scope, select the mode in which SQL Access Advisor runs. Do one of the following:
    • Select Limited.In limited mode, SQL Access Advisor focuses on SQL statements with the highest cost in the workload. The analysis is quicker, but the recommendations may be limited.
    • Select Comprehensive.In comprehensive mode, SQL Access Advisor analyzes all SQL statements in the workload. The analysis can take much longer, but the recommendations are exhaustive.

    In this example, Limited Mode is selected.

  6. Optionally, click Advanced Options.The Advanced Options section expands. This section contains the following subsections:
    • Workload CategorizationIn this section, you can specify the type of workload for which you want a recommendation. The following categories are available:
      • Workload VolatilitySelect Consider only queries if the workload primarily contains read-only operations, as in data warehouses. Volatility data is useful for online transaction processing (OLTP) systems, where the performance of INSERT, UPDATE, and DELETE operations is critical.
      • Workload ScopeSelect Recommend dropping unused access structures if the workload represents all access structure use cases.
    • Space RestrictionsIndexes and materialized views increase performance at the cost of space. Do one of the following:
      • Select No, show me all recommendations (unlimited space) to specify no space limits. When SQL Access Advisor is invoked with no space limits, it makes the best possible performance recommendations.
      • Select Yes, limit additional space to and then enter the space limit in megabytes, gigabytes, or terabytes. When SQL Access Advisor is invoked with a space limit, it produces only recommendations with space requirements that do not exceed the specified limit.
    • Tuning PrioritizationThis section enables you to specify how SQL statements are tuned. Complete the following steps:
      • From the Prioritize tuning of SQL statements by list, select a method by which SQL statements are to be tuned and then click Add.
      • Optionally, select Consider access structures creation costs recommendations to weigh the cost of creating access structures against the frequency and potential improvement of SQL statement execution time. Otherwise, creation cost is ignored. You should select this option if you want specific recommendations generated for SQL statements that are executed frequently.
    • Default Storage LocationsUse this section to override the defaults defined for schema and tablespace locations. By default, indexes are in the schema and tablespace of the table they reference. Materialized views are in the schema and tablespace of the first table referenced in the query. Materialized view logs are in the default tablespace of the schema of the table that they reference.
  7. Click Next.The SQL Access Advisor: Schedule page appears.
  8. Proceed to the next step, as described in "Specifying Task and Scheduling Options".

 

 

Specifying Task and Scheduling Options

Use the SQL Access Advisor Schedule page to set or modify the schedule parameters for the SQL Access Advisor task.

Figure 13-1 Scheduling a SQL Access Advisor Task

Description of Figure 13-1 follows
Description of "Figure 13-1 Scheduling a SQL Access Advisor Task"

To schedule a SQL Access Advisor task:

  1. Select initial options, as described in "Selecting the Initial Options".
  2. Select the workload source, as described in "Selecting the Workload Source".
  3. Define the filter options, as described in "Applying Filter Options".
  4. Specify the recommendation options, as described in "Specifying Recommendation Options".
  5. On the SQL Access Advisor: Schedule page, under Advisor Task Information, enter a name in the Task Name field if you do not want to use the system-generated task name.In the example in Figure 13-1, SQLACCESS8895797 is entered.
  6. In the Task Description field, enter a description of the task.In the example in Figure 13-1, SQL Access Advisor is entered.
  7. From the Journaling Level list, select the level of journaling for the task.Journaling level controls the amount of information that is logged to the SQL Access Advisor journal during task execution. This information appears on the Details subpage when viewing task results.In the example in Figure 13-1, Basic is selected.
  8. In the Task Expiration (days) field, enter the number of days to retain the task in the database before it is purged.In the example in Figure 13-1, 30 is entered.
  9. In the Total Time Limit (minutes) field, enter the maximum number of minutes that the job is permitted to run.You must enter a time in this field rather than use the default.
  10. Under Scheduling Options, in the Schedule Type list, select a schedule type for the task and a maintenance window in which the task should run. Do one of the following:
    • Click Standard.This schedule type enables you to select a repeating interval and start time for the task. Complete the following steps:
      • Enter your time zone code in the Time Zone field or click the search icon to locate the code for your area.
      • In the Repeat list, select Do Not Repeat to perform the task only once, or select a unit of time and enter the number of units in the Interval field.
      • Under Start, select Immediately to start the task now, or Later to schedule the task to start at a time specified using the Date and Time fields.
    • Click Use Predefined Schedule.This schedule type enables you to select an existing schedule. Do one of the following:
      • In the Schedule field, enter the name of the schedule to be used for the task.
      • To search for a schedule, click the search icon.The Search and Select: Schedule dialog box appears.Select the desired schedule and click Select. The selected schedule now appears in the Schedule field.
    • Click Standard Using PL/SQL for Repeated Interval.This schedule type enables you to select a repeating interval and an execution time period (window) for the task. Complete the following steps:
      • Enter your time zone code in the Time Zone field or click the search icon to locate the code for your area.
      • Under Available to Start, select Immediately to start the task now, or Later to schedule the task to start at a time specified using the Date and Time fields.
      • In the Repeated Interval field, enter a PL/SQL schedule expression, such as SYSDATE+1.
      • Under Not Available After, select No End Date to indicate that there is no end date for the execution window, or Specified End Date to specify an end date using the Date and Time fields.
    • Click Use Predefined Window.This schedule type enables you to select an existing window. Select Stop on Window Close to stop the job when the window closes. Do one of the following:
      • In the Window field, enter the name of the window to be used for the task.
      • To search for a window, click the search icon.The Search and Select: Window and Window Groups dialog box appears.Select the desired window and click Select. The selected window now appears in the Schedule field.
    • Click Event.Complete the following steps:
      • Enter your time zone code in the Time Zone field or click the search icon to locate the code for your area.
      • Under Event Parameters, enter values in the Queue Name and Condition fields.
      • Under Start, select Immediately to start the task now, or Later to schedule the task to start at a time specified using the Date and Time fields.
      • Under Not Available After, select No End Date to indicate that there is no end date for the execution window, or Specified End Date to specify an end date using the Date and Time fields.
    • Click Calendar.Complete the following steps:
      • Enter your time zone code in the Time Zone field or click the search icon to locate the code for your area.
      • Under Calendar Expression, enter a calendar expression.
      • Under Start, select Immediately to start the task now, or Later to schedule the task to start at a time specified using the Date and Time fields.
      • Under Not Available After, select No End Date to indicate that there is no end date for the execution window, or Specified End Date to specify an end date using the Date and Time fields.

    In the example in Figure 13-1, Standard is selected for schedule type. The task does not repeat and is scheduled to start immediately.

  11. Click Next.The SQL Access Advisor: Review page appears.

    Under Options is a list of modified options for the SQL Access Advisor task. To display both modified and unmodified options, click Show All Options. To view the SQL text for the task, click Show SQL.

  12. Click Submit.The Advisor Central page appears. A message informs you that the task was created successfully.

 

Reviewing the SQL Access Advisor Recommendations

SQL Access Advisor graphically displays the recommendations and provides links so that you can quickly see which SQL statements benefit from a recommendation. Each recommendation produced by the SQL Access Advisor is linked to the SQL statement it benefits.

To review the SQL Access Advisor recommendations:

  1. Run SQL Access Advisor to make the recommendations, as described in "Running SQL Access Advisor".
  2. Access the Database Home page.See "Accessing the Database Home Page" for more information.
  3. From the Performance menu, select Advisors Home.If the Database Login page appears, then log in as a user with administrator privileges. The Advisor Central page appears.
  4. Select the SQL Access Advisor task for review and click View Result.

    If the task is not displayed, then you may need to refresh the screen. The Results for Task page appears.

  5. Review the Summary subpage, which provides an overview of the SQL Access Advisor analysis, as described in "Reviewing the SQL Access Advisor Recommendations: Summary".
  6. Review the Recommendations subpage, which enables you to view the recommendations ranked by cost improvement, as described in "Reviewing the SQL Access Advisor Recommendations: Recommendations".
  7. Review the SQL statements analyzed in the workload, as described in "Reviewing the SQL Access Advisor Recommendations: SQL Statements".
  8. Review the details of the workload, task options, and the SQL Access Advisor task, as described in "Reviewing the SQL Access Advisor Recommendations: Details".

 

 

Reviewing the SQL Access Advisor Recommendations: Summary

The Summary subpage displays an overview of the SQL Access Advisor analysis.

To review the recommendations summary:

  1. Access the Results for Task page, as described in "Reviewing the SQL Access Advisor Recommendations".
  2. Click Summary.The Summary subpage of the Results for Tasks page appears.In this example, Limited Mode is selected so that SQL Access Advisor analyzes the highest cost statements rather than all statements.

  3. Under Overall Workload Performance, assess the potential for improvement in implementing the recommendations.
  4. Use the Workload I/O Cost chart to compare the original workload I/O cost with the new cost.In this example, the workload I/O cost decreases from 107.1 million to 43.1 million by implementing the recommendations.
  5. Use the Query Execution Time Improvement chart to compare the improvement in query execution time.This chart shows the percentage of SQL statements in the workload whose execution time improves by accepting the recommendations. The SQL statements are grouped by the projected improvement factor along the horizontal axis on the chart (1x to >10x). The percentage of SQL statements that improve by the projected improvement factor are along the vertical axis (0% to 100%).In this example, approximately 62 percent of SQL statements in the workload do not improve execution time, but about 25 percent have the potential for improvement of over 4x or more.
  6. Under Recommendations, click Show Recommendation Action Counts.In the following example, creating 2 indexes, 4 materialized views, and 4 materialized view logs is recommended.

  7. Under SQL Statements, click Show Statement Counts to display the type of SQL statement.In the following example, 25 SELECT statements are analyzed.

 

 

Reviewing the SQL Access Advisor Recommendations: Recommendations

The Recommendations subpage ranks the SQL Access Advisor recommendations by cost improvement. You can also view details about each recommendation.

To review recommendation details:

  1. Access the Results for Task page, as described in "Reviewing the SQL Access Advisor Recommendations".
  2. Click Recommendations.The Recommendations subpage appears.

  3. Use the Recommendations by Cost Improvement chart to view recommendations ordered by the cost improvement.Under Select Recommendations for Implementation, each recommendation is listed with its implementation status, recommendation ID, cost improvement, space consumption, and the number of affected SQL statements for each recommendation. Implementing the top recommendation has the biggest benefit to the total performance of the workload.
  4. To view details for a particular recommendation, select the recommendation and click Recommendation Details.The Recommendation Details page appears. For space reasons, the following screenshot does not show the rightmost columns of the Actions table. The columns not shown are Tablespace and Estimated Space Used (MB).

    The Recommendation Details page displays all actions for the specified recommendation.

    Under Actions, you can choose to specify the schema or the tablespace for all actions. For some actions you can modify the object name, tablespace, and schema. To view the SQL text of an action, click the link in the Action column for the specified action.

    Under SQL Affected by Recommendation, the SQL text of the SQL statement and cost improvement information are displayed.

  5. Click OK.The Recommendations subpage appears.
  6. To view the SQL text of a recommendation, select the recommendation and click Show SQL.The Show SQL page for the selected recommendation appears.

 

 

Reviewing the SQL Access Advisor Recommendations: SQL Statements

The SQL Statements subpage ranks SQL statements in the workload by cost improvement. You can use this page to view details about the SQL statements analyzed in the workload.

To review SQL statements:

  1. Access the Results for Task page, as described in "Reviewing the SQL Access Advisor Recommendations".
  2. Click SQL Statements.The SQL Statements subpage appears.

  3. Use the SQL Statements by Cost Improvement chart to view SQL statements in the workload ordered by the cost improvement.Under Select SQL Statements to be Improved, each SQL statement is listed with its statement ID, SQL text, associated recommendation, cost improvement, and execution count.Implementing the recommendation associated with the top SQL statement has the biggest benefit to the total performance of the workload. In this example, implementing the recommendation with ID 3 produces the biggest benefit, a cost improvement of 99.80%, for the SQL statement with ID 803.
  4. To view the SQL text of a recommendation, select the recommendation and click Show SQL.The Show SQL page for the selected recommendation appears.

 

 

Reviewing the SQL Access Advisor Recommendations: Details

The Details subpage displays a list of all the workload and task options used in the analysis. You can also use this page to view a list of journal entries for the task, based on the journaling level used when the task was created.

To review workload and task details:

  1. Access the Results for Task page, as described in "Reviewing the SQL Access Advisor Recommendations".
  2. Click Details.The Details subpage appears.

    Under Workload and Task Options, a list of options that were selected when the advisor task was created is displayed.

    Under Journal Entries, a list of messages that were logged to the SQL Access Advisor journal while the task was executing is displayed.

 

Implementing the SQL Access Advisor Recommendations

A SQL Access Advisor recommendation can range from a simple suggestion to a complex solution that requires partitioning a set of existing base tables and implementing a set of database objects such as indexes, materialized views, and materialized view logs. You can select the recommendations for implementation and schedule when the job should be executed.

To implement the SQL Access Advisor recommendations:

  1. Review the SQL Access Advisor recommendations for cost benefits to determine which ones, if any, should be implemented.See "Reviewing the SQL Access Advisor Recommendations" for more information.
  2. Access the Results for Task page, as described in "Reviewing the SQL Access Advisor Recommendations".
  3. Click Recommendations.The Recommendations subpage appears.
  4. Under Select Recommendations for Implementation, select the recommendation you want to implement and then click Schedule Implementation.In the following example, the recommendation with ID value 1 is selected.

    The Schedule Implementation page appears.

  5. In the Job Name field, enter a name for the job if you do not want to use the system-generated job name.
  6. Determine whether the implementation job should stop if an error is encountered. Do one of the following:
    • To stop processing if an error occurs, select Stop on Error.
    • To continue processing even if an error occurs, deselect Stop on Error.
  7. Under Scheduling Options, in the Schedule Type list, select a schedule type for the task and a maintenance window in which the task should run. Do one of the following:
    • Click Standard.This schedule type enables you to select a repeating interval and start time for the task. Complete the following steps:
      • Enter your time zone code in the Time Zone field or click the search icon to locate the code for your area.
      • In the Repeat list, select Do Not Repeat to perform the task only once, or select a unit of time and enter the number of units in the Interval field.
      • Under Start, select Immediately to start the task now, or Later to schedule the task to start at a time specified using the Date and Time fields.
    • Click Use predefined schedule.This schedule type enables you to select an existing schedule. Do one of the following:
      • In the Schedule field, enter the name of the schedule to be used for the task.
      • To search for a schedule, click the search icon.The Search and Select: Schedule dialog box appears.Select the desired schedule and click Select. The selected schedule now appears in the Schedule field.
    • Click Standard using PL/SQL for repeated interval.This schedule type enables you to select a repeating interval and an execution window for the task. Complete the following steps:
      • Enter your time zone code in the Time Zone field or click the search icon to locate the code for your area.
      • Under Available to Start, select Immediately to start the task now, or Later to schedule the task to start at a time specified using the Date and Time fields.
      • In the Repeated Interval field, enter a PL/SQL schedule expression, such as SYSDATE+1.
      • Under Not Available After, select No End Date to indicate that there is no end date for the execution window, or Specified End Date to specify an end date using the Date and Time fields.
    • Click Use predefined window.This schedule type enables you to select an existing window. Select Stop on Window Close to stop the job when the window closes. Do one of the following:
      • In the Window field, enter the name of the window to be used for the task.
      • To search for a window, click the search icon.The Search and Select: Window and Window Groups dialog box appears.Select the desired window and click Select. The selected window now appears in the Schedule field.
    • Click Event.Complete the following steps:
      • Enter your time zone code in the Time Zone field or click the search icon to locate the code for your area.
      • Under Event Parameters, enter values in the Queue Name and Condition fields.
      • Under Start, select Immediately to start the task now, or Later to schedule the task to start at a time specified using the Date and Time fields.
      • Under Not Available After, select No End Date to indicate that there is no end date for the execution window, or Specified End Date to specify an end date using the Date and Time fields.
    • Click Calendar.Complete the following steps:
      • Enter your time zone code in the Time Zone field or click the search icon to locate the code for your area.
      • Under Calendar Expression, enter a calendar expression.
      • Under Start, select Immediately to start the task now, or Later to schedule the task to start at a time specified using the Date and Time fields.
      • Under Not Available After, select No End Date to indicate that there is no end date for the execution window, or Specified End Date to specify an end date using the Date and Time fields.

    In this example, Standard is selected for schedule type. The job does not repeat and is scheduled to start immediately.

  8. Optionally, click Show SQL to view the SQL text for the job.
  9. Click Submit to submit the job.
  10. Do one of the following, depending on whether the job is scheduled to start immediately or later:
    • If you submitted the job immediately, and if the Results for Task page appears, then click the link in the Scheduler Job field to display the View Job page. Go to Step 12.
    • If the job is scheduled to start at a later time, then proceed to Step 11.
  11. Complete the following steps:
    1. From the Administration menu, select Oracle Scheduler, then Jobs.The Scheduler Jobs page appears.
    2. Select the implementation job and click View Job Definition.The View Job page for the selected job appears.
  12. On the View Job page, under Operation Detail, check the status of the operation.

  13. Optionally, select the operation and click View.The Operation Detail page appears.This page contains information (such as start date and time, run duration, CPU time used, and session ID) that you can use when troubleshooting.
  14. Optionally, from the Database Home page, select Schema, then the page of the object that was created.Depending on the type of access structure that is created, you can display the access structure using the Indexes page, Materialized Views page, or the Materialized View Logs page.

Next

Unexpected performance regression after tuning SQL statements

Is the performance of SQL statements degrading after they have been tuned? Tuning SQL statements may cause changes to their execution plans, resulting in a significant impact on SQL performance. In some cases, the changes may result in the improvement of SQL performance. In other cases, the changes may cause SQL statements to regress, resulting in a degradation of SQL performance.

Before making changes on a production system, you can analyze the impact of SQL tuning on a test system by using SQL Performance Analyzer. This feature enables you to forecast the impact of system changes on a SQL workload by:

  • Measuring the performance before and after the change
  • Generating a report that describes the change in performance
  • Identifying the SQL statements that regressed or improved
  • Providing tuning recommendations for each SQL statement that regressed
  • Enabling you to implement the tuning recommendations when appropriate

To learn how to use SQL Performance Analyzer, see Oracle Database Testing Guide.

 

You can run SQL Performance Analyzer on a production system or a test system that closely resembles the production system. Testing a system change on a production system will impact the system's throughput because SQL Performance Analyzer must execute the SQL statements that you are testing. Any global changes made on the system to test the performance effect may also affect other users of the system. If the system change does not impact many sessions or SQL statements, then running SQL Performance Analyzer on the production system may be acceptable. However, for systemwide changes—such as a database upgrade—using a production system is not recommended. Instead, consider running SQL Performance Analyzer on a separate test system so that you can test the effects of the system change without affecting the production system. Using a test system also ensures that other workloads running on the production system will not affect the analysis performed by SQL Performance Analyzer. Running SQL Performance Analyzer on a test system is the recommended approach and the methodology described here. If you choose to run the SQL Performance Analyzer on the production system, then substitute the production system for the test system where applicable.

Analyzing the SQL performance effect of system changes using SQL Performance Analyzer involves the following steps, as illustrated in Figure 2-1:

Figure 2-1 SQL Performance Analyzer Workflow

Description of
Description of "Figure 2-1 SQL Performance Analyzer Workflow"

  1. Capture the SQL workload that you intend to analyze and store it in a SQL tuning set, as described in "Capturing the SQL Workload".
  2. If you plan to use a test system separate from your production system, then perform the following steps:
    1. Set up the test system to match the production environment as closely as possible.
    2. Transport the SQL tuning set to the test system.

    For more information, see "Setting Up the Test System".

  3. On the test system, create a SQL Performance Analyzer task, as described in "Creating a SQL Performance Analyzer Task".
  4. Build the pre-change SQL trial by test executing or generating execution plans for the SQL statements stored in the SQL tuning set, as described in "Measuring the Pre-Change SQL Performance"
  5. Perform the system change, as described in "Making a System Change"
  6. Build the post-change SQL trial by re-executing the SQL statements in the SQL tuning set on the post-change test system, as described in "Measuring the Post-Change SQL Performance"
  7. Compare and analyze the pre-change and post-change versions of performance data, and generate a report to identify the SQL statements that have improved, remained unchanged, or regressed after the system change, as described in "Comparing Performance Measurements"
  8. Tune any regressed SQL statements that are identified, as described in "Fixing Regressed SQL Statements".
  9. Ensure that the performance of the tuned SQL statements is acceptable by repeating steps 6 through 8 until your performance goals are met.For each comparison, you can use any previous SQL trial as the pre-change SQL trial and the current SQL trial as the post-change SQL trial. For example, you may want to compare the first SQL trial to the current SQL trial to assess the total change, or you can compare the most recent SQL trial to the current SQL trial to assess just the most recent change.

Note:

Oracle Enterprise Manager provides automated workflows for steps 3 through 9 to simplify this process.

Note:

Data visibility and privilege requirements may differ when using SQL Performance Analyzer with pluggable databases (PDBs). For information about how manageability features—including SQL Performance Analyzer—work in a multitenant container database (CDB), see Oracle Database Administrator's Guide.

Next

Step 3: Tuning the Database Reactively

Run ADDM manually

Run ADDM manually to diagnose current and historical database performance when performance problems are reported by the users, as described in Manual Database Performance Monitoring.

 

Next

Resolve transient performance problems

Resolve transient performance problems, as described in Resolving Transient Performance Problems .

The Active Session History (ASH) reports enable you to analyze transient performance problems with the database that are short-lived and do not appear in the ADDM analysis.

Next

Resolve performance degradation over time

Resolve performance degradation over time, as described in Resolving Performance Degradation Over Time .

The Automatic Workload Repository (AWR) Compare Periods report enables you to compare database performance between two periods of time, and resolve performance degradation that may happen from one time period to another.

Next

Validate that the changes made have produced

Validate that the changes made have produced the desired effect, and verify that the users experience performance improvements.

Next

Repeat these steps

Repeat these steps until your performance goals are met or become impossible to achieve due to other constraints.

Next

Step 5: Tuning SQL Statements

Identify high-load SQL statements

Identify high-load SQL statements, as described in Identifying High-Load SQL Statements .

Next

Tune high-load SQL statements

Tune high-load SQL statements, as described in Tuning SQL Statements .

You can improve the efficiency of high-load SQL statements by tuning them using SQL Tuning Advisor.

Next

Optimize data access paths

Optimize data access paths, as described in Optimizing Data Access Paths .

You can optimize the performance of data access paths by creating the proper set of materialized views, materialized view logs, and indexes for a given workload by using SQL Access Advisor.

Next

Analyze the SQL performance impact of SQL

Analyze the SQL performance impact of SQL tuning and other system changes by using SQL Performance Analyzer.

To learn how to use SQL Performance Analyzer, see Oracle Database Testing Guide.

Next

Repeat

Repeat these steps until all high-load SQL statements are tuned for greatest efficiency

Complete Course