Tuning poor performing SQL s Using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor



Similar documents
Phone Manager Application Support OCTOBER 2014 DOCUMENT RELEASE 4.1 SAGE CRM

eg Enterprise v5.2 Clariion SAN storage system eg Enterprise v5.6

Virtual Contact Center. Release Notes. Version Revision 1.0

Virtual Contact Center

Clearview Customer Web Access

Object Level Authentication

Virtual Contact Center

Virtual Contact Center

Dell Statistica Document Management System (SDMS) Installation Instructions

Dell InTrust Preparing for Auditing Microsoft SQL Server

STEP BY STEP IIS, DotNET and SQL-Server Installation for an ARAS Innovator9x Test System

An Oracle White Paper November Oracle Business Intelligence Standard Edition One 11g

Virtual Contact Center

EMC Documentum Interactive Delivery Services Accelerated: Step-by-Step Setup Guide

Dell One Identity Cloud Access Manager How to Configure for SSO to SAP NetWeaver using SAML 2.0

Dell One Identity Cloud Access Manager How to Configure for High Availability

Oracle Enterprise Single Sign-on Logon Manager How-To: Configuring ESSO-LM Event Logging with Microsoft SQL Server 2005 Release

Dell Statistica Statistica Enterprise Installation Instructions

Configuring and Monitoring Event Logs

P R O V I S I O N I N G O R A C L E H Y P E R I O N F I N A N C I A L M A N A G E M E N T

EMC Documentum Repository Services for Microsoft SharePoint

SQL Express to SQL Server Database Migration Goliath Performance Monitor v11.5

ORACLE USER PRODUCTIVITY KIT USAGE TRACKING ADMINISTRATION & REPORTING RELEASE 3.6 PART NO. E

An Oracle White Paper July Introducing the Oracle Home User in Oracle Database 12c for Microsoft Windows

An Oracle White Paper May Distributed Development Using Oracle Secure Global Desktop

Dell Enterprise Reporter 2.5. Configuration Manager User Guide

Strong Authentication for Microsoft TS Web / RD Web

Getting Started with PayPal Manager

Configuring and Monitoring SharePoint Servers

Virtual Contact Center

An Oracle White Paper February, Oracle Database In-Memory Advisor Best Practices

Configuring and Monitoring SNMP Generic Servers. eg Enterprise v5.6

Oracle Database 11g: New Features for Administrators 15-1

formerly Help Desk Authority HDAccess Administrator Guide

Entrust Managed Services PKI. Configuring secure LDAP with Domain Controller digital certificates

Dell One Identity Cloud Access Manager How to Configure vworkspace Integration

Oracle Utilities Meter Data Management Business Intelligence

Application Note. ShoreTel 9: Active Directory Integration. Integration checklist. AN June 2009

Symantec Backup Exec Management Plug-in for VMware User's Guide

Any system currently running the Schneider Electric MBX Driver Suite or any activated Cyberlogic software suite.

Dell One Identity Cloud Access Manager How To Deploy Cloud Access Manager in a Virtual Private Cloud

Strong Authentication for Juniper Networks

Installation Guide Revision 1.0.

CA Clarity PPM. Connector for Microsoft SharePoint Product Guide. Service Pack

Using Symantec NetBackup with VSS Snapshot to Perform a Backup of SAN LUNs in the Oracle ZFS Storage Appliance

Microsoft Dynamics GP. SmartList Builder User s Guide With Excel Report Builder

Configuration Guide for SQL Server This document explains the steps to configure LepideAuditor Suite to add and audit SQL Server.

Virtual Contact Center

Portal Administration. Administrator Guide

An Oracle White Paper February Rapid Bottleneck Identification - A Better Way to do Load Testing

Installing a Plug-in

Continuous Improvement with CA Service Desk Manager KPIs. Rich Magnuson

Oracle Enterprise Manager

Deliver Oracle BI Publisher documents to Microsoft Office SharePoint Server An Oracle White Paper July 2008

Virtual Contact Center

Oracle FLEXCUBE Direct Banking Release Retail Mutual Funds User Manual. Part No. E

How To Load Data Into An Org Database Cloud Service - Multitenant Edition

Application Notes for Calabrio Workforce Management Release 9.2(1) SR3 with Avaya Aura Contact Center Release 6.4 Issue 1.0

Rapid Bottleneck Identification A Better Way to do Load Testing. An Oracle White Paper June 2009

ACT! by Sage. Premium for Workgroups 2007 (9.0) Administrator s Guide to the ACT! Reader Utility

Scribe Demonstration Script Web Leads to Dynamics CRM. October 4,

Compatibility with Encryption Products

Oracle Enterprise Manager

Security Explorer 9.5. User Guide

Synchronization Agent Configuration Guide

Spotlight Management Pack for SCOM

An Oracle White Paper February Oracle Data Integrator 12c Architecture Overview

EMC Smarts Network Configuration Manager

EMC Documentum Interactive Delivery Services Accelerated Overview

Svn.spamsvn110. QuickStart Guide to Authentication. WebTitan Version 5

OpenLDAP Oracle Enterprise Gateway Integration Guide

Feith Document Database Version 8.1 Install Guide

Connector for CA Unicenter Asset Portfolio Management Product Guide - On Premise. Service Pack

Track and Trace. Administration Guide

How To Set Up Total Recall Web On A Microsoft Memorybook (For A Microtron)

ChangeAuditor 6.0 For Windows File Servers. Event Reference Guide

DBMoto 6.5 Setup Guide for SQL Server Transactional Replications

SIMPLIFY MICROSOFT CRM AND QUICKBOOKS INTEGRATION Microsoft Dynamics CRM Online to QuickBooks Bidirectional

DashBoard Beta Web Server

OPENGATE SMALL BUSINESS SOFTWARE

DeviceAnywhere Automation for Smartphones Setup Guide Windows Mobile

An Oracle White Paper September Oracle Team Productivity Center

Contents Notice to Users

DocAve for Office 365 Sustainable Adoption

ChangeAuditor 5.6. For Windows File Servers Event Reference Guide

Oracle Enterprise Manager

An Oracle White Paper March Integrating Microsoft SharePoint Server With Oracle Virtual Directory

An Oracle White Paper December Leveraging Oracle Enterprise Single Sign-On Suite Plus to Achieve HIPAA Compliance

Web Remote Access. User Guide

Companion for MS Analysis Server, v4

Lepide Active Directory Self Service. Installation Guide. Lepide Active Directory Self Service Tool. Lepide Software Private Limited Page 1

Symantec Enterprise Vault Technical Note. Administering the Monitoring database. Windows

Configuring and Monitoring Citrix Branch Repeater

Symantec Mobile Management for Configuration Manager

LDAP Synchronization Agent Configuration Guide for

Oracle Fusion Middleware

Oracle FLEXCUBE Direct Banking Release Corporate E-Factoring User Manual. Part No. E

Strong Authentication for Juniper Networks SSL VPN

Identikey Server Getting Started Guide 3.1

Keynote DeviceAnywhere/HP Application Lifecycle Management (HP ALM/QC) Integration Guide. TCE Automation 5.2

Transcription:

Tuning poor performing SQL s Using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor Version 1.0 Tuning poor performing SQL s using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor. Page 1 of 15

Copyright 1994-2006. EMC Corporation. All Rights Reserved. Documentum and the Corporate Logo are trademarks or registered trademarks of Documentum, Inc. in the United States and throughout the world. All other company and product names are used for identification purposes only and may be trademarks of their respective owners. Documentum 6801 Koll Center Parkway Pleasanton, CA 94566 925-600-6800 All Rights Reserved. Documentum, Documentum Content Server, Documentum Desktop, Documentum Webtop, Documentum Web Publisher, Documentum Web Development Kit, Documentum Developer Studio, Documentum Application Builder, Documentum Site Caching Services Documentum Content Caster, Content Rendition Services, Documentum Content Intelligence Services, Documentum Site Delivery Services, Documentum Content Authentication Services, Documentum Compliance Manager, Documentum Corrective Action Manager, Documentum DocViewer and DocInput are trademarks of Documentum, a division of EMC Corporation in the United States and other countries. All other company and product names are used for identification purposes only and may be trademarks of their respective owners. The information in this document is subject to change without notice and for internal use only. No part of this document may be reproduced, stored, or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Documentum, Inc. Documentum, Inc. assumes no liability for any damages incurred, directly or indirectly, from any errors, omissions, or discrepancies in the information contained in this document. All information in this document is provided AS IS, NO WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE MADE REGARDING THE INFORMATION CONTAINED IN THIS DOCUMENT. Tuning poor performing SQL s using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor. Page 2 of 15

Table of Contents Query Optimizer Modes... 3 Navigating SQL Tuning Advisor... 3 Identifying & Tuning poor performing SQL statements... 8 Other Input sources for SQL Tuning Advisor... 15 Query Optimizer Modes Before we delve in to how to tune poor performing SQL queries automatically, it will be worth understanding two modes in which Oracle query optimization works: Normal Mode This is the default mode in which query is optimized to get execution plan for vast majority of the SQL statements. Under this mode optimizer works in strict time constraints, mostly in fraction of a second and generates execution plan. Tuning Mode When Optimizer is invoked under tuning mode it is referred to as Automatic Tuning Optimizer. Tuning performed by automatic tuning optimizer is called Automatic SQL Tuning. Under this mode optimizer can take several minutes to tune one query. Navigating SQL Tuning Advisor Automatic SQL Tuning can be invoked through a server utility called SQL Tuning Advisor using Oracle Enterprise Manager. The following details step by step instructions on how to get to SQL Tuning Advisor. Tuning poor performing SQL s using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor. Page 3 of 15

Step 1: First logon to Oracle Enterprise Manager 10g by SYS user or equivalent as SYSDBA. By default OEM will be running on 1158 port on the database server unless it was modified at the installation time. To login to OEM use internet explorer and point to your database server as shown in this example: http://usitbadikvl1c:1158/em/console/logon/logon Tuning poor performing SQL s using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor. Page 4 of 15

Step2: Once logged in to OEM you will be presented with a dash board view of your instance. This view is very helpful in understanding the overall performance of the instance. Advisor Central Link Tuning poor performing SQL s using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor. Page 5 of 15

Step3: In the Related Links section below click on Advisor Central to navigate to the Advisor Central home page. SQL Advisor Tuning Central Advisor Link Tuning poor performing SQL s using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor. Page 6 of 15

Step4: From the Advisor Central home page, Click on SQL Tuning Advisor link under Advisors to identify all the sources (listed below) that you can use to run SQL Tuning advisor on. There are some more sources that will be discussed later in the document. Top Activity Period SQL SQL Tuning Sets Snapshots Preserved Snapshot Sets Top Activity Tuning poor performing SQL s using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor. Page 7 of 15

Identifying & Tuning poor performing SQL statements Step1: Click on Top Activity Link to identify Top SQL and Sessions in a given interval of time. Top SQL statements Scroll Bar Tuning poor performing SQL s using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor. Page 8 of 15

Step2: From the Top Activity page, set the View Data to Historical so that you can identify your time period that you are interested in analyzing. You can use the scroll bar located right below the graph to move the cursor so that you can select the period interested in monitoring. Once you identify the SQL Statement or multiple statements that are poorly performing you can either Schedule SQL Tuning Advisor independently or create a SQL Tuning Set to run SQL Tuning Advisor on it. SQL Tuning Set Name Tuning poor performing SQL s using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor. Page 9 of 15

Step3: To create SQL Tuning set click on all the statements that you are interested in analyzing and click on Create SQL Tuning Set that will present you the screen below. Step4: Once you created SQL Tuning Set you can run SQL Tuning Advisor on it by clicking on Schedule SQL Tuning Advisor link. Schedule SQL Tuning Advisor Step5: If you prefer running SQL Tuning Advisor on single SQL statement then just click the particular SQL and then click Schedule SQL Tuning Advisor to launch the screen below. You can name SQL Tuning session with your custom name or Oracle would create one for you automatically. Under the Scope, select the scope of tuning you want optimizer to perform. Limited will only take 1 second per statement. This is desired if you have lot of SQL statements that you are running SQL Tuning Advisor on. This mode will not recommend SQL Profile. Comprehensive as name states will perform thorough analysis of the query to recommend all the suggestions including SQL Profile. In this mode you can also limit the time you want optimizer to spend on a query. Tuning poor performing SQL s using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor. Page 10 of 15

As shown below, you can also schedule the query at a different time if you prefer so that you will not impact the peak time by running the advisor. SQL Tuning Advisor Name Scope Schedule Tuning poor performing SQL s using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor. Page 11 of 15

Step6: Once you run the SQL Tuning Advisor it will create a task and give recommendations for the SQL as below. In this case advisor has recommended a SQL Profile and also to restructure the SQL. You can view the recommendations by clicking on View Recommendations link to see them in detail. View Recommendations Tuning poor performing SQL s using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor. Page 12 of 15

Step7: You can review the recommendations and decide what you want to implement. In this case restructure SQL is suggesting Union All instead of Union. Depending on the query this might not be acceptable. But it also recommends a SQL Profile. You can implement the SQL profile by selecting the SQL profile and then click on Implement link above. SQL Profile allows optimizer to collect auxiliary statistics specific to the statement that will allow query to run with more information as though we are passing hints. SQL Profile also uses execution history and sampling to set optimizer mode for the particular statement. Implement recommendations Tuning poor performing SQL s using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor. Page 13 of 15

Step8: After implementing the SQL profile you can retest the query to see if it has helped in performance. You can also disable the SQL profile if it did not help performance. SQL ID SQL Profile has been applied. In the query that was tested in this example after applying the SQL profile it executed in less than 5 sec compared to more than 1 minute that it took before. Tuning poor performing SQL s using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor. Page 14 of 15

Step9: To disable the SQL Profile click on the SQL ID and navigate to Tuning Information tab, click on SQL Profile and then click disable. SQL Profile Enable / Disable. Other Input sources for SQL Tuning Advisor ADDM ADDM runs every one hour proactively and analyzes statistics generated by AWR report over the last hour to identify performance problems including poor performing SQL statements and advices to run SQL Tuning Advisor. AWR Report AWR Report can also be viewed directly to identify poor performing SQL statement and run SQL Tuning Advisor on them. SQL Tuning Set SQL Tuning Set can include statements that are yet to be deployed, to identify if they could be potential poor performing SQL statements in them that had to be analyzed before deploying. Tuning poor performing SQL s using Oracle 10g Enterprise Manager s Automatic SQL Tuning Advisor. Page 15 of 15