Oracle and.net: Best Practices for Performance. Christian Shay & Alex Keh Product Managers Oracle October 28, 2015

Similar documents
Best Practices for Performance

Best Practices for Performance Part 1.NET and Oracle Database

Best Practices for Performance Part 2.NET and Oracle Database

Getting Started with Oracle and.net

Getting Started with Oracle and.net

Copyright 2013, Oracle and/or its affiliates. All rights reserved.

Oracle and.net Introduction and What s New. Copyright 2017, Oracle and/or its affiliates. All rights reserved.

What s New for.net Developers in Oracle Database

<Insert Picture Here> Getting Started with Oracle and.net

Copyright 2013, Oracle and/or its affiliates. All rights reserved.

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

PL/SQL Programming for.net Developers: Tips, Tricks, and Debugging. Christian Shay Product Manager, Oracle

What s New with Oracle Database 12c on Windows: On-Premises and in the Cloud

<Insert Picture Here> What's New for.net Developers for Oracle Database

Copyright 2013, Oracle and/or its affiliates. All rights reserved.

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Using.NET Core and Entity Framework Core Linux/Windows with Oracle Database

The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into

<Insert Picture Here> Scale your PHP Application to Tens of Thousands of Connections

What s New for Oracle Database 11gR2 on Windows?

SQL Gone Wild: Taming Bad SQL the Easy Way (or the Hard Way) Sergey Koltakov Product Manager, Database Manageability

Copyright 2018, Oracle and/or its affiliates. All rights reserved.

OpenWorld 2018 SQL Tuning Tips for Cloud Administrators

Oracle APEX 18.1 New Features

Pro ODP.NET for Oracle. Database 11 g. Edmund Zehoo. Apress

Moving Databases to Oracle Cloud: Performance Best Practices

Consolidate and Prepare for Cloud Efficiencies Oracle Database 12c Oracle Multitenant Option

Oracle NoSQL Database at OOW 2017

Oracle 1Z0-054 Exam Questions and Answers (PDF) Oracle 1Z0-054 Exam Questions 1Z0-054 BrainDumps

Performance Innovations with Oracle Database In-Memory

Javaentwicklung in der Oracle Cloud

Safe Harbor Statement

2008 Oracle Corporation

What every DBA needs to know about JDBC connection pools Bridging the language barrier between DBA and Middleware Administrators

Oracle Recovery Manager Tips and Tricks for On-Premises and Cloud Databases

Session id: The Self-Managing Database: Guided Application and SQL Tuning

Oracle EXAM - 1Z Oracle Database 11g: Performance Tuning. Buy Full Product.

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Putting Oracle Database 11g to Work for Java. Kuassi Mensah Group Product Manager, Java Platform Group db360.blogspot.com

Multitenancy and Continuous Availability for Java Applications Oracle Database 18

Understanding Oracle RAC ( ) Internals: The Cache Fusion Edition

DBAs can use Oracle Application Express? Why?

<Insert Picture Here> DBA Best Practices: A Primer on Managing Oracle Databases

Create a DBaaS Catalog in an Hour with a PaaS-Ready Infrastructure

Oracle Database 12c R2: RAC Administration Ed 2

Oracle Performance Tuning. Overview of performance tuning strategies

Introducing Oracle Machine Learning

Using Automatic Workload Repository for Database Tuning: Tips for Expert DBAs. Kurt Engeleiter Product Manager

Personalized Experiences Enabled Through Extensibility

<Insert Picture Here> DBA s New Best Friend: Advanced SQL Tuning Features of Oracle Database 11g

Data-and-Compute Intensive Processing: Middle-tier or Database? Trade-Offs and Case Study. Kuassi Mensah Marcelo Ochoa Oracle

Oracle GoldenGate 12c

Oracle Secure Backup 12.2 What s New. Copyright 2018, Oracle and/or its affiliates. All rights reserved.

Copyright 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 13

Press Release Writing Tips and Tricks for the Enterprise Technology Space

Oracle Data Provider for.net Microsoft.NET Core and Entity Framework Core O R A C L E S T A T E M E N T O F D I R E C T I O N F E B R U A R Y

Oracle Database 12c: RAC Administration Ed 1

A RESTful Java Framework for Asynchronous High-Speed Ingest

Oracle Database 12c: Performance Management and Tuning

Help Us Help You - TFA Collector and the Support Tools Bundle

WLS Neue Optionen braucht das Land

Oralogic Education Systems

EZY Intellect Pte. Ltd., #1 Changi North Street 1, Singapore

Oracle Enterprise Manager 12c IBM DB2 Database Plug-in

Copyright 2013, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12

Oracle Advanced Compression: Reduce Storage, Reduce Costs, Increase Performance Bill Hodak Principal Product Manager

Global Data Services (GDS)

OS-caused Long JVM Pauses - Deep Dive and Solutions

Oracle Database Exadata Cloud Service Exadata Performance, Cloud Simplicity DATABASE CLOUD SERVICE

Copyright 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12

Database Level 100. Rohit Rahi November Copyright 2018, Oracle and/or its affiliates. All rights reserved.

Security Compliance and Data Governance: Dual problems, single solution CON8015

<Insert Picture Here> Oracle SQL Developer: PL/SQL Support and Unit Testing

Oracle Enterprise Data Quality - Roadmap

Copyright 2018, Oracle and/or its affiliates. All rights reserved.

Connecting your Microservices and Cloud Services with Oracle Integration CON7348

How to Troubleshoot Databases and Exadata Using Oracle Log Analytics

<Insert Picture Here> QCon: London 2009 Data Grid Design Patterns

Using Oracle STATSPACK to assist with Application Performance Tuning

Oracle 1Z Oracle Database 11g: Advanced PL/SQL.

Oracle Database In-Memory What s New and What s Coming

The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into

What's New in MySQL 5.7?

Oracle Database 12c: RAC Administration Ed 1 LVC

Building Highly Available and Scalable Real- Time Services with MySQL Cluster

SQLDevTipsTricks. Jeff Smith Senior Principal Product Database Tools, Oracle Corp

KillTest *KIJGT 3WCNKV[ $GVVGT 5GTXKEG Q&A NZZV ]]] QORRZKYZ IUS =K ULLKX LXKK [VJGZK YKX\OIK LUX UTK _KGX

SQL Tuning for Expert DBAs

Oracle Enterprise Manager 12c Sybase ASE Database Plug-in

Trouble-free Upgrade to Oracle Database 12c with Real Application Testing

Oracle SQL Developer & REST Data Services

Open And Linked Data Oracle proposition Subtitle

Safe Harbor Statement

Safe Harbor Statement

ORACLE 11g R2 New Features

Getting started with Oracle Cloud Infrastructure Level 100

Copyright 2018, Oracle and/or its affiliates. All rights reserved.

Oracle Database 11g: New Features for Administrators Release 2

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

Intelligent Caching in Data Virtualization Recommended Use of Caching Controls in the Denodo Platform

Transcription:

Oracle and.net: Best Practices for Performance Christian Shay & Alex Keh Product Managers Oracle October 28, 2015 Oracle Confidential Internal/Restricted/Highly Restricted

Program Agenda 1 2 3 4 Optimization Process Optimizing ODP.NET Performance (Connections, Data Retrieval and Updates, ODP.NET Data Types) Oracle Performance Analyzer and SQL Tuning Advisor Caching

Optimization Process Oracle Confidential Internal/Restricted/Highly Restricted 4

Oracle.NET Application Performance Optimization Steps.NET data access tuning Use ODP.NET best practices SQL tuning Use SQL Tuning Advisor in Visual Studio Database tuning under real world conditions Oracle Performance Analyzer in Visual Studio detects issues you have missed May need to modify application based on findings Can be used during testing phase or production

Optimizing ODP.NET Performance

General All ODP.NET Objects Close/Dispose all ODP.NET objects explicitly Garbage collector cannot reliably implicitly dispose objects under heavy load May see increasing memory usage Can use Using statement instead Recommended for all ODP.NET objects

Connections Use connection pooling Min Pool Size = # connections at steady state or average load Max Pool Size = # connections at maximum capacity Min and Max Pool Size always obeyed over other CP attributes See documentation for connection pooling parameter options ODP.NET performance counters Monitor with Windows Performance Monitor More granularity in monitoring New in ODAC 12c Monitor at app domain, pool, or DB instance level See documentation for details on how to enable

Connection Management RAC, Data Guard, and GoldenGate Run-time connection load balancing Automated load balanced at connection dispense Set Load Balancing = true Fast Connection Failover Automatic severed connection removal Set HA Events = true

Commands Bind Variables Prevents re-parsing of frequently executed statements Works with SQL and PL/SQL statements Improves subsequent command executions Literal value changes forces a re-parse and re-optimization Literal values should become bind variables Executed statements stored in Oracle shared pool Re-parsing and re-optimization uses CPU and requires shared pool locks

Commands Statement Caching Retains previously parsed statement in shared pool Prevents repeated parsing in server Caches most recently used statements Works with SQL and PL/SQL statements Best with bind variables Self-tuned cache size on by default No code changes needed

Commands Data Retrieval Control how much data is retrieved per DB roundtrip Too much data retrieved excessive client-side memory used Too little data retrieved additional round trips Use OracleCommand.RowSize and OracleDataReader.FetchSize to control result size RowSize populated after statement execution Set dynamically at run-time FetchSize can be set as multiple of RowSize

D E M O N S T R A T I O N Fetch Size and Row Size

Commands Statement Batching Use OracleDataAdapter.UpdateBatchSize to batch updates from DataSet Execute multiple commands in one DB roundtrip Use anonymous PL/SQL

Commands Mass Data Movement with Arrays PL/SQL associative arrays Pass large amounts of data between.net and DB of the same data type Use parameter array binding Useful if executing the same statement multiple times Bind variables are the same, variable values can be different One execution for each element in the bound array

REF Cursors OracleRefCursor class Defers result set retrieval until needed Usage: Can create REF cursors as part of an anonymous PL/SQL block Can return REF cursors from stored procedures Can pass REF Cursors to database as input stored procedure parameters Retrieve data as needed Control data retrieved via FetchSize Fill a DataSet with just a portion of the REF Cursor result

SecureFiles and LOBs Data retrieval options Control amount of data returned with OracleCommand.InitialLOBFetchSize Retrieve a chunk using OracleClob and OracleBlob classes Read method Use Search method to find data to be retrieved Update/Insert/Delete SQL statements acting on LOBs Modify LOB without retrieving the data to the client side Uses LOB locator Use SecureFile data type in Oracle Database 11g and higher

Oracle Performance Analyzer and SQL Tuning Advisor

SQL Tuning Advisor Included with Oracle Developer Tools for Visual Studio Use when designing new SQL statements Tune ad-hoc SQL statements in Query Window Tune bad SQL found by Oracle Performance Analyzer Use if SQL is performing poorly under load

SQL Tuning Advisor Requirements ADVISOR privilege Oracle Database license for Oracle Diagnostic Pack Oracle Database license for the Oracle Tuning Pack How to run: Oracle Query Window Tune SQL button Oracle Performance Monitor Tune SQL button

D E M O N S T R A T I O N SQL Tuning Advisor

Oracle Performance Analyzer Included with Oracle Developer Tools for Visual Studio Detects performance issues in an application s use of the database under load Requirements SYSDBA Oracle Database license for Oracle Diagnostic Pack Can be use during testing Can be also used on production applications

Oracle Performance Analyzer Simple to use Run your application Enter amount of time to analyze Press Start to start timer Sufficient database time required to get results View findings and actions Implement recommended actions Run Oracle Performance Analyzer again until no remaining issues

D E M O N S T R A T I O N Performance Analyzer

Caching

Oracle.NET Caching Solutions Oracle.NET client-side DB caches Client Result Cache Continuous Query Notification (CQN) customizable cache TimesTen In-Memory Database Automatically updates/alerts client cache upon server changes Each serves separate caching requirements Server-side caches can be used with.net DB In-Memory option Server result cache Etc.

Oracle Client Result Cache Automatically updating query result set cache Benefits Easy to use No code changes required Snapshot consistent Cache refreshes without user intervention More scalability and performance Data retrieval from client, rather than server No additional round trips

Oracle Client Result Cache Updates 1. Upon data change, client receives change notification on subsequent round trip (or max lag) Invalidation notifications piggyback on existing client round trips No changes to the cache results yet 2. Cache waits for next execution to refresh results Does not initiate an independent round trip No unnecessary DB traffic Cache entries do not timeout Uses Least Recent Used algorithm

D E M O N S T R A T I O N Client Result Cache

Oracle Continuous Query Notification (CQN) Programmatic control over cache notifications and updates Also known as Database Change Notification Benefits over Client Result Cache More control over how cache behavior What if multiple DB usernames access the same results? What if only a subset of the cached data is required? How long should a query be cached? Do I want additional logic executed when the cache is refreshed? Requires significant customization CQN provides cache infrastructure

Data Change OracleCommand Notification Request Execute() TABLE Data Dictionary Add Dependency OnChange OracleDependency Application Listener Notification Queue

Oracle TimesTen In-Memory Database Memory-Optimized Relational Database Fully featured relational database Oracle compatible SQL and PL/SQL Persistent and durable Transactions with ACID properties Flexible options for durability Exceptional performance Instantaneous response time, high throughput, embeddable ODP.NET TimesTen provider for TimesTen DB Same ODP.NET APIs

Upcoming.NET Sessions Deep-Dive into Oracle Data Provider for.net, Managed Driver and Entity Framework Thursday 12:00 PM 12:45 PM Moscone South 303 SQL and PL/SQL Development and Leveraging Oracle Multitenant in Visual Studio Thursday 1:15 PM 2:00 PM Moscone South 303

Additional Oracle.NET Resources OTN otn.oracle.com/dotnet Twitter twitter.com/oracledotnet YouTube youtube.com/oracledotnetteam Email alex.keh@oracle.com & christian.shay@oracle.com

Q+A

Safe Harbor Statement The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle s products remains at the sole discretion of Oracle. Oracle Confidential Internal/Restricted/Highly Restricted 36

Session Surveys Help us help you!! Oracle OpenWorld would like to invite you to take a moment to give us your session feedback. Your feedback will help us to improve your conference. Please be sure to add your feedback for your attended sessions by using the Mobile Survey or in Schedule Builder. Oracle Confidential Internal/Restricted/Highly Restricted 37

Oracle Confidential Internal/Restricted/Highly Restricted 38

Keep Learning with Oracle University Classroom Training Learning Subscription Live Virtual Class Training On Demand Cloud Technology Applications Industries education.oracle.com Oracle Confidential Internal 39