DB Performance Ana Stanescu CIS764 - Fall 08 KSU.

Slides:



Advertisements
Similar presentations
Office of the Accountant General (A&E) Andhra Pradesh Hyderabad
Advertisements

The Architecture of Oracle
ArrayExpress Oracle DBA Ahmet Oezcimen. Agenda 1. Tasks 2. System Overview 3. Oracle DB System 4. Database Monitoring 5. Database Security 6. Performance.
Introduction to Oracle
Acknowledgments Byron Bush, Scott S. Hilpert and Lee, JeongKyu
Overview of Database Administrator (DBA) Tools
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 2 Overview of Database Administrator (DBA) Tools.
Oracle Architecture. Instances and Databases (1/2)
Page Footer Keed Education Oracle Database Administration Basic Copyright 2009 Keed Education BV Version Concept.
INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2007 all rights.
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
1 - Oracle Server Architecture Overview
Harvard University Oracle Database Administration Session 2 System Level.
Harvard University Oracle Database Administration Session 5 Data Storage.
Advanced Databases Basic Database Administration Guide to Oracle 10g 1.
A Guide to Oracle9i1 Introduction to Oracle9i Database Administration Chapter 11.
Backup and Recovery Part 1.
Introduction History The principles of the relational model were first outlined by Dr. E.F Codd in a June 1970 paper is called “A Relational Model of Data.
Oracle Architecture. Database instance When a database is started the current state of the database is given by the data files, a set of background (BG)
Chapter 4 Physical Database Layouts Database Processing Chapter 4.
1 Copyright © 2005, Oracle. All rights reserved. Introduction.
1 Copyright © 2009, Oracle. All rights reserved. Exploring the Oracle Database Architecture.
IT The Relational DBMS Section 06. Relational Database Theory Physical Database Design.
Oracle Database Architecture An Oracle server: –Is a database management system that provides an open, comprehensive, integrated approach to information.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Oracle on Windows Server Introduction to Oracle10g on Microsoft Windows Server.
Basic Oracle Architecture
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
CSE 781 – DATABASE MANAGEMENT SYSTEMS Introduction To Oracle 10g Rajika Tandon.
Copyrighted material John Tullis 10/6/2015 page 1 Performance: WebSphere Commerce John Tullis DePaul Instructor
7202ICT Database Administration Lecture 7 Managing Database Storage Part 2 Orale Concept Manuel Chapter 3 & 4.
Extents, segments and blocks in detail. Database structure Database Table spaces Segment Extent Oracle block O/S block Data file logical physical.
Database Systems Slide 1 Database Systems Lecture 5 Overview of Oracle Database Architecture - Concept Manual : Chapters 1,8 Lecturer : Dr Bela Stantic.
7202ICT – Database Administration
1 Oracle Architectural Components. 1-2 Objectives Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing.
Oracle Tuning Ashok Kapur Hawkeye Technology, Inc.
Copyright © Oracle Corporation, All rights reserved. 1 Oracle Architectural Components.
An Oracle server:  Is a database management system that provides an open, comprehensive, integrated approach to information management.  Consists.
13 Copyright © 2006, Oracle. All rights reserved. Tuning PGA and Temporary Space.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Outline Introduction to Oracle Memory Structures SGA, PGA, SCA The Specifics of the System Global Area (SGA) Structures Overview of Program Global Areas.
Database structure and space Management. Segments The level of logical database storage above an extent is called a segment. A segment is a set of extents.
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Instance and Media Recovery Structures Supinfo Oracle Lab. 7.
Chapter 1Oracle9i DBA II: Backup/Recovery and Network Administration 1 Chapter 1 Backup and Recovery Overview MSCD642 Backup and Recovery.
Infrastructure for Data Warehouses. Basics Of Data Access Data Store Machine Memory Buffer Memory Cache Data Store Buffer Bus Structure.
18 Copyright © 2004, Oracle. All rights reserved. Backup and Recovery Concepts.
20 Copyright © 2008, Oracle. All rights reserved. Cache Management.
CS 440 Database Management Systems Lecture 6: Data storage & access methods 1.
Oracle Architecture - Structure. Oracle Architecture - Structure The Oracle Server architecture 1. Structures are well-defined objects that store the.
3 Copyright © 2004, Oracle. All rights reserved. Creating an Oracle Database.
18 Copyright © 2004, Oracle. All rights reserved. Recovery Concepts.
7 Copyright © Oracle Corporation, All rights reserved. Instance and Media Recovery Structures.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
Hands-On Microsoft Windows Server 2008 Chapter 7 Configuring and Managing Data Storage.
3 Copyright © 2004, Oracle. All rights reserved. Database Architecture Comparison.
What is Oracle ? Oracle is a relational database management system. It is a management system which uses the relational data model. In the relational data.
Select Operation Strategies And Indexing (Chapter 8)
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
Oracle Database Architectural Components
Chapter 21 SGA Architecture and Wait Event Summarized & Presented by Yeon JongHeum IDS Lab., Seoul National University.
Physical Database Design and Performance
Introduction To Oracle 10g
Oracle Memory Internals
Oracle Architectural Components
Database administration
Presentation transcript:

DB Performance Ana Stanescu CIS764 - Fall 08 KSU

2 Database Performance  Why does this topic fit in 764?  Why is this an issue in the industry? Advantages overweigh drawbacks  Need for better response from the db  Efficient use of resources  Experience and knowledge to do it correctly

3 My Presentation  DB performance Indexing  Tuning Oracle Installation Memory I/O CPU Secrets and Tips

4 INDEXING  A means of increasing database performance of queries Conceptually similar to book indexing Speed of operations is increased Data retrieval done better & faster Shortcut for the DB to find the records that match some search criteria

5 INDEXING  Data is stored in blocks Atomic disk operations to access them  Search problem Records can be sorted on just one field  If the records are not sorted, a linear search requires N/2 block accesses  If field is a non-key (not unique), the entire table space is searched at N block accesses

6 INDEXING: a way of sorting  Solution Indexing permits the sorting of data on multiple fields  Log N block accesses (Binary Search)  Once a higher value is found, the rest needs not be searched Creating an index on a field in a table creates another data structure which contains:  Value of the field  Pointer to the corresponding record  This index structure is then sorted Allows Binary Search to be performed on it

7 INDEXING Disadvantages (I)  The index structures occupy disk space Correct selection of fields to index  File systems size limits the number of indexes to be created xample: 5M records, block size 1MB, record length of 54b  need of almost 300,000 blocks  approx 19 block accesses to find a record

8 INDEXING Disadvantages (II)  Indexes have to be updated when the corresponding data is changed For static databases where heavy reporting is needed, more indexes are required to support the read-only queries For systems with numerous transactions that modify the data, fewer indexes provide higher data rates delivered

9 INDEXING  Heuristics Short index (lower disk work intensity) Columns targeted for indexing must have high selectivity (cardinality/#rows *Cardinality = uniqueness of data in a column Small percentage of duplicated values Covering queries (composite index - using more than one column)  Careful analysis, benchmarking, and testing

10 TUNING ORACLE  DBA responsible for optimizing the performance of Oracle software also application developers hardware experts  30% of SDLC dedicated to performance issues  Constant monitoring Third-party monitoring product

11 Installation Rules (I)  Readme file up-to-date info  Enough disk space up front  Allocate an extra of 20% for the installation process (requirements are lower than what is optimal)  O/S Level Privileges DBA overly rich in privileges Oracle must own its directory structure

12 Installation Rules (II)  SHARED_POOL_SIZE set to twice the suggested default  File Structure Recommended not to merge multiple physical drives into one large logical drive Allocate an entire device to hold Oracle data files (no partitioning) One directory point should point to one physical device Lay out large tablespaces into small manageable sections (limits imposed by backup devices and O/S)

13 Installation Rules (III)  DB creation issues Maxdatafiles set as highly as the O/S permits Redo Logs must be mirrored, as they are a single point of failure Minimal tablespace configuration: SYSTEM, ROLLBACK, TEMP, TOOLS, USERS* (small by default, ability to pre-allocate upfront if more space needed) Control files (recovery info and integrity maintenance) – min of 3 CF on different disk drives

14 Memory (I)  Maximize the requests satisfied in memory vs. performing I/O ops Hits vs. misses - DB buffer cache  query $kcbrbh table shows the effect of adding buffers: 500 buffers -> 1200 hits 1500 buffers -> 6700 hits  Background processes to support DB activity  PMON – process recovery  SMON – instance recovery  DBRW – writes info from buffers to db  LGWR – info from redo log buffer to online redo logs  CKPT – responsible for header updates (takes work away from LGWR) set to true if more than 20 db files  ARCH – copies redo logs  Trace Files (info about user sessions)

Memory (II)  SGA (system global area) Data and control info particular to an Oracle instance # of buffers dedicated to the cache # of bytes allocated to the shared SQL area  How much memory is enough? O/S, buffers, coexisting software, Oracle db, etc Roughly 3 times that calculated for the support of the Oracle systems  Shared pool (library & dictionary) v$ibrarycache dictionary (sql statements) info pertaining to segments (indexes, tables) 15

Memory (III)  Multithreaded Server Server work is done on behalf of the user by a dedicated process (shadow) Pool of server processes to be shared by users for Edited in the MTS Initialization Parameter File main memory conservation  SORT_AREA_SIZE parameter allocation of chunks of memory for sorting activities 512K (10g) default, DBA can increase it though if more than 25% of sort requests require disk space (using v$sysstat), increase is necessary 16

I/O (I)  Separate tablespaces for heavily accessed tables and their indexes and place them on separate disks  Knowing how data is to be accessed by end users  Rollback segments Must store enough information Info about concurrent actions Rollback segments must not be used in the system tablespace (b/c of extension needs)  Allocate at least one tablespace exclusively used for temporary segments 17

I/O (II)  Redo logs must reside on a disk that has a low rate of reads and writes  “Hot Spots” – files within Oracle db that are most heavily read or written to Command monitor fileio to see the content of the pool Make sure they are on separate disks 18

Oracle Indexing: B-Tree (wiki) 19

I/O (III)  The root node contains node pointers to intermediate nodes  Branch node contains pointers to other branch nodes (intermediate) nodes or leaf nodes  Leaf node contains index items and horizontal pointers to other leaf nodes. 20

I/O (IV)  block size b  h levels of entry Maximum # of records stored n = b h Insert, find, remove operations O(log b n) in worst case 21

I/O (V)  B-trees used to avoid large sorting operations  Columns with high cardinality minimum 10%  If the table has 1000 rows then the column to index should have at least 100 different values 22

CPU (I)  Maximizing CPU power Allocate as much memory as possible to the shared pool and database buffers Allocate more than default amount of memory to do sorting (sorts not requiring I/O use much less CPU) Minimize I/O to free up CPU On multi-CPU machines, make sure that one process per CPU deals with copying entries in the Redo Log Buffers 23

CPU (II)  Maximize availability by distributing the load over the business day and night  Backups Schedule 11:30 – 1:00PM tend to be most quiet  Up an running 24h a day Precious time is lost when db has to close for backup 24

Secrets and Tips (I)  Checkpoint process When does it occur? Data file updates appropriate area to signal that a checkpoint occurred Performed by the LGWR CKPT beneficial in systems with heavy transaction loads Adding another process to Oracle and O/S  When in doubt, enable it 25

Secrets and Tips (II)  Always run in archivelog mode for maximum protection against data loss  Use Trace files written by Oracle (poinponit problem areas)  When defragmenting oversized tables, the initial parameter for the table should be set to hold an additional 25% 26

Secrets and Tips (III)  For columns with low cardinality bitmapped indexing must be used  Example Blue Toyota Corollas manufactured in

28 References  Database Performance Tuning and Optimization by Sitansu S. Mittra xing+guidelines&source=gbs_summary_s&cad=0#PPP1,M1 xing+guidelines&source=gbs_summary_s&cad=0#PPP1,M1 (visited on December 4 th, 2008)  Tuning Oracle by Corey, Abbey and Dechichio (Oracle Press TM ) ISBN , McGraw Hill  Wiki (Visited on December 4 th, 2008)