84916-6
The only way to truly optimize your database: Tune the Oracle DBMS and the UNIX kernel together.
If you're running an Oracle production database system on a UNIX platform, there's only one way to truly maximize your performance: tune both Oracle and UNIX—and understand how the two interrelate.
Oracle and UNIX Performance Tuning is the first book to address tuning of both current Oracle releases and the underlying Solaris, HP-UX, or Sequent Dynix systems they're running on. It's also the first Oracle database tuning book with detailed, specific coverage of optimizing both OLTP and decision support systems.
Oracle Senior Engineer Ahmed Alomari begins by presenting a systematic approach to tuning Oracle databases based on UNIX, and showing how benchmarking and optimization fit into the development lifecycle. Next, he reviews important UNIX kernel-related issues that impact performance, and introduces effective techniques for tuning memory, processors, and I/O. The book also contains detailed coverage of optimizing SQL code-a factor often neglected in database tuning books, but which can powerfully impact database performance.
Alomari makes in-depth recommendations for tuning both decision support and transaction applications - each of which impact the Oracle kernel in significantly different ways. No other tuning book covers specific DSS and OLTP issues in comparable detail.
Oracle and UNIX Performance Tuning includes a CD-ROM with shell scripts for Solaris, HP-UX, and Sequent platforms, a performance monitor, Oracle scripts, a parameter reference, and extensive Oracle white papers on tuning and performance issues.
Tuning Oracle without tuning UNIX is like tuning half the cylinders on your car. If you want all the performance you're paying for, you need to do both—and Ahmed Alomari's Oracle and UNIX Performance Tuning will show you how.
Introduction.
Tuning and Science. Tuning by Iteration. Tuning by Understanding. Tuning and Training. Getting the Most of Your Environment. Tuning on the Project. The Team. Resources. Version Control. The Repository. Staying Current.
1. Inside the UNIX Kernel.
UNIX Internals. UNIX Architecture. Kernel Layer. File Systems. Virtual Memory. Shared Memory. Process Model. The Job Scheduler. Threads Model. Signals and Interrupts. Network Services and Communication. I/O Services. Synchronization. System Daemon Layer. Shell Layer. Application Layer.
2. Memory and Processor Tuning.
UNIX Memory Model. Paging. Swapping. Process Memory Model. Monitoring Paging and Swapping. Tuning Paging. Physmem. Lotsfree. Desfree. Minfree. Maxpgio. Swapping. Configuring Swap. Memory Shortages. Memory Surplus. Kernel Memory Allocator. Shared Memory Parameters. Semaphore Parameters. Processor Architecture. Cache Concepts. Cache Coherency. Central Bus. Threads Model. Threads Safety. Threads Programming. Process Tuning. Processor Related Kernel Parameters. Think Parallel. Right-Sizing the Number of Processors. Affinity Binding on Multi-Processor Systems. Benchmarking Processors.
3. Configuring and Tuning.
UNIX I/O Model. Logical Volume Manager. Striping. Striping on Sequent. Striping on Sun. Striping on HP. Maximizing the Performance of the Strip. Partitioning the Disks. Setting the Stripe Width. Mirroring. RAID-5. Asynchronous I/O. Asynchronous I/O in Solaris. Asynchronous I/O in HP-UX. Asynchronous on Sequent. Asynchronous I/O in Oracle. Direct I/O (DIO). Kernelized Asynchronous I/O (KAIO). List I/O (LIO). Read(). Db_file_multiblock_read_count. File Systems Versus Raw Devices. UNIX File Systems. Raw Devices. Separate Sequential and Random I/O. Tablespace Optimization. Setting the Database Block Size. Monitoring I/O Activity. Tuning NFS. NFS and Database. Using the Automounter. Configuring and Sizing the Disk I/O Subsystems.
4. Application Tuning: Eliminating the SQL Bottleneck.
Application Architecture. Development Environment. Tuning Pro*C Applications. Using Arrays in Pro*C. Linking with the Shared Library. Pro*C Compile Options. Parallel Processing Using Pro*C. The Make File. Tuning SQL. Rule-Based Optimizer. Coat-Based Optimizer. Using Hints. The Explain Plan. The Hints. Tuning by Selectivity. Using Parallel Query. Using PL/SQL. PL/SQL Tables. Locking Contention. Using the System Packages. Profiling and Optimization.
5. Tuning an OLTP System.
Performance Monitoring. Tuning I/O. Local Volume Manager (LVM). Raw Devices. Asynchronous I/O. Oracle Writes. Veritas File System Mount Options. Veritas Database Edition for Oracle. Number of Data Files. Checkpoints. Disk Cache. Monitoring File I/O. Latches and Locks. LRU Latches. Tuning Redo. Configuring the Redo Log Files. Operating System Mirroring Versus Oracle Mirroring. Using PrestoServe for the Redo Log Files. Monitoring the Redo Buffer. Tuning Redo Log Buffer Latches. Tuning Spin_Count. Tuning Rollback Segments. Sizing Rollback Segments. Large Transactions. The Shared Pool. Library Cache. Data Dictionary Cache. Maximizing the Shared Pool Utilization. Fragmentation in the Shared Pool. Sizing the SGA. Tuning Shared Memory. Sizing the Buffer Cache. Tuning Archiving. The Post-Wait Driver. Tuning TCP/IP. Tuning SQL*Net V2. Recursive SQL and tkprof. Tuning Storage Clauses. The Free List. Monitoring Locking. Referential Integrity. Discrete Transactions. Hash Cluster. Database Design.
6.Tuning a Decision Support System (DSS).
The Data Warehouse. Requirements for a Data Warehouse. DSS Database Design. Tuning I/O. Sorting. Direct Write Sorts. The Temporary Tablespace. Temporary Tablespaces in Oracle 7.3. Bitmap Indexes. Tuning Queries. The Star Hint. Anti-Join. Histograms. Merge Joins. Hash Joins. Partitioned Views. Loading Data. Direct Path Loads. Conventional Path Loads. Fixed Field Loads. Loading Through NFS. Building Indexes. Building Tables. Parallel Storage. Degree of Parallelism. Parallel Query and the 9/13 Rule. Maximizing Parallel Query Performance. Configuring the Number of Parallel Query Slaves. Reducing Locks. Inter-Node Parallel Query. Single-Task Processes.
7. Media Recovery.
The System is Down. System Architecture. Hardware Requirements. Selecting the Backup and Recovery Tools. Configuring and Sizing the Media Devices. Export and the Buffer Option. The Direct Export Option. Import and the Buffer Option. Export, Import, and the 2 G File Limit. Enterprise Backup Utility (EBU). EBU and Hot Backups. Disk and Tape I/O Sizes. Tuning EBU Parameters. Parallel Recovery. Standby Database.
8. Conclusion.
Chapter Summaries. Chapter 1 "Inside the UNIX Kernel." Chapter 2 "Memory and Processor Tuning." Chapter 3 "Configuring and Tuning I/O." Chapter 4 "Application Tuning: Eliminating the SQL Bottleneck." Chapter 5 "Tuning an OLTP System." Chapter 6 "Tuning a Decision Support System (DSS)." Chapter 7 "Media Recovery." Oracle8. The Network Computing Architecture.
Appendix A: Installing and Configuring UNIX for Optimal Performance.
A Corporate Architecture. Determining the Type of System. Sizing the File Systems. Mirroring the Operating System. Installing the UNIX Operating System. Naming Service. Post-Installation Procedures.
Appendix B: Installing Oracle for Optimal Performance.
A Corporate Architecture. Determining the Type of System. Sizing the File Systems. Directories and File Locations. Installing the Oracle DBMS. Configuring SQL*Net. Post-Installation Procedures.
References.
Preface
The purpose of this book is to share my experiences in the areas of UNIX and Oracle performance and tuning. Although this book may be used as a reference guide for UNIX kernel or Oracle startup parameters, it is intended to be an overall reference for concepts. The chapters of this book provide a tremendous level of detail on the internal workings of the Oracle and UNIX kernel. The purpose of including so much detail is to give the reader a complete understanding of Oracle and UNIX. It is this understanding that will enable the reader to apply these concepts to specific applications and/or user environments, thus enabling the reader to maximize the performance of his or her environment.
It is a key characteristic of this book that only the latest versions of Oracle and UNIX are discussed. The book covers Oracle 7.2 and 7.3, Sun Solaris 2.4 and 2.5, Sequent Dynix 4.1 and 4.2, and HP-UX 10. This will enable the reader to focus on the functionality and enhancements of the new versions, avoiding discussion of old releases.
Another characteristic of this book is that I have organized it into two major areas: Decision Support and Transaction Workloads. I felt that rather than focus on areas in the Oracle kernel and discuss each parameter, I would focus instead on the workload and discuss the affected areas of the Oracle kernel per workload.
Recommended prerequisites for this book are a basic understanding of SQL, UNIX shell language, and experience with UNIX system and Oracle7 database administration.
I have been a user of Oracle and UNIX across many different platforms including Sun, Sequent, HP, VAX/VMS, MS-DOS, Windows, and IBM RT. In this book, I intend to cover in great detail the Sun Solaris, Sequent Dynix, and HP-UX operating systems.
I hope you enjoy this book and find it useful in mastering the areas of performance and tuning. To show my appreciation for UNIX, I had to start with a Chapter 0. Good luck, and away we go!
ACKNOWLEDGMENTS
This book is dedicated to my parents, Mukarram Alomari and Dr. Suha Alomari, and to Lana Gardi. My parents have always emphasized education and the pursuit of excellence. Lana Gardi is also a very special person in my life. Lana, soon to be my wife (hopefully by the time this book is published), has been wonderfully supportive of my career and the drafting of this book. Special thanks to my mother, Dr. Suha Alomari, who gives true meaning to the words commitment, dedication, and excellence. Her values and encouragement keep me constantly striving to excel.
Thanks to the rest of my family Mustafa, Mohammed, Munna, May, Abduallah, and Zena for their support and encouragement.
I would also like to sincerely thank Henry Dai of Oracle. It is a great pleasure to work woth such a talented technical inovator as well as a great manager and visionary.
I would also like to thank the Oracle engineers and support staff with whom I have had the pleasure of working on various issues. Thanks also to the Sun, HP, and Sequent engineers and support staff.
I would also like to thank the reviewers, Michael Machowicz, Omar Tahboub, and Salim Ahmed. Their diligent and careful review helped me improve the format and organization of the book.
Thanks also to Mark Taub of Prentice Hall and the Prentice Hall staff for the editing and publishing efforts of this book.
Best Regards, Ahmed Alomari EMAIL: aalomari@us.oracle.com
