Oracle8 i Concepts Release 8.1.5 February 1999 Part No. A67781-01 Oracle8i Concepts, Release 8.1.5 Part No. A67781-01 Copyright © 1999, Oracle Corporation. All rights reserved. Primary Authors: Lefty Leverenz, Diana Rehfield Contributing Authors: Steve Bobrowski, Cynthia Chin-Lee, Cindy Closkey, Bill Creekbaum, Jason Durbin, John Frazzini, Richard Mateosian, Denis Raphaely, Danny Sokolsky Contributors: Richard Allen, David Anderson, Andre Bakker, Bill Bridge, Atif Chaudry, Jeff Cohen, Benoit Dageville, Sandy Dreskin, Ahmed Ezzat, Jim Finnerty, Diana Foch-Lorentz, Anurag Gupta, Gary Hallmark, Michael Hartstein, Terry Hayes, Alex Ho, Chin Hong, Ken Jacobs, Sandeep Jain, Amit Jasuja, Hakan Jakobsson, Robert Jenkins, Jr., Ashok Joshi, Mohan Kamath, Jonathan Klein, R. Kleinro, Robert Kooi, Vishu Krishnamurthy, Muralidhar Krishnaprasad, Andre Kruglikov, Tirthankar Lahiri, Juan Loaiza, Brom Mahbod, William Maimone, Andrew Mendelsohn, Reza Monajjemi, Mark Moore, Rita Moran, Denise Oertel, Mark Porter, Maria Pratt, Tuomas Pystynen, Patrick Ritto, Hasan Rizvi, Sriram Samu, Hari Sankar, Gordon Smith, Leng Leng Tan, Lynne Thieme, Alvin To, Alex Tsukerman, William Waddington, Joyo Wijaya, Linda Willis, Andrew Witkowski, Mohamed Zait Graphic Designer: Valarie Moore The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be the licensee’s responsibility to take all appropriate fail-safe, backup, redundancy and other measures to ensure the safe use of such applications if the Programs are used for such purposes, and Oracle disclaims liability for any damages caused by such use of the Programs. The Programs (which include both the software and documentation) contain proprietary information of Oracle Corporation; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly, or decompilation of the Programs is prohibited. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. Oracle Corporation does not warrant that this document is error free. Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Oracle Corporation. If the Programs are delivered to the U.S. Government or anyone licensing or using the Programs on behalf of the U.S. Government, the following notice is applicable: Restricted Rights Notice Programs delivered subject to the DOD FAR Supplement are "commercial computer software" and use, duplication, and disclosure of the Programs including documentation, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement. Otherwise, Programs delivered subject to the Federal Acquisition Regulations are "restricted computer software" and use, duplication, and disclosure of the Programs shall be subject to the restrictions in FAR 52.227-19, Commercial Computer Software - Restricted Rights (June, 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065. Oracle is a registered trademark, and Net8, Oracle Call Interface, Oracle7, Oracle8, Oracle8i, Oracle Designer, Oracle Enterprise Manager, Oracle Forms, Oracle Parallel Server, Oracle Server Manager, Oracle SQL*Loader, LogMiner, PL/SQL, Pro*C, Pro*C/C++, SQL*Net and SQL*Plus, and Trusted Oracle are trademarks or registered trademarks of Oracle Corporation. All other company or product names mentioned are used for identification purposes only and may be trademarks of their respective owners. iii Contents Send Us Your Comments xxv Preface xxvii Part I What Is Oracle? 1 Introduction to the Oracle Server Databases and Information Management 1-2 The Oracle Server 1-4 Oracle Databases 1-8 Database Structure and Space Management 1-8 Logical Database Structures 1-9 Physical Database Structures 1-11 Memory Structure and Processes 1-14 Memory Structures 1-14 Process Architecture 1-17 The Program Interface 1-20 An Example of How Oracle Works 1-21 The Object-Relational Model for Database Management 1-22 The Relational Model 1-22 The Object-Relational Model 1-22 Schemas and Schema Objects 1-23 The Data Dictionary 1-30 Data Concurrency and Consistency 1-30 iv Concurrency 1-30 Read Consistency 1-31 Locking Mechanisms 1-32 Distributed Processing and Distributed Databases 1-33 Client/Server Architecture: Distributed Processing 1-33 Multi-Tier Architecture: Application Servers 1-34 Distributed Databases 1-34 Table Replication 1-36 Oracle and Net8 1-37 Startup and Shutdown Operations 1-37 Database Security 1-38 Security Mechanisms 1-39 Privileges 1-41 Database Backup and Recovery 1-45 Why Is Recovery Important? 1-45 Types of Failures 1-45 Structures Used for Recovery 1-47 Basic Recovery Steps 1-50 The Recovery Manager 1-51 Data Access 1-51 SQL—The Structured Query Language 1-52 Transactions 1-53 PL/SQL 1-55 Data Integrity 1-57 Part II Database Structures 2 The Data Dictionary An Introduction to the Data Dictionary 2-2 The Structure of the Data Dictionary 2-2 SYS, the Owner of the Data Dictionary 2-3 How the Data Dictionary Is Used 2-3 How Oracle Uses the Data Dictionary 2-3 How Users and DBAs Can Use the Data Dictionary 2-5 The Dynamic Performance Tables 2-7 v 3 Tablespaces and Datafiles Databases, Tablespaces, and Datafiles 3-2 Allocating More Space for a Database 3-3 Tablespaces 3-6 The SYSTEM Tablespace 3-6 Using Multiple Tablespaces 3-7 Space Management in Tablespaces 3-7 Online and Offline Tablespaces 3-9 Read-Only Tablespaces 3-10 Temporary Tablespaces 3-12 Transporting Tablespaces between Databases 3-13 Datafiles 3-16 Datafile Contents 3-16 Size of Datafiles 3-16 Offline Datafiles 3-17 Temporary Datafiles 3-17 4 Data Blocks, Extents, and Segments The Relationships Among Data Blocks, Extents, and Segments 4-2 Data Blocks 4-3 Data Block Format 4-3 An Introduction to PCTFREE, PCTUSED, and Row Chaining 4-5 Extents 4-11 When Extents Are Allocated 4-11 Determining the Number and Size of Extents 4-11 How Extents Are Allocated 4-12 When Extents Are Deallocated 4-14 Segments 4-16 Data Segments 4-16 Index Segments 4-17 Temporary Segments 4-17 Rollback Segments 4-19 vi Part III The Oracle Instance 5 Database and Instance Startup and Shutdown Overview of an Oracle Instance 5-2 The Instance and the Database 5-2 Connecting with Administrator Privileges 5-3 Parameter Files 5-4 Instance and Database Startup 5-5 Starting an Instance 5-5 Mounting a Database 5-6 Opening a Database 5-7 Database and Instance Shutdown 5-9 Closing a Database 5-10 Dismounting a Database 5-10 Shutting Down an Instance 5-10 6 Distributed Processing Oracle Client/Server Architecture 6-2 Distributed Processing 6-2 Net8 6-5 How Net8 Works 6-5 The Network Listener 6-6 Multi-Tier Architecture 6-7 Clients 6-8 Application Servers 6-8 Database Servers 6-8 7 Memory Architecture Introduction to Oracle Memory Structures 7-2 System Global Area (SGA) 7-2 The Database Buffer Cache 7-3 The Redo Log Buffer 7-6 The Shared Pool 7-6 The Large Pool 7-12 vii Size of the SGA 7-12 Controlling the SGA’s Use of Memory 7-13 Program Global Areas (PGA) 7-14 Contents of a PGA 7-14 Size of a PGA 7-15 Sort Areas 7-16 Virtual Memory 7-17 Software Code Areas 7-17 8 Process Architecture Introduction to Processes 8-2 Multiple-Process Oracle Systems 8-2 Types of Processes 8-2 User Processes 8-4 Connections and Sessions 8-4 Oracle Processes 8-5 Server Processes 8-5 Background Processes 8-5 Trace Files and the ALERT File 8-14 Multi-Threaded Server Configuration 8-16 Dispatcher Request and Response Queues 8-17 Shared Server Processes 8-19 Artificial Deadlocks 8-19 Restricted Operations of the Multi-Threaded Server 8-20 An Example of Oracle Using the Multi-Threaded Server 8-20 Dedicated Server Configuration 8-22 An Example of Oracle Using Dedicated Server Processes 8-24 The Program Interface 8-25 Program Interface Structure 8-25 The Program Interface Drivers 8-26 Operating System Communications Software 8-26 9 Database Resource Management Introduction to the Database Resource Manager 9-2 Resource Consumer Groups and Resource Plans 9-3 viii What Are Resource Consumer Groups? 9-3 What Are Resource Plans? 9-4 Resource Allocation Methods 9-6 CPU Resource Allocation Method: Emphasis 9-6 Maximum Degree of Parallelism Resource Allocation Method: Absolute 9-7 Resource Plan Directives 9-7 Examples 9-7 Using Resource Consumer Groups and Resource Plans 9-8 Using Subplans 9-9 Using Multi-Level Resource Plans 9-10 Using the Parallel Degree Limit Resource Directive 9-10 Summary 9-11 Using the Database Resource Manager 9-11 Part IV The Object-Relational DBMS 10 Schema Objects Overview of Schema Objects 10-2 Tables 10-3 How Table Data Is Stored 10-4 Nulls 10-7 Default Values for Columns 10-8 Nested Tables 10-9 Temporary Tables 10-10 Views 10-11 Storage for Views 10-12 How Views Are Used 10-13 The Mechanics of Views 10-14 Dependencies and Views 10-15 Updatable Join Views 10-15 Object Views 10-16 Inline Views 10-16 Materialized Views 10-17 Refreshing Materialized Views 10-18 Materialized View Logs 10-18 ix Dimensions 10-18 The Sequence Generator 10-19 Synonyms 10-20 Indexes 10-21 Unique and Nonunique Indexes 10-22 Composite Indexes 10-22 Indexes and Keys 10-23 Indexes and Nulls 10-24 Function-Based Indexes 10-24 How Indexes Are Stored 10-26 Key Compression 10-29 Reverse Key Indexes 10-31 Bitmap Indexes 10-32 Index-Organized Tables 10-36 Benefits of Index-Organized Tables 10-38 Index-Organized Tables with Row Overflow Area 10-38 Secondary Indexes on Index-Organized Tables 10-39 Additional Features of Index-Organized Tables 10-39 Applications of Interest for Index-Organized Tables 10-40 Application Domain Indexes 10-42 Indextypes 10-43 Domain Indexes 10-43 User-Defined Operators 10-44 Clusters 10-46 Performance Considerations 10-48 Format of Clustered Data Blocks 10-49 The Cluster Key 10-49 The Cluster Index 10-50 Hash Clusters 10-50 How Data Is Stored in a Hash Cluster 10-51 Hash Key Values 10-53 Hash Functions 10-54 Allocation of Space for a Hash Cluster 10-55 Single Table Hash Clusters 10-57 x 11 Partitioned Tables and Indexes Introduction to Partitioning 11-2 What Is Partitioning? 11-2 Advantages of Partitioning 11-5 Manual Partitioning with Partition Views 11-11 Basic Partitioning Model 11-13 Range Partitioning 11-15 Hash Partitioning 11-16 Composite Partitioning 11-17 Partition and Subpartition Names 11-18 Partitioning and Subpartitioning Columns and Keys 11-19 Partition Bounds for Range Partitioning 11-20 Equipartitioning 11-24 Rules for Partitioning Tables and Indexes 11-27 Table Partitioning 11-27 Index Partitioning 11-29 Partitioning of Tables with LOB Columns 11-38 Partitioning Index-Organized Tables and Their Secondary Indexes 11-42 DML Partition Locks and Subpartition Locks 11-45 DML Partition Locks 11-46 DML Subpartition Locks 11-46 Performance Considerations for Oracle Parallel Server 11-47 Maintenance Operations 11-48 Partition Maintenance Operations 11-48 Managing Indexes 11-59 Privileges for Partitioned Tables and Indexes 11-62 Auditing for Partitioned Tables and Indexes 11-63 Partition-Extended and Subpartition-Extended Table Names 11-63 PARTITION and SUBPARTITION Specifications 11-63 Viewing Partitions or Subpartitions as Tables 11-64 Using Partition- and Subpartition-Extended Table Names 11-64 12 Built-In Datatypes Overview of Oracle Datatypes 12-2 Character Datatypes 12-5 [...]... server manuals Information in this manual applies to the Oracle server running on all operating systems Oracle8i and Oracle8i Enterprise Edition Oracle8i Concepts contains information that describes the features and functionality of the Oracle8i and the Oracle8i Enterprise Edition products Oracle8i and Oracle8i Enterprise Edition have the same basic features However, several advanced features are available... information about the differences between Oracle8i and the Oracle8i Enterprise Edition and the features and options that are available to you, see Getting to Know Oracle8i xxvii Audience This manual is written for database administrators, system administrators, and database application developers What You Should Already Know You should be familiar with relational database concepts and with the operating system... other concepts of the Oracle server, it does not explain how to administer the Oracle server For that information, see Oracle8i Administrator’s Guide If You’re Interested in Application Design In addition to administrators, experienced users of Oracle and advanced database application designers will find information in this manual useful However, database application developers should also refer to Oracle8i. .. introduction to the concepts and terminology used throughout the remainder of this manual If You’re Interested in Installation and Migration This manual is not an installation or migration guide Therefore, if your primary interest is installation, refer to your operating system-specific Oracle documentation, or if your primary interest is database and application migration, refer to Oracle8i Migration... 34-14 Replication Conflicts 34-15 Specialized Replication Options 34-15 Part X A Operating System-Specific Information Index xxiv Appendix Send Us Your Comments Oracle8i Concepts, Release 8.1.5 Part No A67781-01 Oracle Corporation welcomes your comments and suggestions on the quality and usefulness of this publication Your input is an important part of the information... VIII: Data Protection s Part IX: Distributed Databases and Replication s Part X: Appendix Part I: What Is Oracle? Chapter 1, "Introduction to the Oracle Server" This chapter provides an overview of the concepts and terminology you need for understanding the Oracle data server You should read this overview before using the detailed information in the remainder of this manual Part II: Database Structures... lists all the operating system-specific references within this manual How to Use This Manual Every reader of this manual should read Chapter 1, "Introduction to the Oracle Server" This overview of the concepts and terminology related to Oracle provides a foundation for the more detailed information that follows in later chapters Each part of this manual addresses a specific audience within the general . Oracle8 i Concepts Release 8.1.5 February 1999 Part No. A67781-01 Oracle8i Concepts, Release 8.1.5 Part No. A67781-01 Copyright. a registered trademark, and Net8, Oracle Call Interface, Oracle7, Oracle8, Oracle8i, Oracle Designer, Oracle Enterprise Manager, Oracle Forms, Oracle Parallel