Performance/Scalability with JDBC, UCP & Oracle Database 12c

Slides:



Advertisements
Similar presentations
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Your customer as a segment of one That changes every second! Hein Van Der Merwe Chief.
Advertisements

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1.
Internet of Things Security Architecture
Oracle Universal Content Management and Storage Systems
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle SQL Developer Tips & Tricks Jeff Smith
Virtualization of Fixed Network Functions on the Oracle Fabric Krishna Srinivasan Director, Product Management Oracle Networking Savi Venkatachalapathy.
A Java Architecture for the Internet of Things Noel Poore, Architect Pete St. Pierre, Product Manager Java Platform Group, Internet of Things September.
Oracle Cloud Marketplace Neelesh Gurnani Director, Product Development Arif Khan Director, Product Management September 29, 2014 Copyright © 2014, Oracle.
1 - Oracle Server Architecture Overview
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle SQL Developer What’s New in Version 4.1 Jeff Smith
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Advanced Metadata Modeling Modeling for the Oracle Business Intelligence Cloud.
Turbocharge Your SAP Environment on Oracle SuperCluster [THT11481]
CON Software-Defined Networking in a Hybrid, Open Data Center Krishna Srinivasan Senior Principal Product Strategy Manager Oracle Virtual Networking.
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 2 Hidden Gems of APEX David Gale Software Engineer Oracle Application Express November,
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle SQL Developer For the DBA Jeff Smith
Oracle Fusion Pioneering the Consumerization of the Enterprise
The Safe Harbor The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated.
HOL9396: Oracle Event Processing 12c
Best Practices for Supporting Oracle Hyperion EPM and Business Intelligence Solutions Mitra Veluri Senior Principal Technical Support Engineer David Valociek.
Oracle Database 12c Data Protection and Multitenancy on Oracle Solaris 11 Xiaosong Zhu Senior Software Engineer Copyright © 2014, Oracle and/or its affiliates.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Amit Jha Project Leader, Product Management Oracle EBS Procurement & Contracts.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. JD Edwards Summit The Newest JDE Module – Rental Management Joel Sandberg Sales Consultant.
© 2009 Oracle Corporation. S : Slash Storage Costs with Oracle Automatic Storage Management Ara Vagharshakian ASM Product Manager – Oracle Product.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1 Preview of Oracle Database 12 c In-Memory Option Thomas Kyte
Getting Started with Oracle Compute Cloud
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. JD Edwards Summit PaaS from an Applications Perspective Charles McGuinness Director,
Oracle Confidential – Internal/Restricted/Highly RestrictedCopyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Identity Management.
Application Express 4.1 New Features Hilary Farrell, Principal Member of Technical Staff, Oracle.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 1.
1. When things go wrong: how to find SQL error Sveta Smirnova Principle Technical Support Engineer, Oracle.
1Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 8 Reporting from Contract.
A New IMS-Like Architecture for Enterprise Applications Reid Stidolph Master Principle Solutions Architect Communications Global Business Unit October.
2 Copyright © 2006, Oracle. All rights reserved. Performance Tuning: Overview.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1.
5 Database Features Every DBA Needs to Know About THT11267 Doug Chamberlain - Principal Product Manger, Oracle Copyright © 2014, Oracle and/or its affiliates.
RMB Billing UX Design Concepts / Proposals Peter Picone.
1 Robert Wijnbelt Health Check your Database A Performance Tuning Methodology.
Hadoop 2 cluster with Oracle Solaris Zones, ZFS and unified archives Orgad Kimchi - Principal Software Engineer September 29, 2014 Oracle Confidential.
1Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 8 Contract Management.
CON Software-Defined Networking in a Hybrid, Open Data Center Krishna Srinivasan Senior Principal Product Strategy Manager Oracle Virtual Networking.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. JD Edwards Summit Really Cool Demo Stuff – 2015 Edition!!!!! For demo content, please.
Quick Tips for Database Performance Tuning Sergey Koltakov Kurt Engeleiter Product Manager.
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Deploy Infrastructure Faster with Oracle’s Enterprise Cloud Infrastructure- ECI October.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Using Edition-based redefinition with PL/SQL How to deploy database code changes.
1. When things go wrong: how to find SQL error Sveta Smirnova Principle Technical Support Engineer, Oracle.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Realizing MWaaS on Private Cloud using Oracle Enterprise Manager Umesh Panwar /
Build Mobile Apps for Oracle E-Business Suite with Oracle Mobile Platform Bruce Bailey Principal Mobile/Social Solutions Consultant Jagadeesh Maira Senior.
RESTful Microservices In Java With Jersey Jakub Podlešák Software Engineer Oracle, Application Server Group September 29, 2014 Copyright © 2014, Oracle.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Planning & Budgeting Cloud Service (PBCS) Overview Business Analytics Product Group.
Maximum Application Availability with Oracle Database 12c
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. JD Edwards Summit Recruit and Learn Solutions Extend HR into the Cloud Marie Scott.
Travel and Transportation General Session and Industry Excellence Awards Vijay Anand, Oracle Sundar Swaminathan, Oracle September 30, 2014 Copyright ©
Oracle Business Intelligence Event 22 nd February 2012 Saxon Hotel, Johannesburg Business Intelligence Strategy Recommendations for Customers Using Oracle.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 1.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 5 Lifehacks for the Apex Development environment Five frameworks you should use.
3 Copyright © 2006, Oracle. All rights reserved. Designing and Developing for Performance.
Closing the Query Processing Loop in Oracle 11g Allison Lee, Mohamed Zait.
CON8473 – Oracle Distribution of OpenStack Ronen Kofman Director of Product Management Oracle OpenStack September, 2014 Copyright © 2014, Oracle and/or.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | What You Need to Know About User Defined Objects (UDOs) With Tools Release 9.2.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Daddy, what's a middle wear? An incredibly oversimplified explanation of what Middleware.
Flight Recorder in OpenJDK
OpenWorld 2018 How to Combine Data from Source Sites
Charles Phillips screen
Confidential – Oracle Internal/Restricted/Highly Restricted
Project Helidon Deep Dive
OpenWorld How to Prepare Data from Business Intelligence Cloud Service
Oracle Database Multilingual Engine
Principal Product Manager Oracle Data Science Platform
Presentation transcript:

Performance/Scalability with JDBC, UCP & Oracle Database 12c Nirmala Sundarappa Principal Product Manager & Douglas Surber Consulting Member Technical Staff Oracle JDBC & UCP October 2nd, 2014 This is a Title Slide with Picture slide ideal for including a picture with a brief title, subtitle and presenter information. To customize this slide with your own picture: Right-click the slide area and choose Format Background from the pop-up menu. From the Fill menu, click Picture and texture fill. Under Insert from: click File. Locate your new picture and click Insert. To copy the Customized Background from Another Presentation on PC Click New Slide from the Home tab's Slides group and select Reuse Slides. Click Browse in the Reuse Slides panel and select Browse Files. Double-click the PowerPoint presentation that contains the background you wish to copy. Check Keep Source Formatting and click the slide that contains the background you want. Click the left-hand slide preview to which you wish to apply the new master layout. Apply New Layout (Important): Right-click any selected slide, point to Layout, and click the slide containing the desired layout from the layout gallery. Delete any unwanted slides or duplicates. To copy the Customized Background from Another Presentation on Mac Click New Slide from the Home tab's Slides group and select Insert Slides from Other Presentation… Navigate to the PowerPoint presentation file that contains the background you wish to copy. Double-click or press Insert. This prompts the Slide Finder dialogue box. Make sure Keep design of original slides is unchecked and click the slide(s) that contains the background you want. Hold Shift key to select multiple slides. Apply New Layout (Important): Click Layout from the Home tab's Slides group, and click the slide containing the desired layout from the layout gallery. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

This is a Safe Harbor Front slide, one of two Safe Harbor Statement slides included in this template. One of the Safe Harbor slides must be used if your presentation covers material affected by Oracle’s Revenue Recognition Policy To learn more about this policy, e-mail: Revrec-americasiebc_us@oracle.com For internal communication, Safe Harbor Statements are not required. However, there is an applicable disclaimer (Exhibit E) that should be used, found in the Oracle Revenue Recognition Policy for Future Product Communications. Copy and paste this link into a web browser, to find out more information.   http://my.oracle.com/site/fin/gfo/GlobalProcesses/cnt452504.pdf For all external communications such as press release, roadmaps, PowerPoint presentations, Safe Harbor Statements are required. You can refer to the link mentioned above to find out additional information/disclaimers required depending on your audience.

Program Agenda 1 Connections Hard and Soft Parses LOB Operations Result Set Cache Array Operations/Stored Procedures Questions 2 3 4 5 6

Program Agenda 1 Connections Hard and Soft Parses LOB Operations Result Set Cache Array Operations/Stored Procedures Questions

Calls for a Connection Strategy Creating a DB connection is an expensive database operation Spawn O/S process, network connection, several roundtrips Associated database authentication and session creation Database Connections are expensive to tear down! Repeated Connection/Disconnection can be a huge scaling issue Calls for a Connection Strategy

Connection Management Strategy Client Side Connection Pool; Frequent short term connection usage Use Universal Connection Pool (UCP) Very large scale deployment Use Database Resident Connection Pool Single Instance and multiple databases Use Multi-tenant Database Multiple instances, single database scenario RAC Architecture

Planned Maintenance Development Steps Universal Connection Pool (UCP) Most convenient and works with most of the application containers such as Weblogic, Tomcat, Websphere, JBOSS etc., Built-in Failover mechanisms which makes it easier to use with RAC, RAC one etc., PoolDataSource pds = PoolDataSourceFactory.getPoolDataSource(); …. Connection conn = pds.getConnection(); Set the below UCP properties for better performance (1) Each 12c DB transaction is associated with a logical transaction ID (LTXID) (2) The main and only purpose of LTXIDs is to help make a reliable determination of the outcome of the last COMMIT statement (see Transaction Guard) (3) LTXIDs are issued by the RDBMS at the beginning of each transaction and changed only by when the transaction is committed or rolled back. UCP Properties Description setInitialPoolSize(), setMinPoolSize(), setMaxPoolSize() Set the Pool size based on your application setTimeToLiveConnectionTimeout() , setAbandonConnectionTimeout() Set the Connection Timeout appropriately setMaxStatements() Enable Statement Caching

Very Large Scale Deployment Database Resident Connection Pool (DRCP) Problem to Solve: eCommerce-style deployment => thousands of mid- tiers, each with it’s own client-side pool Database Resident Connection Pool (DRCP) Thousands of clients requiring database server session for a short period of time Applications mostly have same DB credentials & have identical session settings Specify (SERVER=POOLED) in short URL to enable DRCP Example: jdbc:oracle:thin:@//localhost:5221/orcl:POOLED Overwhlem the database Only 5 – 10% connbections in use => waste of memory and system resources

RAC for Scalability RAC, RAC one customers New Retry while service is unavailable alias = (DESCRIPTION_LIST= (LOAD_BALANCE=off) (FAILOVER=on) (DESCRIPTION=(CONNECT_TIMEOUT=90)(TRANSPORT_CONNECT_TIMEOUT=10)(RETRY_COUNT=10)(RETRY_DELAY=3) (ADDRESS_LIST= (LOAD_BALANCE=on) (ADDRESS=(PROTOCOL=TCP)(HOST=RAC-scan)(PORT=1521))) (CONNECT_DATA=(SERVICE_NAME=gold))) (DESCRIPTION=(CONNECT_TIMEOUT=90)(TRANSPORT_CONNECT_TIMEOUT=10)(RETRY_COUNT=10)(RETRY_DELAY=10) (ADDRESS=(PROTOCOL=TCP)(HOST= DG-scan)(PORT=1521))) (CONNECT_DATA=(SERVICE_NAME=gold)))) Connect time Load Balancing Safe for logon storms Balance IP’s in Scan Talk about Connect Time Load Balancing Vs Run time Load Balancing. The above URL is for customers using RAC, RAC One etc., Talk about the LOAD_BALANCE = ON and how it does the load balancing between the cluster

Program Agenda Connections Hard and Soft Parses LOB Operations Result Set Cache Array Operations/Stored Procedures Questions 2

Hard Parses About Hard Parse Parse structure and Execution Plan is thrown out when the statement is closed Problems to solve Causes library cache latch contention Causes shared pool contention Causes scalability issues Very bad on the server Solution Avoid Hard Parsing using Prepared Statement & Bind Variables Reduces hard parses on the server Reduces risk of SQL Injection: Potential Security issues.

Hard Parses An Example Instead of: Change to: String query = "SELECT EMPLOYEE_ID, LAST_NAME, SALARY FROM "+"EMPLOYEES WHERE EMPLOYEE_ID = " + generateNumber(MIN_EMPLOYEE_ID, MAX_EMPLOYEE_ID); pstmt = connection.prepareStatement(query); rs = pstmt.executeQuery(); Change to: String query = "SELECT EMPLOYEE_ID, LAST_NAME, SALARY FROM "+"EMPLOYEES WHERE EMPLOYEE_ID = ?"; pstmt = connection.prepareStatement(query); pstmt.setInt(1, n); rs = pstmt.executeQuery();

Soft Parses About Soft Parse Parse structure and Execution Plan are saved and re-used. Session executes a statement that exists in shared pool Creates session specific cursor context Metadata processing Problems to solve Though light weight, can take more time Solution Enable Statement caching oracleDataSource.setImplicit CachingEnabled(true) Choose the correct cache size to best utilize the memory connection.setStatementCac heSize(10);

Program Agenda Connections Hard and Soft Parses LOB Operations Result Set Cache Array Operations/Stored Procedures Questions 3

Large Objects (LOBs) LOB API Data API Recommended for offset based access Use for large LOBs (MBs) Data API Handle LOBs like LONG or LONG RAW columns Recommended for small LOBs No extra roundtrips Oracle Database 11g Improvements for LOBs BASIC LOBs: Tune SDU & Use PreFetching SECUREFILES LOBs: Vectored I/O (a.k.a. Zero Copy network transfer)

Program Agenda Connections Hard and Soft Parses LOB Operations Result Set Cache Array Operations/Stored Procedures Questions 4

Result Set Caching Shared across multiple connections from the same Data Source in the middle tier Faster access to frequently queried data Some of the benchmarks showed 3x improvement Server side configuration to enable Result Set Caching RESULT_CACHE_MAX_SIZE – Should be set to 0 RESULT_CACHE_REMOTE_EXPIRATION – Specifies expiration time (in minutes) for a result in the server result cache

Result Set Caching Problems to Solve Avoid Wasteful Re-execution Faster access to frequently queried data Some of the benchmarks showed 3x improvement Server side configuration to enable Result Set Caching RESULT_CACHE_MAX_SIZE – Should be set to 0 RESULT_CACHE_REMOTE_EXPIRATION – Specifies expiration time (in minutes) for a result in the server result cache

Program Agenda Connections Hard and Soft Parses LOB Operations Result Set Cache Array Operations/Stored Procedures Questions 5

Stored Procedures Best Practices Bundle multiple SQL statements in one call Use anonymous blocks or stored procedures Eliminates roundtrips to database Eliminates moving data between database and client Can improve performance dramatically Monitor roundtrips and bytes transferred stats High values may indicate optimization opportunities Oracle furnishes Java and PL/SQL Stored Procedures

Questions Questions ???