Oracle Database 11g. Performance Tuning. Recipes. A Problem-Solution
Approach. □ □ □. Sam R. Alapati. Darl Kuhn. Bill Padfield ...
Oracle Database 11g Performance Tuning Recipes A Problem-Solution Approach
■■■ Sam R. Alapati Darl Kuhn Bill Padfield
Oracle Database 11g Performance Tuning Recipes: A Problem-Solution Approach Copyright © 2011 by Sam R. Alapati, Darl Kuhn, and Bill Padfield All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN 978-1-4302-3662-7 ISBN 978-1-4302-3663-4 (eBook) Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. President and Publisher: Paul Manning Lead Editor: Jonathan Gennick Technical Reviewer: Surachart Opun Editorial Board: Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan Gennick, Jonathan Hassell, Michelle Lowman, James Markham, Matthew Moodie, Jeff Olson, Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Coordinating Editor: Anita Castro Copy Editor: Mary Ann Fugate Production Support: Patrick Cunningham Indexer: SPI Global Artist: SPI Global Cover Designer: Anna Ishchenko Distributed to the book trade worldwide by Springer Science+Business Media, LLC., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail
[email protected], or visit www.springeronline.com. For information on translations, please e-mail
[email protected], or visit www.apress.com. Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales–eBook Licensing web page at www.apress.com/bulk-sales. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work.
To Valerie, Nina, and Nicholas With love and affection —Sam Alapati To Heidi, Brandi, and Lisa —Darl Kuhn To Oyuna and Evan for putting up with me and all the evenings and weekends spent with my computer instead of with them!! To Carol, Gerry, Susan, Doug, Scott, Chris, Jaimie, Katie, Jenny, Jeremy, and Sean. I love my family! —Bill Padfield
Contents at a Glance About the Authors .................................................................................................... xvi About the Technical Reviewer ................................................................................ xvii Acknowledgments ................................................................................................. xviii ■Chapter 1: Optimizing Table Performance ............................................................... 1 ■Chapter 2: Choosing and Optimizing Indexes ........................................................ 43 ■Chapter 3: Optimizing Instance Memory ............................................................... 83 ■Chapter 4: Monitoring System Performance ....................................................... 113 ■Chapter 5: Minimizing System Contention .......................................................... 147 ■Chapter 6: Analyzing Operating System Performance ........................................ 185 ■Chapter 7: Troubleshooting the Database ........................................................... 209 ■Chapter 8: Creating Efficient SQL ........................................................................ 253 ■Chapter 9: Manually Tuning SQL.......................................................................... 299 ■Chapter 10: Tracing SQL Execution ..................................................................... 327 ■Chapter 11: Automated SQL Tuning ..................................................................... 367 ■Chapter 12: Execution Plan Optimization and Consistency ................................. 409 ■Chapter 13: Configuring the Optimizer ................................................................ 447 ■Chapter 14: Implementing Query Hints ............................................................... 491 ■Chapter 15: Executing SQL in Parallel ................................................................. 525 Index ....................................................................................................................... 555
iv
Contents About the Authors .................................................................................................... xvi About the Technical Reviewer ................................................................................ xvii Acknowledgments ................................................................................................. xviii ■Chapter 1: Optimizing Table Performance ............................................................... 1 1-1. Building a Database That Maximizes Performance .................................................... 2 1-2. Creating Tablespaces to Maximize Performance ....................................................... 5 1-3. Matching Table Types to Business Requirements ..................................................... 8 1-4. Choosing Table Features for Performance ................................................................. 9 1-5. Avoiding Extent Allocation Delays When Creating Tables ........................................ 12 1-6. Maximizing Data Loading Speeds ............................................................................ 14 1-7. Efficiently Removing Table Data .............................................................................. 17 1-8. Displaying Automated Segment Advisor Advice ...................................................... 19 1-9. Manually Generating Segment Advisor Advice ........................................................ 23 1-10. Automatically E-mailing Segment Advisor Output ................................................. 27 1-11. Rebuilding Rows Spanning Multiple Blocks ........................................................... 28 1-12. Freeing Unused Table Space.................................................................................. 32 1-13. Compressing Data for Direct Path Loading ............................................................ 33 1-14. Compressing Data for All DML ............................................................................... 36 1-15. Compressing Data at the Column Level ................................................................. 38 1-16. Monitoring Table Usage ......................................................................................... 40
v
■ CONTENTS
■Chapter 2: Choosing and Optimizing Indexes ........................................................ 43 2-1. Understanding B-tree Indexes.................................................................................. 45 2-2. Deciding Which Columns to Index ............................................................................ 51 2-3. Creating a Primary Key Index ................................................................................... 54 2-4. Creating a Unique Index ........................................................................................... 56 2-5. Indexing Foreign Key Columns ................................................................................. 59 2-6. Deciding When to Use a Concatenated Index ........................................................... 60 2-7. Reducing Index Size Through Compression ............................................................. 63 2-8. Implementing a Function-Based Index..................................................................... 64 2-9. Indexing a Virtual Column ........................................................................................ 67 2-10. Avoiding Concentrated I/O for Index....................................................................... 68 2-11. Adding an Index Without Impacting Existing Applications ..................................... 70 2-12. Creating a Bitmap Index in Support of a Star Schema ........................................... 72 2-13. Creating a Bitmap Join Index ................................................................................. 73 2-14. Creating an Index-Organized Table ........................................................................ 74 2-15. Monitoring Index Usage.......................................................................................... 75 2-16. Maximizing Index Creation Speed .......................................................................... 77 2-17. Reclaiming Unused Index Space ............................................................................ 78 ■Chapter 3: Optimizing Instance Memory ............................................................... 83 3-1. Automating Memory Management ........................................................................... 83 3-2. Managing Multiple Buffer Pools ............................................................................... 87 3-3. Setting Minimum Values for Memory ....................................................................... 89 3-4. Monitoring Memory Resizing Operations ................................................................. 90 3-5. Optimizing Memory Usage ....................................................................................... 91 3-6. Tuning PGA Memory Allocation ................................................................................ 93 3-7. Configuring the Server Query Cache ........................................................................ 95
vi
■ CONTENTS
3-8. Managing the Server Result Cache .......................................................................... 97 3-9. Caching SQL Query Results ...................................................................................... 99 3-10. Caching Client Result Sets ................................................................................... 103 3-11. Caching PL/SQL Function Results ........................................................................ 105 3-12. Configuring the Oracle Database Smart Flash Cache .......................................... 109 3-13. Tuning the Redo Log Buffer.................................................................................. 110 ■Chapter 4: Monitoring System Performance ....................................................... 113 4-1. Implementing Automatic Workload Repository (AWR) ........................................... 113 4-2. Modifying the Statistics Interval and Retention Periods ........................................ 116 4-3. Generating an AWR Report Manually ..................................................................... 117 4-4. Generating an AWR Report via Enterprise Manager ............................................... 120 4-5. Generating an AWR Report for a Single SQL Statement ......................................... 121 4-6. Creating a Statistical Baseline for Your Database .................................................. 123 4-7. Managing AWR Baselines via Enterprise Manager ................................................ 126 4-8. Managing AWR Statistics Repository ..................................................................... 129 4-9. Creating AWR Baselines Automatically .................................................................. 131 4-10. Quickly Analyzing AWR Output ............................................................................. 133 4-11. Manually Getting Active Session Information....................................................... 134 4-12. Getting ASH Information from Enterprise Manager .............................................. 140 4-13. Getting ASH Information from the Data Dictionary ............................................... 142 ■Chapter 5: Minimizing System Contention .......................................................... 147 5-1. Understanding Response Time .............................................................................. 147 5-2. Identifying SQL Statements with the Most Waits ................................................... 150 5-3. Analyzing Wait Events ............................................................................................ 151 5-4. Understanding Wait Class Events........................................................................... 152 5-5. Examining Session Waits ....................................................................................... 153
vii
■ CONTENTS
5-6. Examining Wait Events by Class ............................................................................ 154 5-7. Resolving Buffer Busy Waits .................................................................................. 157 5-8. Resolving Log File Sync Waits................................................................................ 158 5-9. Minimizing read by other session Wait Events....................................................... 160 5-10. Reducing Direct Path Read Wait Events ............................................................... 161 5-11. Minimizing Recovery Writer Waits ....................................................................... 162 5-12. Finding Out Who’s Holding a Blocking Lock ......................................................... 163 5-13. Identifying Blocked and Blocking Sessions.......................................................... 165 5-14. Dealing with a Blocking Lock ............................................................................... 167 5-15. Identifying a Locked Object .................................................................................. 168 5-16. Resolving enq: TM Lock Contention ..................................................................... 169 5-17. Identifying Recently Locked Sessions .................................................................. 171 5-18. Analyzing Recent Wait Events in a Database ....................................................... 174 5-19. Identifying Time Spent Waiting Due to Locking ................................................... 175 5-20. Minimizing Latch Contention ................................................................................ 178 5-21. Managing Locks from Oracle Enterprise Manager ............................................... 181 5-22. Analyzing Waits from Oracle Enterprise Manager ................................................ 182 ■Chapter 6: Analyzing Operating System Performance ........................................ 185 6-1. Detecting Disk Space Issues .................................................................................. 187 6-2. Identifying System Bottlenecks (vmstat) ................................................................ 190 6-3. Identifying System Bottlenecks (Solaris)................................................................ 192 6-4. Identifying Top Server-Consuming Resources (top) ............................................... 194 6-5. Identifying CPU and Memory Bottlenecks (ps) ....................................................... 197 6-6. Identifying I/O Bottlenecks ..................................................................................... 198 6-7. Identifying Network-Intensive Processes ............................................................... 201 6-8. Troubleshooting Database Network Connectivity .................................................. 202
viii
■ CONTENTS
6-9. Mapping a Resource-Intensive Process to a Database Process ............................ 204 6-10. Terminating a Resource-Intensive Process.......................................................... 207 ■Chapter 7: Troubleshooting the Database ........................................................... 209 7-1. Determining the Optimal Undo Retention Period.................................................... 209 7-2. Finding What’s Consuming the Most Undo ............................................................ 213 7-3. Resolving an ORA-01555 Error ............................................................................... 215 7-4. Monitoring Temporary Tablespace Usage .............................................................. 217 7-5. Identifying Who Is Using the Temporary Tablespace ............................................. 218 7-6. Resolving the “Unable to Extend Temp Segment” Error ........................................ 220 7-7. Resolving Open Cursor Errors ................................................................................ 222 7-8. Resolving a Hung Database ................................................................................... 224 7-9. Invoking the Automatic Diagnostic Repository Command Interpreter ................... 229 7-10. Viewing an Alert Log from ADRCI ......................................................................... 233 7-11. Viewing Incidents with ADRCI .............................................................................. 235 7-12. Packaging Incidents for Oracle Support ............................................................... 236 7-13. Running a Database Health Check ....................................................................... 238 7-14. Creating a SQL Test Case ..................................................................................... 240 7-15. Generating an AWR Report ................................................................................... 243 7-16. Comparing Database Performance Between Two Periods................................... 246 7-17. Analyzing an AWR Report ..................................................................................... 248 ■Chapter 8: Creating Efficient SQL ........................................................................ 253 8-1. Retrieving All Rows from a Table ........................................................................... 254 8-2. Retrieve a Subset of Rows from a Table ................................................................ 256 8-3. Joining Tables with Corresponding Rows .............................................................. 258 8-4. Joining Tables When Corresponding Rows May Be Missing .................................. 259 8-5. Constructing Simple Subqueries ............................................................................ 263
ix
■ CONTENTS
8-6. Constructing Correlated Subqueries ...................................................................... 267 8-7. Comparing Two Tables to Finding Missing Rows................................................... 269 8-8. Comparing Two Tables to Finding Matching Rows ................................................ 271 8-9. Combining Results from Similar SELECT Statements ............................................ 271 8-10. Searching for a Range of Values .......................................................................... 274 8-11. Handling Null Values ............................................................................................ 277 8-12. Searching for Partial Column Values .................................................................... 280 8-13. Re-using SQL Statements Within the Shared Pool ............................................... 284 8-14. Avoiding Accidental Full Table Scans................................................................... 288 8-15. Creating Efficient Temporary Views ..................................................................... 290 8-16. Avoiding the NOT Clause ...................................................................................... 293 8-17. Controlling Transaction Sizes ............................................................................... 295 ■Chapter 9: Manually Tuning SQL.......................................................................... 299 9-1. Displaying an Execution Plan for a Query............................................................... 300 9-2. Customizing Execution Plan Output ....................................................................... 302 9-3. Graphically Displaying an Execution Plan .............................................................. 306 9-4. Reading an Execution Plan ..................................................................................... 307 9-5. Monitoring Long-Running SQL Statements ............................................................ 310 9-6. Identifying Resource-Consuming SQL Statements That Are Currently Executing ......................................................................................... 311 9-7. Seeing Execution Statistics for Currently Running SQL ......................................... 312 9-8. Monitoring Progress of a SQL Execution Plan ........................................................ 316 9-9. Identifying Resource-Consuming SQL Statements That Have Executed in the Past ..................................................................................... 319 9-10. Comparing SQL Performance After a System Change ......................................... 321
x
■ CONTENTS
■Chapter 10: Tracing SQL Execution ..................................................................... 327 10-1. Preparing Your Environment ................................................................................ 327 10-2. Tracing a Specific SQL Statement ........................................................................ 330 10.3. Enabling Tracing in Your Own Session ................................................................. 332 10-4. Finding the Trace Files ......................................................................................... 332 10-5. Examining a Raw SQL Trace File.......................................................................... 334 10-6. Analyzing Oracle Trace Files ................................................................................ 335 10-7. Formatting Trace Files with TKPROF .................................................................... 336 10-8. Analyzing TKPROF Output .................................................................................... 337 10-9. Analyzing Trace Files with Oracle Trace Analyzer ............................................... 340 10-10. Tracing a Parallel Query ..................................................................................... 343 10-11. Tracing Specific Parallel Query Processes ......................................................... 345 10-12. Tracing Parallel Queries in a RAC System .......................................................... 346 10-13. Consolidating Multiple Trace Files ..................................................................... 347 10-14. Finding the Correct Session for Tracing ............................................................. 348 10-15. Tracing a SQL Session........................................................................................ 349 10-16. Tracing a Session by Process ID ........................................................................ 351 10-17. Tracing Multiple Sessions .................................................................................. 352 10-18. Tracing an Instance or a Database..................................................................... 353 10-19. Generating an Event 10046 Trace for a Session ................................................ 354 10-20. Generating an Event 10046 Trace for an Instance ............................................. 356 10-21. Setting a Trace in a Running Session ................................................................ 356 10-22. Enabling Tracing in a Session After a Login ....................................................... 357 10-23. Tracing the Optimizer’s Execution Path ............................................................. 358 10-24. Generating Automatic Oracle Error Traces ......................................................... 361 10-25. Tracing a Background Process .......................................................................... 362
xi
■ CONTENTS
10-26. Enabling Oracle Listener Tracing ....................................................................... 363 10-27. Setting Archive Tracing for Data Guard .............................................................. 365 ■Chapter 11: Automated SQL Tuning ..................................................................... 367 11-1. Displaying Automatic SQL Tuning Job Details ..................................................... 370 11-2. Displaying Automatic SQL Tuning Advice............................................................. 372 11-3. Generating a SQL Script to Implement Automatic Tuning Advice ........................ 376 11-4. Modifying Automatic SQL Tuning Features .......................................................... 377 11-5. Disabling and Enabling Automatic SQL Tuning .................................................... 380 11-6. Modifying Maintenance Window Attributes ......................................................... 381 11-7. Creating a SQL Tuning Set Object ........................................................................ 383 11-8. Viewing Resource-Intensive SQL in the AWR ....................................................... 384 11-9. Viewing Resource-Intensive SQL in Memory ....................................................... 386 11-10. Populating SQL Tuning Set from High-Resource SQL in AWR ............................ 388 11-11. Populating a SQL Tuning Set from Resource-Consuming SQL in Memory ......... 390 11-12. Populating SQL Tuning Set with All SQL in Memory........................................... 391 11-13. Displaying the Contents of a SQL Tuning Set ..................................................... 393 11-14. Selectively Deleting Statements from a SQL Tuning Set.................................... 394 11-15. Transporting a SQL Tuning Set........................................................................... 396 11-16. Creating a Tuning Task ...................................................................................... 398 11-17. Manually Running SQL Tuning Advisor .............................................................. 401 11-18. Getting SQL Tuning Advice from the Automatic Database Diagnostic Monitor .. 404 ■Chapter 12: Execution Plan Optimization and Consistency ................................. 409 12-1. Creating and Accepting a SQL Profile .................................................................. 413 12-2. Automatically Accepting SQL Profiles .................................................................. 417 12-3. Displaying SQL Profile Information ....................................................................... 419 12-4. Disabling a SQL Profile ......................................................................................... 421
xii
■ CONTENTS
12-5. Dropping a SQL Profile ......................................................................................... 423 12-6. Moving a SQL Profile ............................................................................................ 424 12-7. Automatically Adding Plan Baselines ................................................................... 426 12-8. Creating a Plan Baseline for One SQL Statement ................................................. 428 12-9. Creating Plan Baselines for SQL Contained in SQL Tuning Set ............................ 431 12-10. Altering a Plan Baseline ..................................................................................... 433 12-11. Determining If Plan Baselines Exist.................................................................... 436 12-12. Displaying Plan Baseline Execution Plans .......................................................... 437 12-13. Adding a New Plan to Plan Baseline (Evolving) .................................................. 439 12-14. Disabling Plan Baselines .................................................................................... 442 12-15. Removing Plan Baseline Information ................................................................. 443 12-16. Transporting Plan Baselines............................................................................... 444 ■Chapter 13: Configuring the Optimizer ................................................................ 447 13-1. Choosing an Optimizer Goal ................................................................................. 447 13-2. Enabling Automatic Statistics Gathering .............................................................. 448 13-3. Setting Preferences for Statistics Collection ........................................................ 451 13-4. Manually Generating Statistics ............................................................................ 456 13-5. Locking Statistics ................................................................................................. 458 13-6. Handling Missing Statistics .................................................................................. 459 13-7. Exporting Statistics .............................................................................................. 460 13-8. Restoring Previous Versions of Statistics............................................................. 462 13-9. Gathering System Statistics ................................................................................. 463 13-10. Validating New Statistics ................................................................................... 466 13-11. Forcing the Optimizer to Use an Index ............................................................... 468 13-12. Enabling Query Optimizer Features .................................................................... 470 13-13. Keeping the Database from Creating Histograms .............................................. 472
xiii
■ CONTENTS
13-14. Improving Performance When Not Using Bind Variables ................................... 473 13-15. Understanding Adaptive Cursor Sharing ............................................................ 476 13-16. Creating Statistics on Expressions ..................................................................... 482 13-17. Creating Statistics for Related Columns............................................................. 483 13-18. Automatically Creating Column Groups .............................................................. 484 13-19. Maintaining Statistics on Partitioned Tables ...................................................... 486 13-20. Concurrent Statistics Collection for Large Tables .............................................. 488 ■Chapter 14: Implementing Query Hints ............................................................... 491 14-1. Writing a Hint ....................................................................................................... 491 14-2. Changing the Access Path.................................................................................... 493 14-3. Changing the Join Order ...................................................................................... 497 14-4. Changing the Join Method ................................................................................... 498 14-5. Changing the Optimizer Version ........................................................................... 501 14-6. Choosing Between a Fast Response and Overall Optimization ............................ 502 14-7. Performing a Direct-Path Insert ........................................................................... 505 14-8. Placing Hints in Views .......................................................................................... 506 14-9. Caching Query Results ......................................................................................... 509 14-10. Directing a Distributed Query to a Specific Database ........................................ 513 14-11. Gathering Extended Query Execution Statistics ................................................. 517 14-12. Enabling Query Rewrite ...................................................................................... 519 14-13. Improving Star Schema Query Performance ...................................................... 521 ■Chapter 15: Executing SQL in Parallel ................................................................. 525 15-1. Enabling Parallelism for a Specific Query ............................................................ 526 15-2. Enabling Parallelism at Object Creation ............................................................... 530 15-3. Enabling Parallelism for an Existing Object.......................................................... 532 15-4. Implementing Parallel DML .................................................................................. 533
xiv
■ CONTENTS
15-5. Creating Tables in Parallel ................................................................................... 536 15-6. Creating Indexes in Parallel.................................................................................. 538 15-7. Rebuilding Indexes in Parallel .............................................................................. 539 15-8. Moving Partitions in Parallel ................................................................................ 541 15-9. Splitting Partitions in Parallel ............................................................................... 542 15-10. Enabling Automatic Degree of Parallelism ......................................................... 543 15-11. Examining Parallel Explain Plans ....................................................................... 545 15-12. Monitoring Parallel Operations ........................................................................... 548 15-13. Finding Bottlenecks in Parallel Processes ......................................................... 550 15-14. Getting Detailed Information on Parallel Sessions ............................................. 552 Index ....................................................................................................................... 555
xv
About the Authors ■Sam R. Alapati is an Oracle ACE and an experienced Oracle database administrator (OCP Oracle Database 11g). Sam is currently the senior technical director for Miro Consulting, Inc., in Woodbridge, New Jersey, and regularly consults with Fortune 500 companies in the areas of Oracle Database, Oracle EBusiness, and Oracle Fusion Middleware technology. Sam has written several books on Oracle database management, including Expert Oracle Database 11g Administration, Oracle Database 11g: New Features for DBAs and Developers (with Charles Kim), and RMAN Recipes for Oracle Database 11g (with Darl Kuhn and Arup Nanda), all published by Apress. Sam lives in Dallas, Texas with his wife, Valerie, and children Shannon, Nina and Nicholas.
■Darl Kuhn is a senior database administrator working for Oracle. He handles all facets of database administration from design and development to production support. He also teaches advanced database courses at Regis University in Colorado. Darl does volunteer DBA work for the Rocky Mountain Oracle Users Group. He has a graduate degree from Colorado State University and lives near Spanish Peaks, Colorado with his wife, Heidi, and daughters, Brandi and Lisa.
■Bill Padfield is an Oracle Certified Professional, working for a large telecommunications company in Denver, Colorado as a lead database administrator. Bill helps administer and manage a large data warehouse environment consisting of more than 75 databases. Bill has been an Oracle Database administrator for more than 14 years, and has been in the IT industry since 1985. Bill also teaches graduate database courses at Regis University and currently resides in Aurora, Colorado with his wife, Oyuna, and son, Evan.
xvi
About the Technical Reviewer ■Surachart Opun was born in Phetchabun, Thailand. He graduated with a bachelor’s degree in computer engineering. He has worked in the Internet service provider business over eight years. He has a lot of experience with Oracle Database and Linux. He has worked with Oracle Database and Oracle Real Applications Cluster over six years. He is an Oracle Certified Professional 10g and 11g. He is also an Oracle Certified Expert RAC. He is interested in Oracle Database technology and spends a lot of time on it. His blog is http://surachartopun.com. He has spent a lot of time sharing his Oracle knowledge and helping people with Oracle technology. In 2010, he became an Oracle ACE and developed the Oracle User Group in Thailand, to which he is a contributor.
xvii
Acknowledgments The authors owe thanks to the great publishing team at Apress for helping them throughout the writing process. Jonathan Gennick, senior acquisitions editor, helped significantly in outlining the topics (recipes) for this book, and helped us produce the best book we possibly could, by nudging us along with incisive comments/suggestions/criticisms, all of which have tremendously increased both the presentation style of the book as well as the quality of the contents. Jonathan is that rare editor who is not only technically proficient, but also a consummate editor of books, in the traditional sense of the term. Thank you, Jonathan, for your patience and hard work throughout this project! All three of us are beneficiaries of your sagacious advice and continual encouragement over the past few months. The authors would like to thank the tremendous work done by the technical editor of the book, Surachart Opun, senior analyst at True Internet, who somehow found time from his prolific blogging and other work to perform a marvelous review of our draft chapters. Surachart not only caught several mistakes in code and elsewhere, but also made numerous suggestions to improve the presentation of the various recipes. Thank you, Surachart, for all your painstaking and cheerful work in helping us out with the book. Anita Castro, coordinating editor, has superbly guided us throughout this project, and helped keep things on schedule. Managing a three-author project isn’t a piece of cake by any means, but Anita sure makes it seem that way! Mary Ann Fugate copyedited the chapters with great skill, and we appreciate her contributions toward improving the quality of this book.
Personal Acknowledgments First of all, my heartfelt thanks to the great help and cooperation from my two co-writers—Darl Kuhn and Bill Padfield—it sure was great working with you, Darl and Bill—I've enjoyed every minute of it! I’d like to acknowledge the support and encouragement of my company, Miro Consulting Inc., Woodbridge, New Jersey, whose CEO, Scott Rosenberg, is not only a great leader but also an enthusiastic promoter of Oracle technology with our many clients across the United States. Miro’s president, Eliot Colon, its vice president of technical services, Wayne Federico, and its vice president, Bob Kinkade, have always been supportive of my work at Miro, and I’ve learned a lot from working with each of them. I’d like to express the generosity and help offered by my friends Kishore Rachamalla, Praveen Katapally, and Sreeny Chinta during my tenure at ERCOT in Taylor, Texas, where I started initial work on this and another book. I’m grateful for the kindness and show of support by Sam Nataros, whose gift from the heart I’ll always cherish—thank you, Sam, your gesture inspires me every single day! My family, of course, has sacrificed the most in making this book possible, and thus I’m grateful to Valerie, Shannon, Nicholas, and Nina for their help and support over the past few years while I was working on this and another book. Last but not least, I’d like to acknowledge my debt to my other family—my mother, Swarna Kumari, my father, Appa Rao, and my brothers, Hari Hara Prasad and Siva Sankara Prasad, Aruna, Vanaja, Ashwin, Teja, Aparna, and Soumya, for their abiding love and faith in me. Sam Alapati
xviii
■ ACKNOWLEDGMENTS
Thanks to fellow co-authors Sam Alapati and Bill Padfield, and also thanks to the numerous DBAs and developers from whom I’ve learned performance tuning techniques over the years: Dave Jennings, Bob Suehrstedt, Scott Schulze, Pete Mullineaux, Janet Bacon, Sue Wagner, Mohan Koneru, Arup Nanda, Charles Kim, Bernard Lopuz, Barb Sannwald, Tim Gorman, Shawn Heisdorffer, Doug Davis, Sujit Pattanaik, Ken Roberts, Roger Murphy, Mehran Sowdaey, Kevin Bayer, Dan Fink, Guido Handley, Margaret Carson, Nehru Kaja, Tim Colbert, Glenn Balanoff, Bob Mason, Shari Plantz-Masters, Mike Nims, Denise Duncan, Brad Blake, Ravi Narayanaswamy, Abid Malik, Abdul Ebadi, Kevin Hoyt, Trent Sherman, Sandra Montijo, Jim Secor, Maureen Frazzini, Sean Best, Stephan Haisley, Geoff Strebel, Patrick Gates, Krish Hariharan, Buzzy Cheadle, Mark Blair, Gary Dodge, Karen Kappler, Mike Hutchinson, Liz Brill, Ennio Murroni, Mike O’Neill, Beth Loker, Mike Eason, Greg Roberts, Debbie Earman, Tom Wheltle, Ken Toney, Gabor Gyurovszky, Scott Norris, Joey Canlas, Eric Wendelin, Gary Smith, Mark Lutze, Kevin Quinlivan, Dave Bourque, Roy Backstrom, Larry Carpenter, Joe Meeks, Ashish Ray, John Lilly, Dave Wood, Laurie Bourgeois, Steve Buckmelter, Casey Costley, John DiVirgilio, John Goggin, Brett Guy, Simon Ip, Pascal Ledru, Kevin O’Grady, Peter Schow, Todd Sherman, Jeff Shoup, Mike Tanaka, Todd Wichers, Doug Cushing, Will Thornburg, Steve Roughton, Ambereen Pasha, Dinesh Neelay, Kye Bae, Thom Chumley, Jeff Sherard, Dona Smith, Erik Jasiak, Gary Schut, Don Gritzmacher, Aaron Isom, Kristi Jackson, Karolyn Vowles, Amin Jiwani, Paula Still, K. P. Muthe, Joe Pinkerton, Arvin Kuhn, Darin Christensen, Terry Roam, Doug Drake, Marilyn Wenzel, Doc Heppler, Mert Lovell, Carl Beasly, Brian Beasly, Odean Bowler, and Jim Stark. Darl Kuhn I’d like to thank my gracious co-authors, Sam Alapati and Darl Kuhn, for all of their help and support, and for taking on a rookie for this project. I couldn’t have made it without their help. There are so many people I can thank that have helped me over the years in my career, so please know that I appreciate every single individual who has encouraged and helped me along. First of all, I’d like to thank Bob Ranney for giving me the opportunity to be a DBA. I also would like to thank some of my key managers over the years that have helped me, including Beth Bowen, Larry Wyzgala, John Zlamal, Linda Scheldrup, Amy Neff, and Maureen Frazzini. Of course, there are many DBAs, developers, system administrators, and architects that have helped me greatly in my career. First, I need to thank the DBAs on my current team who make the everyday grind a blast. These folks have helped me so much professionally and have become great friends over the many years we have worked together. This includes Dave Carter, Debbie Fitzgerald, Pankaj Guleria, Pete Sardaczuk, Brad Strom, and Rebecca Western. Over the years, I’ve learned an awful lot from the following folks, who have always been generous with their time and help, and patient with my questions. This includes Mark Nold, Mick McMahon, Sandra Montijo, Jerry Sanderson, Glen Sanderson, Jose Fernandez, Mike Hammontre, Pat Cain, Dave Steep, Gary Whiting, Ron Fullmer, Becky Enter, John Weber, Avanish Gupta, Scott Bunker, Paul Mayes, Bill Read, Rod Ermish, Rick Barry, Sun Yang, Sue Wagner, Glenn Balanoff, Linda Lee Burau, Deborah Lieou-McCall, Bob Zumpf, Kristi Sargent, Sandy Hass, George Huner, Pad Kail, Curtis Gay, Ross Bartholomay, Carol Rosenow, Scott Richards, Sheryl Gross, Lachelle Shambe, John Piel, Rob Grote, Rex Ellis, Zane Warton, Steve Pearson, Jim Barclay, Jason Hermstad, Shari Plantz-Masters, Denise Duncan, Bob Mason, Brad Blake, Mike Nims, Cathie Wilson, Rob Coates, Shirley Amend, Rob Bushlack, Cindy Patterson, Debbie Chartier, Blair Christensen, Meera Ganesan, and Kedar Panda. Bill Padfield
xix