Oracle® Database Concepts 10g Release 1 (10.1) Part No. B10743-01 December 2003 Oracle Database Concepts, 10g Release 1 (10.1) Part No. B10743-01 Copyright © 1993, 2003 Oracle Corporation. All rights reserved. Primary Author: Michele Cyran Contributing Author: Paul Lane Contributors: Omar Alonso, Penny Avril, Hermann Baer, Sandeepan Banerjee, Mark Bauer, Ruth Baylis, Bill Bridge, Sandra Cheevers, Carol Colrain, Vira Goorah, Mike Hartstein, John Haydu, Wei Hu, Ramkumar Krishnan, Vasudha Krishnaswamy, Bill Lee, Bryn Llewellyn, Phil Locke, Rich Long, Diana Lorentz, Paul Manning, Krishna Mohan, Valarie Moore, Mughees Minhas, Tony Morales, Gopal Mulagund, Muthu Olagappan, Kathy Rich, John Russell, Vivian Schupmann, Bob Thome, Randy Urbano, Michael Verheij, Ron Weiss, Steve Wertheimer, Ramana Yerneni 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, except to the extent required to obtain interoperability with other independently created software or as specified by law, 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. 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 Corporation disclaims liability for any damages caused by such use of the Programs. Oracle is a registered trademark, and Express, Oracle Store, Oracle8i, Oracle9i, PL/SQL, Pro*C, Pro*C/C++, Pro*COBOL, Pro*FORTRAN, SQL*Net, and SQL*Plus are trademarks or registered trademarks of Oracle Corporation. Other names may be trademarks of their respective owners. iii Contents Send Us Your Comments xxxiii Preface xxxv Audience xxxv Organization xxxvi Related Documentation xxxix Conventions xl Documentation Accessibility xlv Part I What Is Oracle? 1 Introduction to the Oracle Database Oracle Database Architecture 1-1 Overview of Oracle Grid Architecture - XXX 1-2 Oracle Technologies that Enable the Grid 1-4 Managing the Grid 1-6 Overview of Application Architecture 1-7 Client/Server Architecture 1-7 Multitier Architecture: Application Servers 1-8 Overview of Physical Database Structures 1-8 Datafiles 1-8 Control Files 1-9 Redo Log Files 1-9 Archive Log Files 1-10 iv Parameter Files 1-10 Alert and Trace Log Files 1-10 Backup Files 1-11 Overview of Logical Database Structures 1-11 Tablespaces 1-11 Oracle Data Blocks 1-12 Extents 1-12 Segments 1-12 Overview of Schemas and Common Schema Objects 1-14 Tables 1-14 Indexes 1-14 Views 1-14 Clusters 1-15 Synonyms 1-15 Overview of the Oracle Data Dictionary 1-15 Overview of the Oracle Instance 1-16 Real Application Clusters: Multiple Instance Systems 1-16 Instance Memory Structures 1-16 System Global Area 1-16 Program Global Area 1-17 Oracle Background Processes 1-18 Process Architecture 1-18 Overview of Accessing the Database 1-19 Network Connections 1-19 Starting Up the Database 1-20 How Oracle Works 1-20 Overview of Oracle Utilities 1-21 Oracle Database Features 1-21 Overview of Scalability and Performance Features 1-22 Concurrency 1-22 Read Consistency 1-23 Locking Mechanisms 1-24 Quiesce Database 1-25 Real Application Clusters 1-25 Portability 1-25 v Overview of Manageability Features 1-26 Self-Managing Database 1-26 Oracle Enterprise Manager 1-26 SQL*Plus 1-27 Automatic Storage Management 1-27 The Scheduler 1-27 Database Resource Manager 1-27 Overview of Database Backup and Recovery Features 1-28 Types of Failures 1-28 Structures Used for Recovery 1-29 Overview of High Availability Features 1-31 Overview of Business Intelligence Features 1-32 Data Warehousing 1-32 Extraction, Transformation, and Loading (ETL) 1-32 Materialized Views 1-32 Bitmap Indexes in Data Warehousing 1-32 Table Compression 1-33 Parallel Execution 1-33 Analytic SQL 1-33 OLAP Capabilities 1-33 Data Mining 1-34 Partitioning 1-34 Overview of Content Management Features 1-35 XML in Oracle 1-35 LOBs 1-35 Oracle Text 1-35 Oracle Ultra Search 1-35 Oracle interMedia 1-36 Oracle Spatial 1-36 Overview of Security Features 1-36 Security Mechanisms 1-37 Overview of Data Integrity and Triggers 1-37 Integrity Constraints 1-38 Keys 1-38 Triggers 1-39 vi Overview of Information Integration Features 1-39 Distributed SQL 1-39 Oracle Streams 1-40 Oracle Transparent Gateways and Generic Connectivity 1-42 Oracle Database Application Development 1-42 Overview of Oracle SQL 1-43 SQL Statements 1-43 Overview of PL/SQL 1-44 PL/SQL Program Units 1-45 Overview of Java 1-45 Overview of Application Programming Languages (APIs) 1-46 Overview of Transactions 1-47 Commit and Undo Transactions 1-48 Savepoints 1-48 Overview of Datatypes 1-48 Overview of Globalization 1-49 Part II Oracle Database Architecture 2 Data Blocks, Extents, and Segments Introduction to Data Blocks, Extents, and Segments 2-1 Overview of Data Blocks 2-3 Data Block Format 2-4 Header (Common and Variable) 2-4 Table Directory 2-4 Row Directory 2-4 Overhead 2-5 Row Data 2-5 Free Space 2-5 Free Space Management 2-5 Availability and Optimization of Free Space in a Data Block 2-6 Row Chaining and Migrating 2-6 PCTFREE, PCTUSED, and Row Chaining 2-7 The PCTFREE Parameter 2-7 The PCTUSED Parameter 2-8 vii Overview of Extents 2-11 When Extents Are Allocated 2-11 Determine the Number and Size of Extents 2-12 How Extents Are Allocated 2-13 When Extents Are Deallocated 2-13 Extents in Nonclustered Tables 2-14 Extents in Clustered Tables 2-14 Extents in Materialized Views and Their Logs 2-14 Extents in Indexes 2-15 Extents in Temporary Segments 2-15 Extents in Rollback Segments 2-15 Overview of Segments 2-15 Introduction to Data Segments 2-16 Introduction to Index Segments 2-17 Introduction to Temporary Segments 2-17 Operations that Require Temporary Segments 2-17 Segments in Temporary Tables and Their Indexes 2-18 How Temporary Segments Are Allocated 2-18 Introduction to Automatic Undo Management 2-19 Undo Mode 2-20 Undo Quota 2-21 Automatic Undo Retention 2-21 External Views 2-21 3 Tablespaces, Datafiles, and Control Files Introduction to Tablespaces, Datafiles, and Control Files 3-1 Oracle-Managed Files 3-3 Allocate More Space for a Database 3-3 Overview of Tablespaces 3-6 Bigfile Tablespaces 3-7 Benefits of Bigfile Tablespaces 3-8 Considerations with Bigfile Tablespaces 3-8 The SYSTEM Tablespace 3-9 The Data Dictionary 3-9 PL/SQL Program Units Description 3-9 viii The SYSAUX Tablespace 3-10 Undo Tablespaces 3-10 Creation of Undo Tablespaces 3-11 Assignment of Undo Tablespaces 3-11 Default Temporary Tablespace 3-11 How to Specify a Default Temporary Tablespace 3-12 Using Multiple Tablespaces 3-12 Managing Space in Tablespaces 3-13 Locally Managed Tablespaces 3-13 Segment Space Management in Locally Managed Tablespaces 3-14 Dictionary Managed Tablespaces 3-15 Multiple Block Sizes 3-15 Online and Offline Tablespaces 3-16 Bringing Tablespaces Offline 3-16 Use of Tablespaces for Special Procedures 3-17 Read-Only Tablespaces 3-17 Temporary Tablespaces for Sort Operations 3-18 Sort Segments 3-18 Creation of Temporary Tablespaces 3-19 Transport of Tablespaces Between Databases 3-19 How to Move or Copy a Tablespace to Another Database 3-20 Overview of Datafiles 3-21 Datafile Contents 3-21 Size of Datafiles 3-22 Offline Datafiles 3-22 Temporary Datafiles 3-22 Overview of Control Files 3-23 Control File Contents 3-23 Multiplexed Control Files 3-25 4 Transaction Management Introduction to Transactions 4-1 Statement Execution and Transaction Control 4-2 Statement-Level Rollback 4-3 Resumable Space Allocation 4-4 ix Overview of Transaction Management 4-4 Commit Transactions 4-5 Rollback of Transactions 4-6 Savepoints In Transactions 4-7 Transaction Naming 4-8 How Transactions Are Named 4-8 Commit Comment 4-8 The Two-Phase Commit Mechanism 4-9 Overview of Autonomous Transactions 4-10 Autonomous PL/SQL Blocks 4-10 Transaction Control Statements in Autonomous Blocks 4-11 5 Schema Objects Introduction to Schema Objects 5-1 Overview of Tables 5-4 How Table Data Is Stored 5-5 Row Format and Size 5-5 Rowids of Row Pieces 5-7 Column Order 5-7 Table Compression 5-8 Using Table Compression 5-8 Nulls Indicate Absence of Value 5-9 Default Values for Columns 5-10 Default Value Insertion and Integrity Constraint Checking 5-10 Partitioned Tables 5-11 Nested Tables 5-12 Temporary Tables 5-12 Segment Allocation 5-13 Parent and Child Transactions 5-13 External Tables 5-14 The Access Driver 5-14 Data Loading with External Tables 5-15 Parallel Access to External Tables 5-15 Overview of Views 5-16 How Views are Stored 5-17 x How Views Are Used 5-18 Mechanics of Views 5-19 Globalization Support Parameters in Views 5-19 Use of Indexes Against Views 5-19 Dependencies and Views 5-20 Updatable Join Views 5-20 Object Views 5-21 Inline Views 5-21 Overview of Materialized Views 5-22 Define Constraints on Views 5-23 Refresh Materialized Views 5-24 Materialized View Logs 5-24 Overview of Dimensions 5-24 Overview of the Sequence Generator 5-25 Overview of Synonyms 5-27 Overview of Indexes 5-28 Unique and Nonunique Indexes 5-29 Composite Indexes 5-30 Indexes and Keys 5-30 Indexes and Nulls 5-31 Function-Based Indexes 5-31 Uses of Function-Based Indexes 5-32 Optimization with Function-Based Indexes 5-32 Dependencies of Function-Based Indexes 5-33 How Indexes Are Stored 5-34 Format of Index Blocks 5-34 The Internal Structure of Indexes 5-35 Index Properties 5-36 Advantages of B-tree Structure 5-36 Index Unique Scan 5-37 Index Range Scan 5-37 Key Compression 5-37 Prefix and Suffix Entries 5-37 Performance and Storage Considerations 5-38 Uses of Key Compression 5-38 [...]... s Conventions s Documentation Accessibility Audience Oracle Database Concepts is intended for database administrators, system administrators, and database application developers To use this document, you need to know the following: s Relational database concepts in general s Concepts and terminology in Chapter 1, "Introduction to the Oracle Database" s The operating system environment under which you... Situations How a Database Is Mounted How a Database Is Mounted with Real Application Clusters How a Standby Database Is Mounted How a Clone Database Is Mounted What Happens When You Open a Database Instance Recovery Undo Space Acquisition and Management Resolution of In-Doubt Distributed Transaction Open a Database in Read-Only... Overview of Database and Instance Shutdown Close a Database Close the Database by Terminating the Instance 12-1 12-2 12-3 12-3 12-4 12-5 12-5 12-6 12-6 12-6 12-6 12-7 12-7 12-8 12-8 12-8 12-8 12-9 12-9 12-10 12-10 xv Unmount a Database 12-10 Shut Down an Instance 12-10 Abnormal Instance Shutdown 12-10 Part III 13 Oracle Database Features... xxxiii xxxiv Preface This manual describes all features of the Oracle database server, an object-relational database management system It describes how the Oracle database server functions, and it lays a conceptual foundation for much of the practical information contained in other manuals Information in this manual applies to the Oracle database server running on all operating systems This preface contains... Management 14-19 Overview of the Database Resource Manager 14-19 Database Resource Manager Concepts 14-21 Overview of Services 14-21 Workload Management with Services 14-22 High Availability with Services 14-23 Automatic Storage Management 14-25 Basic Automatic Storage Management Concepts 14-26 Disk Groups ... document contains: Part I, "What Is Oracle?" Chapter 1, "Introduction to the Oracle Database" This chapter provides an overview of the concepts and features you need for understanding the Oracle database server You should read this overview before using the detailed information in the remainder of this manual Part II, "Oracle Database Architecture" Chapter 2, "Data Blocks, Extents, and Segments" This chapter... Ultra Search Overview of Oracle interMedia Overview of Oracle Spatial 20 19-1 19-2 19-3 19-4 19-4 19-5 19-5 19-5 19-6 19-7 19-7 Database Security Introduction to Database Security Database Users and Schemas Security Domain Privileges Roles Storage Settings and Quotas Default... 11-2 11-2 11-3 11-3 11-4 11-4 11-5 11-6 11-6 Database and Instance Startup and Shutdown Introduction to an Oracle Instance The Instance and the Database Connection with Administrator Privileges Initialization Parameter Files and Server Parameter Files How Parameter Values Are Changed Overview of Instance and Database Startup How an Instance Is... Values Adding Granules and Tracking Component Size Database Buffer Cache Organization of the Database Buffer Cache xii 7-1 7-2 7-2 7-2 7-2 7-3 7-3 7-3 7-4 7-4 7-4 7-5 7-5 7-5 7-6 7-6 7-7 8-1 8-2 8-4 8-5 8-6 8-6 8-7 8-8 8-8 8-9 8-9 The LRU Algorithm and Full Table Scans Size of the Database Buffer Cache Multiple Buffer Pools ... Introduction to Backup Consistent and Inconsistent Backups Overview of Consistent Backups Overview of Inconsistent Backups Whole Database and Partial Database Backups Whole Database Backups Tablespace Backups Datafile Backups RMAN and User-Managed Backups RMAN with Online Backups Control . Oracle® Database Concepts 10g Release 1 (10.1) Part No. B10743-01 December 2003 Oracle Database Concepts, 10g Release 1 (10.1) Part. 12-9 Overview of Database and Instance Shutdown 12-9 Close a Database 12-10 Close the Database by Terminating the Instance 12-10 xvi Unmount a Database 12-10 Shut