Oracle8i - Department Of Computer Science And Electrical Engineering

Transcription

Oracle8iConceptsRelease 8.1.5February 1999Part No. A67781-01

Oracle8i Concepts, Release 8.1.5Part No. A67781-01Copyright 1999, Oracle Corporation. All rights reserved.Primary Authors:Lefty Leverenz, Diana RehfieldContributing Authors: Steve Bobrowski, Cynthia Chin-Lee, Cindy Closkey, Bill Creekbaum, JasonDurbin, John Frazzini, Richard Mateosian, Denis Raphaely, Danny SokolskyContributors: 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, GaryHallmark, 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, RobertKooi, Vishu Krishnamurthy, Muralidhar Krishnaprasad, Andre Kruglikov, Tirthankar Lahiri, JuanLoaiza, Brom Mahbod, William Maimone, Andrew Mendelsohn, Reza Monajjemi, Mark Moore, RitaMoran, Denise Oertel, Mark Porter, Maria Pratt, Tuomas Pystynen, Patrick Ritto, Hasan Rizvi, SriramSamu, Hari Sankar, Gordon Smith, Leng Leng Tan, Lynne Thieme, Alvin To, Alex Tsukerman, WilliamWaddington, Joyo Wijaya, Linda Willis, Andrew Witkowski, Mohamed ZaitGraphic Designer: Valarie MooreThe Programs are not intended for use in any nuclear, aviation, mass transit, medical, or otherinherently dangerous applications. It shall be the licensee’s responsibility to take all appropriatefail-safe, backup, redundancy and other measures to ensure the safe use of such applications if thePrograms are used for such purposes, and Oracle disclaims liability for any damages caused by suchuse of the Programs.The Programs (which include both the software and documentation) contain proprietary information ofOracle Corporation; they are provided under a license agreement containing restrictions on use anddisclosure and are also protected by copyright, patent, and other intellectual and industrial propertylaws. 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 anyproblems in the documentation, please report them to us in writing. Oracle Corporation does notwarrant that this document is error free. Except as may be expressly permitted in your license agreementfor these Programs, no part of these Programs may be reproduced or transmitted in any form or by anymeans, electronic or mechanical, for any purpose, without the express written permission of OracleCorporation.If the Programs are delivered to the U.S. Government or anyone licensing or using the Programs onbehalf of the U.S. Government, the following notice is applicable:Restricted Rights Notice Programs delivered subject to the DOD FAR Supplement are "commercialcomputer software" and use, duplication, and disclosure of the Programs including documentation, shallbe 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 OracleParkway, Redwood City, CA 94065.Oracle is a registered trademark, and Net8, Oracle Call Interface, Oracle7, Oracle8, Oracle8i, OracleDesigner, 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 Oracleare trademarks or registered trademarks of Oracle Corporation. All other company or product namesmentioned are used for identification purposes only and may be trademarks of their respective owners.

ContentsSend Us Your Comments . xxvPreface. xxviiPart I1What Is Oracle?Introduction to the Oracle ServerDatabases and Information Management.The Oracle Server .Oracle Databases.Database Structure and Space Management .Logical Database Structures.Physical Database Structures .Memory Structure and Processes.Memory Structures.Process Architecture.The Program Interface .An Example of How Oracle Works.The Object-Relational Model for Database Management.The Relational Model .The Object-Relational Model .Schemas and Schema Objects .The Data Dictionary .Data Concurrency and Consistency 221-231-301-30iii

Concurrency .Read Consistency.Locking Mechanisms.Distributed Processing and Distributed Databases.Client/Server Architecture: Distributed Processing .Multi-Tier Architecture: Application Servers.Distributed Databases .Table Replication .Oracle and Net8 .Startup and Shutdown Operations.Database Security.Security Mechanisms.Privileges.Database Backup and Recovery .Why Is Recovery Important? .Types of Failures .Structures Used for Recovery .Basic Recovery Steps .The Recovery Manager .Data Access.SQL—The Structured Query Language .Transactions.PL/SQL .Data Integrity.Part II2Database StructuresThe Data DictionaryAn Introduction to the Data Dictionary .The Structure of the Data Dictionary.SYS, the Owner of the Data Dictionary.How the Data Dictionary Is Used .How Oracle Uses the Data Dictionary.How Users and DBAs Can Use the Data Dictionary.The Dynamic Performance 51-572-22-22-32-32-32-52-7

3Tablespaces and DatafilesDatabases, Tablespaces, and Datafiles.Allocating More Space for a Database.Tablespaces.The SYSTEM Tablespace .Using Multiple Tablespaces .Space Management in Tablespaces.Online and Offline Tablespaces.Read-Only Tablespaces.Temporary Tablespaces .Transporting Tablespaces between Databases.Datafiles .Datafile Contents .Size of Datafiles.Offline Datafiles .Temporary 163-163-173-17Data Blocks, Extents, and SegmentsThe Relationships Among Data Blocks, Extents, and Segments .Data Blocks .Data Block Format .An Introduction to PCTFREE, PCTUSED, and Row Chaining.Extents .When Extents Are Allocated.Determining the Number and Size of Extents.How Extents Are Allocated.When Extents Are Deallocated .Segments.Data Segments.Index Segments .Temporary Segments .Rollback -174-174-19v

Part III The Oracle Instance5Database and Instance Startup and ShutdownOverview of an Oracle Instance .The Instance and the Database .Connecting with Administrator Privileges.Parameter Files.Instance and Database Startup.Starting an Instance .Mounting a Database .Opening a Database.Database and Instance Shutdown .Closing a Database .Dismounting a Database.Shutting Down an Instance .6Distributed ProcessingOracle Client/Server Architecture.Distributed Processing.Net8.How Net8 Works .The Network Listener .Multi-Tier Architecture.Clients.Application Servers .Database Servers .76-26-26-56-56-66-76-86-86-8Memory ArchitectureIntroduction to Oracle Memory Structures.System Global Area (SGA) .The Database Buffer Cache.The Redo Log Buffer.The Shared Pool .The Large Pool 37-67-67-12

Size of the SGA.Controlling the SGA’s Use of Memory.Program Global Areas (PGA) .Contents of a PGA .Size of a PGA.Sort Areas .Virtual Memory.Software Code Areas.8Process ArchitectureIntroduction to Processes .Multiple-Process Oracle Systems .Types of Processes .User Processes.Connections and Sessions.Oracle Processes .Server Processes.Background Processes.Trace Files and the ALERT File .Multi-Threaded Server Configuration.Dispatcher Request and Response Queues.Shared Server Processes.Artificial Deadlocks.Restricted Operations of the Multi-Threaded Server .An Example of Oracle Using the Multi-Threaded Server .Dedicated Server Configuration .An Example of Oracle Using Dedicated Server Processes .The Program Interface .Program Interface Structure.The Program Interface Drivers .Operating System Communications Software 258-268-26Database Resource ManagementIntroduction to the Database Resource Manager . 9-2Resource Consumer Groups and Resource Plans . 9-3vii

What Are Resource Consumer Groups? .What Are Resource Plans?.Resource Allocation Methods.CPU Resource Allocation Method: Emphasis .Maximum Degree of Parallelism Resource Allocation Method: Absolute .Resource Plan Directives .Examples .Using Resource Consumer Groups and Resource Plans .Using Subplans .Using Multi-Level Resource Plans .Using the Parallel Degree Limit Resource Directive .Summary .Using the Database Resource Manager .Part IV109-39-49-69-69-79-79-79-89-99-109-109-119-11The Object-Relational DBMSSchema ObjectsOverview of Schema Objects. 10-2Tables. 10-3How Table Data Is Stored. 10-4Nulls. 10-7Default Values for Columns. 10-8Nested Tables . 10-9Temporary Tables . 10-10Views . 10-11Storage for Views. 10-12How Views Are Used. 10-13The Mechanics of Views . 10-14Dependencies and Views. 10-15Updatable Join Views. 10-15Object Views . 10-16Inline Views . 10-16Materialized Views. 10-17Refreshing Materialized Views. 10-18Materialized View Logs . 10-18viii

Dimensions .The Sequence Generator .Synonyms .Indexes .Unique and Nonunique Indexes .Composite Indexes .Indexes and Keys.Indexes and Nulls.Function-Based Indexes.How Indexes Are Stored .Key Compression.Reverse Key Indexes .Bitmap Indexes.Index-Organized Tables .Benefits of Index-Organized Tables.Index-Organized Tables with Row Overflow Area.Secondary Indexes on Index-Organized Tables.Additional Features of Index-Organized Tables.Applications of Interest for Index-Organized Tables.Application Domain Indexes .Indextypes .Domain Indexes .User-Defined Operators .

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