OCP Instructors Guide for Oracle DBA Certification A Study Guide to Advanced Oracle Certified Professional Database Administration Techniques Christopher Foot Brought to you by DBAzine.com & BMC Software, Inc. ii iii This book is dedicated to my late father, Arthur, who like many others, came to this country with just a dream and a willingness to work hard. I wish you were here to see me now. This book is also dedicated to my wife Sandy. You have been faced with many challenges that others will hopefully never endure. You have met each one with determination and good humor. Always remember that you are the strongest person I know. Chris iv OCP Instructors Guide for Oracle DBA Certification A Study Guide to Advanced Oracle Certified Professional Database Administration Techniques By Christopher Foot Copyright © 2003 by BMC Software and DBAzine. Used with permission. Printed in the United States of America. Published in Kittrell, North Carolina, USA Oracle In-Focus Series: Book #14 Series Editor: Don Burleson Production Manager: Robert Strickland Production Editor: Teri Wade Cover Design: Bryan Hoff Printing History: August 2003 for First Edition Oracle, Oracle7, Oracle8, Oracle8i and Oracle9i are trademarks of Oracle Corporation. Oracle In-Focus is a registered Trademark of Rampant TechPress. Many of the designations used by computer vendors to distinguish their products are claimed as Trademarks. All names known to Rampant TechPress to be trademark names appear in this text as initial caps. The information provided by the authors of this work is believed to be accurate and reliable, but because of the possibility of human error by our authors and staff, BMC Software, DBAZine and Rampant TechPress cannot guarantee the accuracy or completeness of any information included in this work and is not responsible for any errors, omissions or inaccurate results obtained from the use of information or scripts in this work. Links to external sites are subject to change; DBAZine.com, BMC Software and Rampant TechPress do not control or endorse the content of these external web sites, and are not responsible for their content. ISBN: 0-9740716-1-7 DBAzine.com BMC.com/oracle v Table of Contents Using the Online Code Depot xiv Conventions Used in this Book xv Acknowledgements xvii Forward xviii Chapter 1 - Getting Started 1 Why Become an Oracle Database Administrator? 1 Oracle Database Administration Responsibilities 3 Oracle Classroom Education 8 Oracle9i Curriculum Changes 10 Oracle9i Oracle Certifications 11 Oracle Certified Database Associate (OCA) 12 Oracle Certified Database Professional (OCP) 13 Oracle Certified Master Database Administrator (OCM) 14 Oracle9i DBA OCP Upgrade Path 14 Other Recommend Classes 16 Preparing for the Oracle Certified Professional Exams 17 Taking the Certification Exams 18 Finding Information Quickly – The Key to Success 20 Reference Manuals 21 Oracle Internal Resources 21 External Resources 23 Book Recommendations 24 Conclusion 25 Chapter 2 - Oracle Database Architectures 27 Oracle Database Architectures 27 Oracle on Microsoft Windows Platforms 28 Oracle on LINUX Platforms 30 Oracle on Unix Platforms 32 Database Architecture Comparison Worksheet 34 Venturing into the Great Unknown – New Database Architectures 36 vi DBAzine.com BMC.com/oracle Conclusion 36 Chapter 3 - Review Meetings 38 Oracle Database Design Review Meetings 38 Initial Overview of Proposed System 40 Logical Data Model Review 42 Designing for Performance 43 Setting up a Successful Test System in Oracle 44 Monitoring Performance During Testing 45 Performance Design Reviews 47 Preparation for Production Turnover 48 Post Production Turnover 49 Oracle Database Design Review Meetings – Conclusion 50 Conclusion 51 Chapter 4 - Oracle Database Administration 52 Oracle Software Installation 52 Migrating to Newer Oracle Releases 53 UNIX and LINUX Semaphores and Shared Memory 56 Semaphores 56 Shared Memory 59 Relinking Oracle8i and Oracle9i Products 61 Windows Services 62 Oracle Instance Administration 63 Oracle9i Persistent Initialization Parameter Files 63 Remote Startup/Shutdown 67 Multiple Buffer Pools 68 Specifying Default, Keep and Recycle Bufferpools in Oracle8 and Oracle8i 69 Specifying Default, Keep and Recycle Bufferpools in Oracle9i70 Large Pool 71 Java Pool 72 Redo log Buffer Performance 72 Buffer Performance is critical to Good Oracle Performance 73 DBWR_IO_SLAVES vs DB_WRITER_PROCESSES 74 DBAzine.com BMC.com/oracle vii Conclusion 75 Chapter 5 - Oracle Database Objects 77 What Database Are You Working In? 77 Choosing a Database Block Size 78 Copying Databases Between Servers 80 Oracle Tablespaces 83 Temporary Tablespaces 83 Create Tablespace Temporary vs. Create Temporary Tablespace 85 Partitioning 86 Oracle 8 - Range Partitioning 89 Index Partitioning 90 Equi-Partitioned Objects 91 Local Indexes 91 Global Indexes 92 Oracle8i – Hash and Range/Hash Composite Partitioning 92 Hash Partitioning 92 Combining Range and Hash Partitioning – Range/Hash Composite Partitioning 93 Oracle9i – List and Range/List Composite Partitioning 93 List Partitioning 93 Range/List Composite Partitioning 94 Which Partitioning Technique Do I Choose? 95 Oracle9i Tablespace Changes 97 Locally Managed System Tablespaces 102 Rollback Segments 103 When is the System Rollback Segment Used? 104 Rollback Segments and Transaction Processing Workloads 104 Batch and On-line Processing 105 Rollback Segments and Users – Who’s Using What? 106 Oracle9i - Database Managed Undo Segments 107 Redo Logs 109 Checkpoint Not Complete 110 Resizing Redo Logs 112 viii DBAzine.com BMC.com/oracle Oracle Tables and Indexes 114 Space Utilization for Parallel Table Creates 114 Index-only Tables 114 Single Table Hash Clusters 116 Oracle9i External Tables 118 ALTER TABLE MOVE Statement 122 ALTER COLUMN RENAME 122 On-Line Table Reorganizations 122 PCTFREE and PCTUSED 126 Clustering Data in Tables 126 Merging Tables to Increase Query Performance 127 How Many Indexes Can I Build? 129 Parameters that Impact Index Usage 130 Index-Only Access 131 Index Rebuilds 133 Index Coalesce vs Index Rebuild 134 Function-Based Indexes 136 Bitmap Indexes 137 Optimizer and Bitmap Indexes 139 Concurrency and Bitmap Indexes 139 When to Use Bitmap Indexes 139 Bitmap vs B-Tree 140 Indexing Hints Tips and Tricks 141 Index Monitoring 143 Conclusion 144 Chapter 6 - Oracle Backup and Recovery 147 It’s the Little Things That Bite You 147 Keep Your Skills Sharp 147 RELAX and Plan Your Attack 148 Don’t Be Afraid to Ask Others 148 Instance Recovery and the Oracle Synchronization Process 149 Uncommitted Data on the Data Files 150 Committed Data Not On the Data Files 151 DBAzine.com BMC.com/oracle ix The Synchronization Process 151 Roll Forward Phase 151 Roll Backward Phase 152 Exports and Recovery 152 V$RECOVERFILE 152 Watch the NOLOGGING Option 153 Striped File Systems 153 Data Files and Redo Logs 153 Redo Log and Control File Multiplexing 154 OCOPY for Windows 154 Hot Backup Scripts for Windows 154 Hot Backup Scripts for UNIX 156 Oracle9i – Lazy Checkpointer 159 Recovery Manager 161 Recovery Catalog 162 Recovery Manager Backup Types 163 Backup Sets 163 Image Copies 164 Parallel Backup and Recovery 164 Multiplexed Backup Sets 164 Backup/Recovery Reports 165 Database Recovery 165 RMAN Examples 165 db_verify 167 Conclusion 168 Chapter 7 - Tuning and Performance 170 Be careful with the ANALYZE command 170 Finding Problem Queries 171 Optimizer Plan Stability 172 Pinning Objects in the Shared Pool 174 PCTFREE and PCTUSED 175 Caching Tables 175 Clustering Data in Tables 175 x DBAzine.com BMC.com/oracle Merging Tables to Increase Query Performance 176 Hints 176 Parallel Hints 177 Performance Testing 177 Parallel Query 178 Tuning Oracle on Windows 178 Tuning Pack 178 Direct Load Inserts 179 Parallel DML Processing 180 Materialized Views 182 Database Resource Management 183 STATSPACK 184 V$ TABLES vs. Oracle BSTAT/ESTAT and STATSPACK186 Segment-Level Performance Statistics Collection 186 Performance Tuning Intelligent Advisories 188 Optimizer Dynamic Sampling 189 Data Segment Compression 191 Using Explain Pan to Determine Access Paths 192 Explain Plan Output 195 SQL*PLUS AUTOTRACE 196 High Water Mark and Table Scans 197 Allocating too Much Memory to the Shared Pool and Data Buffers 198 Conclusion 199 Chapter 8 - Miscellaneous Oracle Information 202 The Foot Rule of Thumb 202 Monitor By Day So You Don’t Get Called at Night 203 Monitoring Space Utilization and Performance Statistics Historically 205 Latches and Enqueues 208 Deadlock Detection 208 Unindexed Foreign Keys and Locking Problems 209 Using PUPBLD 212 [...]... workshop Oracle9 i Oracle Certifications Oracle has also changed the certification process for Oracle9 i Database administrators wanting to become Oracle8 i Certified Professionals (OCP) were required to pass 5 certification tests, one for each database administration class that Oracle offered: Intro, DBA Part 1A: Architecture and Administration, DBA Part 1B: Backup and Recovery, DBA Part 2: Tuning and Performance... assigned tasks Oracle9 i DBA OCP Upgrade Path Database administrators wanting to continue to stay current as an Oracle Certified Professional are able to upgrade their certifications by completing the Oracle migration exams Oracle Education provides multiple upgrade certification tests to allow administrators to upgrade their current certification to Oracle 9i OCP 14 DBAzine.com BMC.com /oracle The number... involved! DBAzine.com BMC.com /oracle 9 Oracle9 i Curriculum Changes The Oracle9 i Instructor Led Training (ILT) Classes have been dramatically changed for Oracle9 i The Oracle9 i curriculum consists of the following ILT classes: Introduction to Oracle9 i: SQL (5 Days) - This class prepares students for Oracle Certification Test #170-007 You’ll notice that the title is a little different that the Oracle8 i... and Performance and DBA Part 3: Network Administration Oracle has changed the certification process for Oracle9 i by adding two new certifications (Associates and Masters) and requiring additional hands-on classroom training to obtain Oracle Certified Professional certification DBAzine.com BMC.com /oracle 11 Oracle Certified Database Associate (OCA) Two exams are required to become an Oracle Certified Database... following Oracle University hands-on courses: Oracle9 i Introduction to SQL Oracle9 i Database Fundamentals I Oracle9 i Database Fundamentals II Oracle9 i Database Performance Tuning Oracle9 i Database New Features Introduction to Oracle: SQL and PL/SQL The minimum scoring requirements and test durations for the Oracle Certified Database Professional tests are as follows: Oracle Database: Fundamentals II - Oracle. .. hours DBAzine.com BMC.com /oracle 13 Oracle Certified Master Database Administrator (OCM) Those wanting to reach "Oracle Nirvana" and become Oracle Certified Masters must first earn their Oracle Certified Professional (OCP) certification Candidates must also attend two of the eight advanced Oracle University hands-on courses listed below: Oracle Enterprise Manager 9i Oracle9 i SQL Tuning Workshop Oracle9 i... class with all of the information covered in the four-day "Enterprise DBA Part1B: Backup and Recovery" class The class also contains information on Oracle s Export and Import utilities for good measure Oracle9 i Database Performance Tuning (5 Days) - The Oracle9 i database tuning class prepares students for Certification Test #170-033 and follows the same general format of the Oracle8 i tuning class with... Oracle8 security enhancements Upgrade Exam: Oracle8 to Oracle8 i OCP DBA (#1Z0-020) - The Oracle8 i upgrade exam covers information provided by the Oracle8 i New Features for Administrators class This exam focuses on the Oracle Java implementation, optimizer and query performance improvements, materialized views, bitmap index and index-organized DBAzine.com BMC.com /oracle 15 enhancements and range, hash and... partitioning The exam also covers Oracle installer enhancements, locally managed tablespaces, transportable tablespaces and the Oracle8 i database resource manager Upgrade Exam: Oracle8 i to Oracle9 i OCP DBA (#1Z0030) - Like its aforementioned counterparts, the Oracle9 i upgrade covers information provided by the Oracle9 i New Features for Administrators Class The exam covers information on fine grained auditing,... BMC.com /oracle The number of tests the DBA must take depends upon their current certification OCP DBAs must complete each upgrade test in order to upgrade their OCP credentials An Oracle7 .3 DBA OCPs would be required to pass exam #1Z0-010, 1Z0020 and 1Z0-030 to upgrade their OCP credential to Oracle9 i Database Administrator Each upgrade exam closely follows the material provided in the Oracle database new features . OCP Instructors Guide for Oracle DBA Certification A Study Guide to Advanced Oracle Certified Professional Database Administration. you are the strongest person I know. Chris iv OCP Instructors Guide for Oracle DBA Certification A Study Guide to Advanced Oracle Certified Professional Database Administration Techniques. Hoff Printing History: August 2003 for First Edition Oracle, Oracle7 , Oracle8 , Oracle8 i and Oracle9 i are trademarks of Oracle Corporation. Oracle In-Focus is a registered Trademark