Database Performance on AIX in DB2 UDB and Oracle Environments
Total Page:16
File Type:pdf, Size:1020Kb
Database Performance on AIX in DB2 UDB and Oracle Environments Nigel Griffiths, James Chandler, João Marcos Costa de Souza, Gerhard Müller, Diana Gfroerer International Technical Support Organization www.redbooks.ibm.com SG24-5511-00 SG24-5511-00 International Technical Support Organization Database Performance on AIX in DB2 UDB and Oracle Environments December 1999 Take Note! Before using this information and the product it supports, be sure to read the general information in Appendix E, “Special notices” on page 411. First Edition (December 1999) This edition applies to Version 6.1 of DB2 Universal Database - Enterprise Edition, referred to as DB2 UDB; Version 7 of Oracle Enterprise Edition and Release 8.1.5 of Oracle8i Enterprise Edition, referred to as Oracle; for use with AIX Version 4.3.3. Comments may be addressed to: IBM Corporation, International Technical Support Organization Dept. JN9B Building 003 Internal Zip 2834 11400 Burnet Road Austin, Texas 78758-3493 When you send information to IBM, you grant IBM a non-exclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright International Business Machines Corporation 1999. All rights reserved. Note to U.S Government Users – Documentation related to restricted rights – Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp. Contents Preface...................................................xv How this book is organized .......................................xv The team that wrote this redbook. ..................................xvi Commentswelcome.............................................xix Chapter 1. Introduction to this redbook .........................1 Part 1. RDBMS concepts .................................................3 Chapter 2. Introduction into relational database system concepts....5 2.1WhatisanRDBMS?.......................................5 2.2 What does an RDBMS provide? . ...........................10 2.3 The database performance trick . ...........................13 2.4 What are the components of an RDBMS? .....................15 2.5 Defining the RDBMS terms and ideas . ......................22 2.5.1RDBMSterms.......................................22 2.6 Structured Query Language ................................29 2.7Howdowemakethedatasafe?.............................31 2.8Backupandperformance..................................35 2.8.1Backupmedia.......................................35 2.8.2Fullorpartialbackup.................................37 2.8.3Physicalandlogicalbackup............................37 2.8.4Onlineandoff-linebackup.............................38 2.8.5 Backup recommendations . ...........................40 Chapter 3. Types of workload ................................43 3.1OnlineTransactionProcessing(OLTP).......................43 3.2OnlineAnalyticalProcessing(OLAP).........................44 3.3 Decision Support Systems (DSS) . ...........................46 3.3.1 Data warehouse .....................................47 3.3.2Datamart..........................................47 3.3.3 Business Intelligence (BI) . ...........................48 3.3.4Datamining........................................48 3.4 Enterprise Resource Planning (ERP) . ......................49 3.5e-Business.............................................51 3.6 Reporting . ............................................52 Chapter 4. Specific databases................................55 4.1 DB2 UDB Database architecture . ...........................55 4.1.1Memorystructures...................................55 4.1.2 Logical storage structures. ...........................56 © Copyright IBM Corp. 1999 iii 4.1.3Physicalstoragestructures.............................59 4.1.4Processes.........................................62 4.1.5 SQL extensions - Stored procedures .....................65 4.1.6Administrationtools..................................66 4.2 Oracle database architecture ...............................68 4.2.1Memorystructures...................................68 4.2.2 Logical storage structures. ...........................70 4.2.3Physicalstoragestructures.............................72 4.2.4Processes.........................................73 4.2.5 SQL extensions - Stored procedures .....................76 4.2.6Administrationtools..................................77 Chapter 5. Parallel databases ................................81 5.1Parallelconceptsindatabaseenvironments....................81 5.1.1Sharedmemory.....................................81 5.1.2Shareddisks.......................................82 5.1.3Sharednothing......................................83 5.2 DB2 UDB Enterprise - Extended Edition (EEE). ................84 5.2.1Conceptsandfunctionality.............................84 5.2.2Optimizer..........................................86 5.2.3Inter-partitionandintra-partitionparallelism................86 5.2.4Hardwareimplementation..............................87 5.3OracleParallelserver.....................................89 5.3.1ParallelOraclearchitecture............................90 5.3.2VirtualSharedDisk(VSD).............................94 5.3.3 Distributed Lock Manager (DLM) . ......................95 5.4 Advantages and disadvantages of parallel databases . ...........96 Part 2. System design and sizing for optimal performance .....................99 Chapter 6. Sizing a database system .........................101 6.1Sizingconstraints.......................................101 6.2 Sizing techniques . .....................................103 6.2.1Sizingfromthedatasize.............................104 6.2.2Sizingfromtransactionrates..........................104 6.2.3Sizingfromusernumbers.............................105 6.3Sizingforaparticularapplication...........................106 6.4 CPU goals and sizing ....................................106 6.4.1Uniprocessor(UP)Systems...........................107 6.4.2SymmetricMultiprocessor(SMP)Systems................107 6.4.3 CPU utilization .....................................108 6.5 Memory goals and sizing . ................................108 6.5.1 AIX operating system ................................109 iv Database Performance on AIX in DB2 UDB and Oracle Environments 6.5.2AIXfilesystemcache(AIXbuffercache).................109 6.5.3RDBMScacheandstructures..........................109 6.5.4 User applications and database connections ..............110 6.6 Disk goals and sizing ....................................112 6.6.1 General database sizing - High-level ....................112 6.6.2Specifictablebytablesizing-Detailedlevel..............113 6.6.3 Which disk size to choose . ..........................115 6.6.4Diskprotection.....................................116 6.7 Balancing a system via the component costs . ...............119 Chapter 7. Designing a system for an RDBMS ..................121 7.1Workingspace.........................................121 7.1.1BasicandfutureAIXresources........................121 7.1.2Basicandfutureapplicationresources...................122 7.1.3BasicRDBMSresources.............................122 7.1.4FutureRDBMSresources.............................126 7.2Workloadconsiderations.................................128 7.3Networkconsiderations..................................128 7.4Memoryanddatabaseconsiderations.......................129 7.4.1 DB2 UDB memory requirements. .....................129 7.4.2 Oracle memory requirements ..........................130 7.5 System resource utilization................................131 7.6 Can the database be backed up and restored? . ...............133 7.6.1 DB2 UDB backup/restore scenario . .....................133 7.6.2 Oracle backup/restore scenario . .....................134 7.6.3 General backup considerations . .....................135 7.7Copingwithgrowth......................................137 7.7.1 DB2 UDB reorganization method . .....................138 7.7.2 Oracle reorganization method..........................138 7.7.3 When and how to avoid database reorganization . ..........139 7.7.4 Coping with large, unexpected growth ...................140 7.7.5Expectedgrowthareas...............................141 7.7.6 Loading large amounts of data .........................142 7.8 Performance versus availability . ..........................142 7.9 Production, development, and testing on the same machine . ....144 7.9.1 Production . .....................................144 7.9.2Development......................................145 7.9.3Testing...........................................146 7.9.4Hybridmachines....................................146 7.10 AIX and RDBMS upgrades ...............................146 Chapter 8. Designing a disk subsystem .......................149 8.1 Disk subsystem design approach . ..........................149 v 8.2 Bandwidth related performance considerations . ...............150 8.3 Physical database layout considerations .....................151 8.3.1 Database datafile distribution ..........................152 8.4 Logical Volume Manager (LVM) Concepts ....................153 8.4.1PhysicalPartitionstripingversusLVMfinestriping..........154 8.4.2UseofLVMpolicies.................................156 8.5RawlogicalvolumesversusJournaledFileSystems(JFS).......160 8.6RAIDLevelsoverviewandperformanceconsiderations..........161 8.6.1RAIDLevel0 ......................................162 8.6.2RAIDLevel1 ......................................163 8.6.3RAIDLevel2andLevel3.............................163