New features in Oracle 11g for PL/SQL code tuning.

Similar documents
2014 Second Chance Act Planning and Implementa4on (P&I) Guide

IBM Cognos Open Mic Cognos Analytics 11 Part nd June, IBM Corporation

Review: SoBware Development

Servilla: Service Provisioning in Wireless Sensor Networks. Chenyang Lu

Designing a Social Network Prep for Lab 10. March 26, 2018 Sprenkle - CSCI Why classes and objects? How do we create new data types?

Kjell-Einar Anderssen. Country Manager Norway - Nutanix

Adaptive QoS Control for Real-Time Systems

Text UI. Data Store Ø Example of a backend to a real Could add a different user interface. Good judgment comes from experience

CS 5523: Operating Systems

Objec&ves. Tes&ng 11/8/16. by Frederick P. Brooks, Jr., 1986

Congress Lobbying Database: Documentation and Usage

1-1. Copyright 2015 Pearson Education, Inc.

Coverage tools Eclipse Debugger Object-oriented Design Principles. Oct 26, 2016 Sprenkle - CSCI209 1

Best Prac*ces & Training Guide for Professional Development and Networking - June 2011-

Objec&ves. Review. JUnit Coverage Collabora&on

CSCI 325: Distributed Systems. Objec?ves. Professor Sprenkle. Course overview Overview of distributed systems Introduc?on to reading research papers

LobbyView: Firm-level Lobbying & Congressional Bills Database

Objec&ves. Usability Project Discussion. May 9, 2016 Sprenkle - CSCI335 1

SQL Server T-SQL Recipes

Working Group In- progress Report to APNIC Member Mee9ng (AMM)

Final Review. Chenyang Lu. CSE 467S Embedded Compu5ng Systems

Bridging the Gap Between Legacy & Standards. d-wise. Bill Qubeck, Life Sciences Director

Educator Quality and Quan/ty

TinyOS and nesc. Ø TinyOS: OS for wireless sensor networks. Ø nesc: programming language for TinyOS.

Decentralised solutions for renewable energies and water in developing countries

ISO/IEC20000 Overview and Cer2fica2on Approach

HANDS ACROSS BORDERS. An International Workshop on. Alterna(ve Mechanisms to Establish and Govern Transboundary Conserva(on Ini(a(ves

SCHOOLMASTER. Appointment Scheduling. Student Information Systems. Revised - August Schoolmaster is SIF Certified

MWONGOZO; THE CODE OF GOVERNANCE FOR STATE CORPORATIONS. CS Catherine Musakali

There s a Cloud in My Enterprise

DevOps Course Content

LPGPU. Low- Power Parallel Compu1ng on GPUs. Ben Juurlink. Technische Universität Berlin. EPoPPEA workshop

Cluster Analysis. (see also: Segmentation)

OPTIMISING MEMBER ENGAGEMENT

Philips Lifeline. Ø Chenyang Lu 1

The optical memory card is a Write Once media, a written area cannot be overwritten. Information stored on an optical memory card is non-volatile.

Real- Time Wireless Control Networks for Cyber- Physical Systems

LS C2 to Simula0on Interoperability (C2SIM) - Lessons learned Near Future: plans for opera0onaliza0on

Certified Translation from German. Licence Agreement. 1. Subject-matter of the Agreement

CONSTRUCTION INDUSTRY DEVELOPMENT BOARD

October Next Generation Smart Border Security Ability. Quality. Delivery.

TNAU Weather so. Weather Database cum weather analysis so.ware

Dynamic Games Lesson 4: Economic Aplica4ons. Universidad Carlos III

CS 2461: Computer Architecture I

HISTORY GEOSHARE, DRINET, U2U

Lecture Series - MSG 141 Technical Architecture and Standards C2- Simula:on Interoperability (C2SIM)

Global Ci)zens and the U.S. Security Surveillance Dragnet. Center for Democracy & Technology Webinar 18 July 2013

MSL. Mul'-Robot Manipula'on without Communica'on. Zijian Wang and Mac Schwager

One View Watchlists Implementation Guide Release 9.2

File Systems: Fundamentals

Chapter 8: Recursion

2017 LEADERSHIP CONVENTION RULES AND PROCEDURES

Access to informa.on: Lessons from Fukushima Nuclear Accident

ForeScout Extended Module for McAfee epolicy Orchestrator

OUR PANELISTS. Linda Morrison L&D Academy Administrator Travelex. Be+y Mills L&D Manager Centra Health. Ma+ Hart L&OD Resource Officer Metropolitan

Cyber-Physical Systems Scheduling

Creating and Managing Clauses. Selectica, Inc. Selectica Contract Performance Management System

FM Legacy Converter User Guide

Overview Purpose of the EU-VIS

Safer internet evening. 11 February 2014

Lab 11: Pair Programming. Review: Pair Programming Roles

Using CAS Cross-Functional Frameworks to Facilitate a Collaborative FYE Approach

Fall 2016 COP 3223H Program #5: Election Season Nears an End Due date: Please consult WebCourses for your section

Why Consider EPR for Packaging? An Industry Perspective

The 10- Year Framework of Programmes on Sustainable Consump=on & Produc=on. * An Intergovernmental mandate * Introduction

Processes. Criteria for Comparing Scheduling Algorithms

Online Ballots. Configuration and User Guide INTRODUCTION. Let Earnings Edge Assist You with Your Online Ballot CONTENTS

GEM Errata #2. 1. Introduction. 2. Technical Issues. 2.1 Clause 11

Supreme Court of Florida

LOS ANGELES UNIFIED SCHOOL DISTRICT PERSONNEL COMMISSION AGENDA / ORDER OF BUSINESS CONSENT ITEMS

Software License Agreement for Beckhoff Software Products

Peter Dwight Business Analyst Office Ins1tu1onal Effec1veness Pasadena City College

Estonian National Electoral Committee. E-Voting System. General Overview

Records Reten+on Basics for ESDs Texas State Associa+on of Fire and Emergency Districts (SAFE-D) Annual Conference Galveston, TX February 24, 2018

Ø Grantham Systems Incorporated is dedicated to the preservation of life, liberty, and the right of all people to be safe and secure.

FairCom Press Release Archive:

Operating Systems. Chenyang Lu

County Clerk s Office Election Division Voting System

Nicole Virga Bau3sta March 20, 2017

Work Comp Litigation Basics

Uninformed search. Lirong Xia

Maps, Hash Tables and Dictionaries

Maps and Hash Tables. EECS 2011 Prof. J. Elder - 1 -

DRAFT. Republic of South Africa. Form CoR Companies and Intellectual Property Commission. Contacting the Commission

Support Vector Machines

Probabilistic earthquake early warning in complex earth models using prior sampling

Energy Efficiency Good Practice Examples from the Energy Efficiency Directive Concerted Action

Plan For the Week. Solve problems by programming in Python. Compsci 101 Way-of-life. Vocabulary and Concepts

An#- Social Behaviour, Crime and Policing Act 2014

Applica'on of UQ Principles to Calibra'on, Sensi'vity, and Experimental Design

Clause Logic Service User Interface User Manual

Supreme Court of Florida

State of Minnesota Department of Public Safety Bureau of Criminal Apprehension

DOING BUSINESS WITH US. Schenectady, NY

Objec&ves. Review. So-ware Quality Metrics Sta&c Analysis Tools Refactoring for Extensibility

Supreme Court of Florida

YOOCHOOSE GmbH Terms and Conditions Subject Matter

GENERAL GUIDELINES FOR NATIONAL TOURISM ADMINISTRATIONS (NTAs) RELATIVE TO THE DEVELOPMENT OF THE TOURISM SATELLITE ACCOUNT (TSA)

UNITED STATES [DISTRICT/BANKRUPTCY] COURT FOR THE DISTRICT OF DIVISION., ) ) Plaintiff, ) ) vs. ) Case No. ), ) Judge ) Defendant.

Educa&on Agency Presenta&on Ways and Means Educa&on Subcommi8ee February 2017

Transcription:

New features in Oracle 11g for PL/SQL code tuning. 1-1 -

Speakers Nikunj Gadoya Nikunj is working in Blink Consul4ng as Technical Consultant for more than 2 years now. He did his engineering in computer science from Hindustan college, Mumbai. With good communica4on skills & team player abili4es he is proficient in coding and implementa4on of Oracle applica4ons. He is a Oracle cer4fied professional (OCP) with rich experience in PL/SQL and SQL* Loader. Pushpal Kumbhare Pushpal is working in Blink Consul4ng as Technical Consultant for more than three years now. He did his engineering in Informa4on Technology from SGGSIE&T college, Nanded. With good communica4on skills & team player abili4es he is proficient in coding, implementa4on and tuning of Oracle applica4ons. He posses rich experience in design and development of Interfaces and APIs in Oracle E- Business suite. - 2 -

Agenda Ø Factors compelling code op4miza4on Ø Best Prac4ces for code op4miza4on Ø PLSQL coding challenges Ø 11g features for bexer code performance Ø Scenarios for code tuning Ø Few 4ps to consider Ø Conclusion Ø Q & A - 3 -

Blink Consul4ng Blink Consul4ng is a global consul4ng and technology company, headquartered in Boston, MA. Its an Oracle Gold Partner assis4ng its customers in achieving business goals while maximizing value on their Investments. Since its incep4on in 2005 it has grown as a trusted partner in providing innova4ve, cost effec4ve and robust solu4ons across several industries. it is one of the fastest growing company in USA in the year 2010. Our Services include: Ø Business Intelligence Ø Enterprise Performance Management (Hyperion) Ø Oracle EBS Upgrade and Implementa4on Ø Oracle Process Manufacturing Ø Enterprise Managed Services - 4 -

Factors compelling code op4miza4on Complex Business OperaFons Increased demand for IT opfmizafon Risk associated with changing Business needs - 5 -

Best prac4ces for code op4miza4on InformaFon gathering and delivering Knowledge of all new features for latest versions of Oracle database Keeping track of Oracle frequent releases and latest version upgrades Maintaining high quality of service - 6 -

PLSQL coding challenges TradiFonal PLSQL coding drawbacks Slow execufon of code Excess Memory consumpfon LocaFng the issues - 7 -

11g features for bexer code performance Ø BULK COLLECT Ø PL/SQL Func4on Result Cache Ø NOCOPY hint Ø SEQUENCE in PL/SQL Expressions Ø FOLLOWS and COMPOUND TRIGGERS keyword Ø Automa4c Subprogram Inlining Ø Advance collec4on features - 8 -

BULK COLLECT Ø The most important performance op4miza4on feature of PLSQL Ø BULK PROCESS: Speed up the repeated execu4on of the same SQL statements by reducing number of context switches Ø Uses PGA: Run faster but consume more memory Ø Oracle provides various clauses to avoid excess use of PGA LIMIT EXIT Ø Examples: Retrieve bulk data Explicit cursors vs. Bulk Collect Simple Bulk Collect Bulk Collect with LIMIT clause - 9 -

PL/SQL Func4on Result Cache Ø Improved and a high- impact feature. Ø Use RESULT_CACHE clause in func4on to get (cache) the result of last invoked func4on(same parameters). Hence, skip the re- execu4on of func4on. Results in bexer performance. Ø RESULT_CACHE uses a global memory alloca4on (SGA)and the cache is available across the sessions. It flushes out memory when needed for system to store the new results. Ø Required Setup: Set RESULT_CACHE_MAX_SIZE as desired Set all the parameters to default Ø Examples: Func4on without RESULT_CACHE Func4on with RESULT_CACHE - 10 -

NOCOPY Hint Ø Copying of actual parameters to formal parameters and vise versa, slows down the execu4on of code Ø When parameters hold large data structures such as collec4ons, records etc, memory usage increases and slows down execu4on of code Ø NOCOPY is a hint to compiler Ø Instruct compiler to pass OUT & IN OUT parameters by reference Ø Examples: without NOCOPY with NOCOPY - 11 -

Dynamic SQL Features Ø Na4ve Dynamic SQL(NDS) does not support large SQL string Ø NDS needs to know no. of bind inputs and outputs Ø DBMS_SQL Ø New func4ons in 11g: DBMS_SQL.TO_NUMBER_CURSOR DBMS_SQL.TO_REFCURSOR - 12 -

SEQUENCE in PL/SQL Expressions Ø Oracle has added sequence fetching to the list of PLSQL expressions Ø Pseudo- columns can be assigned to a variable Ø Sequence expression can also be used to set default values Ø Sequence pseudo- columns can be referenced directly. Hence, variable assignment can be bypassed Ø Removed DUAL table, for SEQUENCE value retrieval - 13 -

FOLLOWS and COMPOUND TRIGGERS COMPOUND TRIGGERS: Ø Perform mul4ple ac4ons at different 4ming points on a single table Ø These 4ming points can share a single global declara4on sec4on Ø Once the statement ends, trigger state is cleaned up Ø 11g allows COMPOUND TRIGGER clause Ø Fires at each 4ming point associated with DML statements - 14 -

FOLLOWS and COMPOUND TRIGGERS (Contd ) FOLLOWS Keyword: Ø Specify the sequence of execu4on Ø FOLLOWS helps to design mul4ple triggers on same object at same 4ming point Ø Helps in tracking the execu4on of specified ac4ons and results Ø Easy debugging - 15 -

Sub- program Inlining Ø Every call to func4on / procedure causes slight performance overhead Ø Subprogram Inlining reduces the overheads of calling func4ons / procedures repeatedly Ø Replaces subrou4ne call during compila4on Ø Developer can con4nue to write well constructed, modular code without any performance issues Ø Greater op4miza4on benefits for procedural code Ø Controlled by PLSQL_OPTIMIZE_LEVEL and INLINE pragma. Ø Improved performance Ø SETUPS: PLSQL_OPTIMIZE_LEVEL = 2 (default). PLSQL_OPTIMIZE_LEVEL = 3 ; Inlines the code. PRAGMA INLINE (proc_name,'no/yes'); - 16 -

Scenarios for code tuning Ø Program that performs lot of calcula4ons Ø Func4ons that are called from PLSQL queries Ø Programs that performs lot of INSERT, UPDATE or DELETE or looping through query results Ø Older code on newer version of database without u4lizing the database features - 17 -

Few 4ps to consider Ø Avoid CPU Overhead with: More efficient SQL statements, func4on calls and loops Avoid DataType conversion Ø Avoid Memory Overhead with: Declaring size for VARCHAR2 variables Grouping sub- programs into a package Ø Reducing Loop Overhead for DML & SQL Queries: FORALL BULK COLLECT Ø Tuning PL/SQL Procedure Calls: NOCOPY compiler hint Compiling PLSQL code for Na4ve Execu4on - 18 -

Conclusion Ø Simple code 4ps like those highlighted above can aid the developers in wri4ng bexer and error- free programs and get desired results Ø This will eventually result in an op4mized system performance with minimal shortcomings - 19 -

- 20 -

Connect us @ Nikunj Gadoya Email:ngadoya@blinkconsulFng.com Profile: hwp://www.linkedin.com/in/nikunjgadoya Pushpal Kumbhare Email:pkumbhare@blinkconsulFng.com Profile: hwp://www.linkedin.com/in/pushpalk - 21 -