Managing Oracle on Linux
Total Page:16
File Type:pdf, Size:1020Kb
Managing Oracle on Linux Student Guide D16511GC20 Edition 2.0 Februrary 2004 Dxxxxx (Applied) ® Authors Copyright © 2004, Oracle. All rights reserved. Ric van Dyke This documentation contains proprietary information of Oracle Corporation. It is Russ Lowenthal provided under a license agreement containing restrictions on use and disclosure and is also protected by copyright law. Reverse engineering of the software is prohibited. If this documentation is delivered to a U.S. Government Agency of the Department of Technical Contributors Defense, then it is delivered with Restricted Rights and the following legend is and Reviewers applicable: Sourish Kundu Restricted Rights Legend James Spiller Use, duplication or disclosure by the Government is subject to restrictions for Mark Fuller commercial computer software and shall be deemed to be Restricted Rights software Mike Hazel under Federal law, as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013, Wim Coekarts Rights in Technical Data and Computer Software (October 1988). John Pokotylo This material or any portion of it may not be copied in any form or by any means Tom Raes without the express prior written permission of Oracle Corporation. Any other copying is a violation of copyright law and may result in civil and/or criminal penalties. Publisher If this documentation is delivered to a U.S. Government Agency not within the Joseph Fernandez Department of Defense, then it is delivered with “Restricted Rights,” as defined in FAR 52.227-14, Rights in Data-General, including Alternate III (June 1987). The information in this document is subject to change without notice. If you find any problems in the documentation, please report them in writing to Education Products, Oracle Corporation, 500 Oracle Parkway, Box SB-6, Redwood Shores, CA 94065. Oracle Corporation does not warrant that this document is error-free. All references to Oracle and Oracle products are trademarks or registered trademarks of Oracle Corporation. All other products or company names are used for identification purposes only, and may be trademarks of their respective owners. Contents 1 Oracle9i on Linux: Overview Objectives 1-2 Red Hat, SuSE, and UnitedLinux 1-3 Certification Matrix on MetaLink 1-5 Supported and Suggested Configurations 1-6 Oracle9i Versions 1-7 Supported Hardware 1-8 Linux Distribution: Overview 1-9 Packages 1-10 Linux Kernel 1-11 Verifying the Kernel 1-12 Checking for a Tainted Kernel 1-14 Required Software 1-16 Linux Patches 1-18 Oracle9i Architecture: Overview 1-19 Summary 1-20 Practice Overview: Verifying Installed Software 1-21 2 Preparing the Operating System Objectives 2-2 Linux Shared Memory: Overview 2-3 Shared Memory Parameters 2-4 Setting Kernel Parameters 2-5 Semaphores 2-6 Setting Semaphore Parameters 2-7 Setting the File Handles Parameter 2-8 Setting Other Parameters 2-9 Viewing Resource Usage 2-10 Package Management 2-11 Conflicting Packages 2-13 Required OS Patches for RHEL 3.0 2-14 Optional Packages 2-16 Configuring the Network 2-17 Configuring the X Window System 2-18 Testing the X Window System 2-19 Supported File Systems 2-21 Recommended File Systems 2-22 Disk Partitioning 2-23 Summary 2-25 Practice: Overview 2-26 iii 3 Installing Oracle9i Software Objectives 3-2 Creating Groups 3-3 Creating and Viewing a Group 3-4 Creating the Oracle Owner 3-5 Creating the apache User 3-7 Choosing a Shell 3-8 Setting Environment Variables 3-9 User File Creation Mask 3-10 Setting Oracle Environment Variables 3-11 Optimal Flexible Architecture 3-12 OFA Characteristics 3-13 Mount Points 3-14 ORACLE_HOME and ORACLE_BASE 3-15 Installing New Releases 3-16 Managing Multiple Versions 3-17 Setting Oracle Environment Variables 3-19 Setting Variables: Example 3-21 Creating Directories 3-22 Mounting the CD-ROM 3-23 Starting the Installer 3-25 Oracle Universal Installer 3-26 File Locations 3-27 Installation Types 3-28 Database Configuration 3-29 Installation Summary 3-30 Changing the CD-ROM 3-31 Setup Privileges 3-32 Database Accounts 3-33 Password Management 3-34 Configuration Tool Error 3-35 Oracle Software Patches 3-36 Oracle Patch Utility 3-37 Oracle Relink Utilitity 3-39 Troubleshooting 3-40 Summary 3-41 Practice: Overview 3-42 4 Creating a Custom Oracle9i Database Objectives 4-2 Database Configuration Assistant 4-3 Creating a Database by Using the Database Configuration Assistant 4-4 Database Features 4-5 Database Connection Options 4-6 iv Initialization Parameters 4-7 Completing the Database Creation 4-8 Oracle Net Services Configuration and Administration Tools 4-9 Oracle Net Manager 4-10 Oracle Net Configuration Assistant 4-11 Testing the Connection 4-12 Summary 4-13 Practice Overview: Creating a Database 4-14 5 Installing and Configuring Enterprise Manager Objectives 5-2 Starting the Enterprise Manager Configuration Assistant 5-3 Configuring an OMS 5-4 Creating a New Repository 5-5 Installing the Intelligent Agent (IA) 5-6 Intelligent Agent: Postinstallation Steps 5-7 Configuring Enterprise Manager Reporting 5-9 Oracle HTTP Server (OHS) 5-10 The REPORTS_USER Administrator 5-11 Configuring the Report Server 5-12 Oracle Enterprise Manager Reporting Home Page 5-14 Viewing a Predefined Report 5-15 Creating a New Report 5-16 Preferred Credentials for Jobs and Events 5-17 Creating a Job 5-18 Create Job: Tasks and Parameters 5-20 Viewing Job Progress 5-21 Creating an Event 5-22 Create Event: Tests 5-23 Create Event: Parameters 5-24 Create Event: Fixit Jobs 5-25 Viewing Event Status 5-26 Summary 5-27 Practice Overview: Install and Configure Enterprise Manager 5-28 6 Customizing the Oracle9i Database Objectives 6-2 Controlling Oracle9i 6-3 Linux Startup Sequence 6-4 Linux Runlevels 6-7 Database Startup and Shutdown 6-9 Automating Jobs 6-11 OS Scheduling Tools 6-12 v Enterprise Manager Job System 6-14 Administrative Scripts 6-15 Database Backups 6-17 Backing Up with RMAN 6-18 Initialization Parameter File 6-19 Summary 6-20 Practice Overview: Automating Tasks 6-21 7 Linux Measurement Tools Objectives 7-2 Basic Tuning Methodology 7-3 Standard Measurement Tools 7-4 Linux-Unique tools 7-6 Common Areas to Tune 7-8 Monitoring and Tuning CPU 7-9 Is the CPU a bottleneck? 7-10 CPU Measurements 7-12 Measuring CPU Activity with vmstat 7-14 Measuring CPU Activity with mpstat 7-15 Measuring CPU Activity with sar 7-16 Measuring CPU Activity with iostat 7-18 Interpreting CPU Measurements 7-19 Reducing CPU Bottlenecks 7-21 Monitoring and Tuning Memory 7-22 Linux Memory 7-23 Linux Virtual Memory 7-24 Swap 7-25 Measuring Memory Usage 7-27 Measuring Total Memory 7-29 Measuring Memory with vmstat 7-31 Measuring Memory with sar 7-32 Interpreting Memory Measurements 7-34 Linux Large Memory Pages 7-36 Reducing Memory Bottlenecks 7-38 Monitoring and Tuning I/O 7-39 Is I/O a Bottleneck? 7-40 I/O Measurements 7-41 Measuring I/O with iostat 7-42 Measuring I/O with sar 7-44 Measuring I/O with vmstat 7-45 Interpreting I/O Measurements 7-46 Reducing I/O Bottlenecks 7-47 Network Traffic 7-48 vi Interpreting Network Statistics 7-50 Summary 7-51 Practice Overview: Using Linux Measurement Tools 7-52 8 Oracle9i Measurement Tools Objectives 8-2 Installing and Configuring Statspack 8-3 Automatically Collecting Statistics 8-5 First Page of the Statspack Report 8-6 Statspack Output 8-7 Correlating Statspack Output with OS Measurements 8-9 Basic Tuning Steps 8-10 Tuning CPU 8-11 Tuning Memory 8-12 Tuning I/O 8-13 Starting Top SQL 8-14 Using Top SQL 8-15 OS Statistics with Enterprise Manager 8-16 Tuning the SGA and PGA on Linux 8-17 Using PGA_AGGREGATE_TARGET 8-19 Using Shared Servers 8-20 Summary 8-21 Practice Overview: Using Oracle9i Measurement Tools 8-22 9 Tuning Oracle9i and Linux Objectives 9-2 I/O Modes 9-3 Comparing File Systems 9-4 File System Characteristics 9-5 Raw Partitions 9-6 ext2 and ext3 9-7 Oracle Clustered File System 9-8 Disk Guidelines 9-9 Managing Tablespaces and Data Files 9-11 Basic Oracle9i Database Optimizations 9-12 Sizing Database Blocks 9-13 LOG_BUFFER and Redo Log File 9-15 Advanced Features of Oracle Server 9-16 Multiple DBWR Processes 9-17 DB Writer Slaves 9-18 Changing SGA Behavior 9-19 Basic Linux Optimizations 9-20 Enterprise Distribution Features 9-21 vii Implementing Asynchronous I/O 9-22 Choosing a Kernel 9-24 Implementing a Large SGA 9-25 Standard Linux Memory Map 9-26 Modified Linux Memory Map 9-27 Altering the Linux Memory Map 9-28 Modifying shmmax 9-29 Lowering mapped_base 9-30 Relocating the SGA 9-32 Relocating the Database Buffer Cache 9-33 Summary 9-35 Practice Overview: Tuning Oracle9i and Linux 9-36 Appendix A: Practices Appendix B: Practice Solutions Appendix C: Basic Linux and vi Commands Appendix D: FAQ and RAID Appendix E: Next Steps: Continuing Your Education Where Do You Go From Here? E-2 Continuing Education Resources E-3 Oracle University E-4 Oracle University Online Library E-5 Oracle Technology Network E-6 Oracle AppsNet E-7 Oracle MetaLink E-8 Thank You! E-9 viii Oracle9i on Linux: Overview Copyright © 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: • Select a supported Linux distribution and version • Select the proper Oracle database versions • Identify Enterprise Linux–level distributions 1-2 Copyright © 2004, Oracle. All rights reserved. Managing Oracle on Linux 1-2 Red Hat, SuSE, and UnitedLinux Some supported Linux versions are: • Red Hat Enterprise Linux AS/ES • SuSE SLESx • UnitedLinux • Monta Vista Carrier Grade Linux • Miracle Linux Standard Edition (Japan only) • Red Flag DC Server 4.0 (China and Hong Kong only) 1-3 Copyright © 2004, Oracle.