Oracle is a registered trademark, and Net8, Oracle Call Interface, Oracle7, Oracle8, Oracle8i, Oracle Designer, Oracle Enterprise Manager, Oracle Forms, Oracle Parallel Server, Oracle Se
Trang 1Oracle8 i
Concepts
Release 8.1.5
Trang 2Oracle8i 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.
Trang 3Send Us Your Comments xxv
Preface xxvii
Part I What Is Oracle?
1 Introduction to the Oracle Server
Databases and Information Management 1-2The Oracle Server 1-4Oracle Databases 1-8
Database Structure and Space Management 1-8Logical Database Structures 1-9Physical Database Structures 1-11
Memory Structure and Processes 1-14Memory Structures 1-14Process Architecture 1-17The Program Interface 1-20
An Example of How Oracle Works 1-21
The Object-Relational Model for Database Management 1-22The Relational Model 1-22The Object-Relational Model 1-22Schemas and Schema Objects 1-23The Data Dictionary 1-30
Data Concurrency and Consistency 1-30
Trang 4Concurrency 1-30Read Consistency 1-31Locking Mechanisms 1-32
Distributed Processing and Distributed Databases 1-33Client/Server Architecture: Distributed Processing 1-33Multi-Tier Architecture: Application Servers 1-34Distributed Databases 1-34Table Replication 1-36Oracle and Net8 1-37
Startup and Shutdown Operations 1-37
Database Security 1-38Security Mechanisms 1-39Privileges 1-41
Database Backup and Recovery 1-45Why Is Recovery Important? 1-45Types of Failures 1-45Structures Used for Recovery 1-47Basic Recovery Steps 1-50The Recovery Manager 1-51
Data Access 1-51SQL—The Structured Query Language 1-52Transactions 1-53PL/SQL 1-55Data 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-3How Oracle Uses the Data Dictionary 2-3How Users and DBAs Can Use the Data Dictionary 2-5
The Dynamic Performance Tables 2-7
Trang 53 Tablespaces and Datafiles
Databases, Tablespaces, and Datafiles 3-2Allocating More Space for a Database 3-3
Tablespaces 3-6The SYSTEM Tablespace 3-6Using Multiple Tablespaces 3-7Space Management in Tablespaces 3-7Online and Offline Tablespaces 3-9Read-Only Tablespaces 3-10Temporary Tablespaces 3-12Transporting Tablespaces between Databases 3-13
Datafiles 3-16Datafile Contents 3-16Size of Datafiles 3-16Offline Datafiles 3-17Temporary Datafiles 3-17
4 Data Blocks, Extents, and Segments
The Relationships Among Data Blocks, Extents, and Segments 4-2
Data Blocks 4-3Data Block Format 4-3
An Introduction to PCTFREE, PCTUSED, and Row Chaining 4-5
Extents 4-11When Extents Are Allocated 4-11Determining the Number and Size of Extents 4-11How Extents Are Allocated 4-12When Extents Are Deallocated 4-14
Segments 4-16Data Segments 4-16Index Segments 4-17Temporary Segments 4-17Rollback Segments 4-19
Trang 6Part III The Oracle Instance
5 Database and Instance Startup and Shutdown
Overview of an Oracle Instance 5-2The Instance and the Database 5-2Connecting with Administrator Privileges 5-3Parameter Files 5-4
Instance and Database Startup 5-5Starting an Instance 5-5Mounting a Database 5-6Opening a Database 5-7
Database and Instance Shutdown 5-9Closing a Database 5-10Dismounting a Database 5-10Shutting Down an Instance 5-10
6 Distributed Processing
Oracle Client/Server Architecture 6-2
Distributed Processing 6-2
Net8 6-5How Net8 Works 6-5The Network Listener 6-6
Multi-Tier Architecture 6-7Clients 6-8Application Servers 6-8Database Servers 6-8
7 Memory Architecture
Introduction to Oracle Memory Structures 7-2
System Global Area (SGA) 7-2The Database Buffer Cache 7-3The Redo Log Buffer 7-6The Shared Pool 7-6The Large Pool 7-12
Trang 7Size of the SGA 7-12Controlling the SGA’s Use of Memory 7-13
Program Global Areas (PGA) 7-14Contents of a PGA 7-14Size of a PGA 7-15
User Processes 8-4Connections and Sessions 8-4
Oracle Processes 8-5Server Processes 8-5Background Processes 8-5Trace Files and the ALERT File 8-14
Multi-Threaded Server Configuration 8-16Dispatcher Request and Response Queues 8-17Shared Server Processes 8-19Artificial Deadlocks 8-19Restricted 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-25Program Interface Structure 8-25The Program Interface Drivers 8-26Operating 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
Trang 8Resource Plan Directives 9-7
Examples 9-7Using Resource Consumer Groups and Resource Plans 9-8Using Subplans 9-9Using Multi-Level Resource Plans 9-10Using the Parallel Degree Limit Resource Directive 9-10Summary 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-3How Table Data Is Stored 10-4Nulls 10-7Default Values for Columns 10-8Nested Tables 10-9Temporary Tables 10-10
Views 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-16
Materialized Views 10-17Refreshing Materialized Views 10-18Materialized View Logs 10-18
Trang 9Dimensions 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
Trang 1011 Partitioned Tables and Indexes
Introduction to Partitioning 11-2What Is Partitioning? 11-2Advantages of Partitioning 11-5Manual Partitioning with Partition Views 11-11
Basic Partitioning Model 11-13Range Partitioning 11-15Hash Partitioning 11-16Composite Partitioning 11-17Partition and Subpartition Names 11-18Partitioning and Subpartitioning Columns and Keys 11-19Partition Bounds for Range Partitioning 11-20Equipartitioning 11-24
Rules for Partitioning Tables and Indexes 11-27Table Partitioning 11-27Index Partitioning 11-29Partitioning of Tables with LOB Columns 11-38Partitioning Index-Organized Tables and Their Secondary Indexes 11-42
DML Partition Locks and Subpartition Locks 11-45DML Partition Locks 11-46DML Subpartition Locks 11-46Performance Considerations for Oracle Parallel Server 11-47
Maintenance Operations 11-48Partition Maintenance Operations 11-48Managing Indexes 11-59Privileges for Partitioned Tables and Indexes 11-62Auditing for Partitioned Tables and Indexes 11-63
Partition-Extended and Subpartition-Extended Table Names 11-63PARTITION and SUBPARTITION Specifications 11-63Viewing Partitions or Subpartitions as Tables 11-64Using Partition- and Subpartition-Extended Table Names 11-64
12 Built-In Datatypes
Overview of Oracle Datatypes 12-2
Character Datatypes 12-5
Trang 11CHAR Datatype 12-5 VARCHAR2 and VARCHAR Datatypes 12-5 Column Lengths for Character Datatypes and NLS Character Sets 12-6 NCHAR and NVARCHAR2 Datatypes 12-6 LOB Character Datatypes 12-7 LONG Datatype 12-7
NUMBER Datatype 12-8 Internal Numeric Format 12-9
DATE Datatype 12-10 Using Julian Dates 12-11 Date Arithmetic 12-11 Centuries and the Year 2000 12-12
LOB Datatypes 12-12 BLOB Datatype 12-13 CLOB and NCLOB Datatypes 12-13 BFILE Datatype 12-14
RAW and LONG RAW Datatypes 12-14
ROWID and UROWID Datatypes 12-15 The ROWID Pseudocolumn 12-15 Physical Rowids 12-16 Logical Rowids 12-20 Rowids in Non-Oracle Databases 12-22
ANSI, DB2, and SQL/DS Datatypes 12-22
Data Conversion 12-23
13 User-Defined Datatypes
Introduction 13-2 Complex Data Models 13-2 Multimedia Datatypes 13-3
User-Defined Datatypes 13-3 Object Types 13-4 Collection Types 13-10
Application Interfaces 13-13 SQL 13-13 PL/SQL 13-13
Trang 12Pro*C/C++ 13-14OCI 13-14OTT 13-15JPublisher 13-15JDBC 13-16SQLJ 13-16
14 Using User-Defined Datatypes
Introduction 14-2
Object Types and References 14-3Properties of Object Attributes 14-3Object References 14-7Name Resolution 14-8
Collections 14-10Querying Collections 14-10Collection Unnesting 14-10Nested Table Locators 14-11DML on Collections 14-12
Privileges on User-Defined Types and Their Methods 14-13System Privileges 14-13Schema Object Privileges 14-13Using Types in New Types or Tables 14-13Example 14-14Privileges on Type Access and Object Access 14-15
Dependencies and Incomplete Types 14-16Completing Incomplete Types 14-17Type Dependencies of Tables 14-17
Storage of User-Defined Types 14-18Leaf-Level Attributes 14-18Row Objects 14-18Column Objects 14-19REFs 14-19Nested Tables 14-19VARRAYs 14-20
Utilities 14-20
Trang 13Import/Export of User-Defined Types 14-20Loading User-defined Types 14-20
15 Object Views
Introduction 15-2Advantages of Object Views 15-2
Defining Object Views 15-3
Using Object Views 15-4
Updating Object Views 15-5Updating Nested Table Columns in Views 15-5
Part V Data Access
16 SQL and PL/SQL
Structured Query Language (SQL) 16-2SQL Statements 16-3Identifying Nonstandard SQL 16-6Recursive SQL 16-6Cursors 16-6Shared SQL 16-7Parsing 16-7
SQL Processing 16-8Overview of SQL Statement Execution 16-8DML Statement Processing 16-10DDL Statement Processing 16-14Controlling Transactions 16-14
PL/SQL 16-15How PL/SQL Executes 16-15Language Constructs for PL/SQL 16-17Stored Procedures 16-18External Procedures 16-20
17 Transaction Management
Introduction to Transactions 17-2
Trang 14Discrete Transaction Management 17-8
Autonomous Transactions 17-9Autonomous PL/SQL Blocks 17-9Transaction Control Statements in Autonomous Blocks 17-10
18 Procedures and Packages
An Introduction to Stored Procedures and Packages 18-2Stored Procedures and Functions 18-2Packages 18-4
Procedures and Functions 18-6Procedure Guidelines 18-7Benefits of Procedures 18-7Anonymous PL/SQL Blocks versus Stored Procedures 18-9Standalone Procedures 18-9Definer Rights and Invoker Rights 18-9Dependency Tracking for Stored Procedures 18-11External Procedures 18-11
Packages 18-11Benefits of Packages 18-15Dependency Tracking for Packages 18-16Oracle Supplied Packages 18-16
How Oracle Stores Procedures and Packages 18-17Compiling Procedures and Packages 18-17Storing the Compiled Code in Memory 18-17Storing Procedures or Packages in Database 18-17
How Oracle Executes Procedures and Packages 18-18Verifying User Access 18-18Verifying Procedure Validity 18-18
Trang 15Executing a Procedure 18-19
19 Advanced Queuing
Introduction to Message Queuing 19-2
Oracle Advanced Queuing 19-3Queuing Entities 19-4Features of Advanced Queuing 19-6
20 Triggers
An Introduction to Triggers 20-2How Triggers Are Used 20-3
Parts of a Trigger 20-5Triggering Event or Statement 20-6Trigger Restriction 20-7Trigger Action 20-7
Types of Triggers 20-8Row Triggers and Statement Triggers 20-8BEFORE and AFTER Triggers 20-9Trigger Type Combinations 20-9INSTEAD-OF Triggers 20-12Triggers on System Events and User Events 20-18
Trigger Execution 20-21The Execution Model for Triggers and Integrity Constraint Checking 20-21Data Access for Triggers 20-23Storage of PL/SQL Triggers 20-25Execution of Triggers 20-25Dependency Maintenance for Triggers 20-25
21 Oracle Dependency Management
An Introduction to Dependency Issues 21-2
Resolving Schema Object Dependencies 21-4Compiling Views and PL/SQL Program Units 21-5Function-Based Index Dependencies 21-7
Dependency Management and Nonexistent Schema Objects 21-8
Trang 16Shared SQL Dependency Management 21-10
Local and Remote Dependency Management 21-10Managing Local Dependencies 21-10Managing Remote Dependencies 21-11
Part VI Optimization of SQL Statements
22 The Optimizer
What Is Optimization? 22-2Execution Plans 22-2Execution Order 22-5Optimizer Plan Stability 22-6
Cost-Based Optimization 22-7Goal of the Cost-Based Approach 22-7Statistics for Cost-Based Optimization 22-8When to Use the Cost-Based Approach 22-15
Extensible Optimization 22-16User-Defined Statistics 22-17User-Defined Selectivity 22-17User-Defined Costs 22-17
Rule-Base Optimization 22-18
23 Optimizer Operations
Overview of Optimizer Operations 23-2Optimizer Operations 23-2Types of SQL Statements 23-3
Evaluation of Expressions and Conditions 23-4Constants 23-5LIKE Operator 23-5
IN Operator 23-5ANY or SOME Operator 23-6ALL Operator 23-6BETWEEN Operator 23-7NOT Operator 23-7
Trang 17Transitivity 23-8DETERMINISTIC Functions 23-9
Transforming and Optimizing Statements 23-10Transforming ORs into Compound Queries 23-10Transforming Complex Statements into Join Statements 23-13Optimizing Statements That Access Views 23-15Optimizing Compound Queries 23-27Optimizing Distributed Statements 23-30
Choosing an Optimization Approach and Goal 23-31The OPTIMIZER_MODE Initialization Parameter 23-31Statistics in the Data Dictionary 23-32The OPTIMIZER_GOAL Parameter of the ALTER SESSION Command 23-32The FIRST_ROWS, ALL_ROWS, CHOOSE, and RULE Hints 23-33PL/SQL and the Optimizer Goal 23-33
Choosing Access Paths 23-33Access Methods 23-34Access Paths 23-36Choosing Among Access Paths 23-50
24 Optimization of Joins
Optimizing Join Statements 24-2Join Operations 24-2Choosing Execution Plans for Join Statements 24-8Views in Outer Joins 24-11
Optimizing Anti-Joins and Semi-Joins 24-13
Optimizing "Star" Queries 24-14Star Query Example 24-14Tuning Star Queries 24-15Star Transformation 24-16
Part VII Parallel SQL and Direct-Load INSERT
25 Direct-Load INSERT
Introduction to Direct-Load INSERT 25-2
Trang 18Additional Considerations for Direct-Load INSERT 25-8Index Maintenance 25-8Space Considerations 25-8Locking Considerations 25-11
Restrictions on Direct-Load INSERT 25-11
26 Parallel Execution
Overview of Parallel Execution 26-2Operations That Can Be Parallelized 26-2How Oracle Parallelizes Operations 26-3
Process Architecture for Parallel Execution 26-5The Parallel Execution Server Pool 26-7How Parallel Execution Servers Communicate 26-9Parallelizing SQL Statements 26-10
Setting the Degree of Parallelism 26-15How Oracle Determines the Degree of Parallelism for Operations 26-16Balancing the Work Load 26-19Parallelization Rules for SQL Statements 26-20
Parallel Query 26-28Parallel Queries on Index-Organized Tables 26-29Parallel Queries on Object Types 26-29
Parallel DDL 26-30DDL Statements That Can Be Parallelized 26-30CREATE TABLE AS SELECT in Parallel 26-31Recoverability and Parallel DDL 26-32Space Management for Parallel DDL 26-33
Parallel DML 26-35Advantages of Parallel DML over Manual Parallelism 26-36When to Use Parallel DML 26-37Enabling Parallel DML 26-38
Trang 19Transaction Model for Parallel DML 26-39Recovery for Parallel DML 26-40Space Considerations for Parallel DML 26-41Lock and Enqueue Resources for Parallel DML 26-42Restrictions on Parallel DML 26-43
Parallel Execution of Functions 26-46
Affinity 26-48Affinity and Parallel Queries 26-48Affinity and Parallel DML 26-49
Other Types of Parallelism 26-50
Part VIII Data Protection
27 Data Concurrency and Consistency
Data Concurrency and Consistency in a Multiuser Environment 27-2Preventable Phenomena and Transaction Isolation Levels 27-2Locking Mechanisms 27-3
How Oracle Manages Data Concurrency and Consistency 27-4Multiversion Concurrency Control 27-4Statement-Level Read Consistency 27-5Transaction-Level Read Consistency 27-6Read Consistency in the Oracle Parallel Server 27-6Oracle Isolation Levels 27-6Setting the Isolation Level 27-7Comparing Read Committed and Serializable Isolation 27-9Choosing an Isolation Level 27-12
How Oracle Locks Data 27-15Transactions and Data Concurrency 27-15Deadlocks 27-17Types of Locks 27-19DML (Data) Locks 27-20DDL Locks (Dictionary Locks) 27-28Latches and Internal Locks 27-29Explicit (Manual) Data Locking 27-31Oracle Lock Management Services 27-39
Trang 2028 Data Integrity
Definition of Data Integrity 28-2Types of Data Integrity 28-3How Oracle Enforces Data Integrity 28-4
An Introduction to Integrity Constraints 28-5Advantages of Integrity Constraints 28-5The Performance Cost of Integrity Constraints 28-7
Types of Integrity Constraints 28-7NOT NULL Integrity Constraints 28-7UNIQUE Key Integrity Constraints 28-8PRIMARY KEY Integrity Constraints 28-11FOREIGN KEY (Referential) Integrity Constraints 28-13CHECK Integrity Constraints 28-17
The Mechanisms of Constraint Checking 28-18Default Column Values and Integrity Constraint Checking 28-20
Deferred Constraint Checking 28-20Constraint Attributes 28-21SET CONSTRAINTS Mode 28-21Unique Constraints and Indexes 28-22
Constraint States 28-22Modifying Constraint States 28-23
29 Controlling Database Access
Database Security 29-2
Schemas, Database Users, and Security Domains 29-2
User Authentication 29-3Authentication by the Operating System 29-4Authentication by the Network 29-4Authentication by the Oracle Database 29-7Multi-Tier Authentication and Authorization 29-9Authentication of Database Administrators 29-12
User Tablespace Settings and Quotas 29-13Default Tablespace 29-13Temporary Tablespace 29-13Tablespace Access and Quotas 29-14
Trang 21The User Group PUBLIC 29-14
User Resource Limits and Profiles 29-15Types of System Resources and Limits 29-16Profiles 29-18
Licensing 29-19Concurrent Usage Licensing 29-20Named User Licensing 29-21
30 Privileges, Roles, and Security Policies
Privileges 30-2System Privileges 30-2Schema Object Privileges 30-3Table Security Topics 30-5View Security Topics 30-6Procedure Security Topics 30-7Type Security Topics 30-11
Roles 30-16Common Uses for Roles 30-17The Mechanisms of Roles 30-18Granting and Revoking Roles 30-18Who Can Grant or Revoke Roles? 30-19Naming Roles 30-19Security Domains of Roles and Users 30-19PL/SQL Blocks and Roles 30-20Data Definition Language Statements and Roles 30-20Predefined Roles 30-22The Operating System and Roles 30-22Roles in a Distributed Environment 30-22
Fine-Grained Access Control 30-22Dynamic Predicates 30-23Security Policy Example 30-23
Application Context 30-24
31 Auditing
Introduction to Auditing 31-2
Trang 22Auditing Features 31-2Auditing Mechanisms 31-4
Rolling Forward and Rolling Back 32-8The Redo Log and Rolling Forward 32-9Rollback Segments and Rolling Back 32-9
Improving Recovery Performance 32-10Performing Recovery in Parallel 32-10Fast-Start Recovery 32-13Masking Failures with Transparent Application Failover 32-14
Recovery Manager 32-15Recovery Catalog 32-15Parallelization 32-16Report Generation 32-17
Database Archiving Modes 32-18NOARCHIVELOG Mode (Media Recovery Disabled) 32-18ARCHIVELOG Mode (Media Recovery Enabled) 32-18
Control Files 32-21Control File Contents 32-21
Trang 23Multiplexed Control Files 32-22
Database Backups 32-23Whole Database Backups 32-23Partial Database Backups 32-24The Export and Import Utilities 32-25Read-Only Tablespaces and Backup 32-26
Survivability 32-26Planning for Disaster Recovery 32-26Automated Standby Database 32-26
Part IX Distributed Databases and Replication
33 Distributed Databases
Oracle’s Distributed Database Architecture 33-2
Clients and Servers 33-2The Network 33-4Databases and Database Links 33-4Database Links 33-6Schema Object Name Resolution 33-6Connecting Between Oracle Server Versions 33-7Distributed Databases and Distributed Processing 33-7Distributed Databases and Database Replication 33-7
Heterogeneous Distributed Databases 33-8Heterogeneous Services 33-8Heterogeneous Services Agents 33-9Features 33-9
Developing Distributed Database Applications 33-10Distributed Query Optimization 33-10Remote and Distributed SQL Statements 33-11Remote Procedure Calls (RPCs) 33-12Remote and Distributed Transactions 33-12
Transparency in a Distributed Database System 33-14
Administering an Oracle Distributed Database System 33-16
Site Autonomy 33-16Distributed Database Security 33-17
Trang 24Tools for Administering Oracle Distributed Databases 33-19Enterprise Manager 33-19Third-Party Administration Tools 33-20SNMP Support 33-20
National Language Support 33-20
34 Database Replication
What Is Replication? 34-2
Replication Objects, Groups, and Sites 34-2
Multimaster Replication 34-6Uses for Multimaster Replication 34-6
Snapshot Replication 34-8Read-Only Snapshots 34-8Updateable Snapshots 34-9Uses of Snapshot Replication 34-11
Multimaster and Snapshot Hybrid Configurations 34-13
Administering a Replicated Environment 34-14Replication Catalog 34-14Replication Management API and Administration Requests 34-14Oracle Replication Manager 34-14
Trang 25Send Us Your Comments
Oracle8i Concepts, Release 8.1.5
Part No A67781-01
Oracle Corporation welcomes your comments and suggestions on the quality andusefulness of this publication Your input is an important part of the informationused for revision
■ Did you find any errors?
■ Is the information clearly presented?
■ Do you need more information? If so, where?
■ Are the examples correct? Do you need more examples?
■ What features did you like most about this manual?
If you find any errors or have any other suggestions for improvement, pleaseindicate the chapter, section, and page number (if available) You can sendcomments to the Information Development department in the following ways:
■ Electronic mail - infodev@us.oracle.com
■ FAX - (650) 506-7228 Attn: Oracle Server Documentation
■ Postal service:
Oracle CorporationServer Documentation Manager
500 Oracle ParkwayRedwood Shores, CA 94065USA
If you would like a reply, please give your name, address, and telephone numberbelow
Trang 26If you have problems with the software, please contact your local Oracle WorldWide Support Center
Trang 27Oracle8i 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 only with the Enterprise Edition, and some of these areoptional For example, to partition tables, you must have the Enterprise Edition andthe Partitioning Option
For 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.
Trang 28Audience
This manual is written for database administrators, system administrators, anddatabase application developers
What You Should Already Know
You should be familiar with relational database concepts and with the operatingsystem environment under which you are running Oracle
As a prerequisite, all readers should read Chapter 1, "Introduction to the Oracle Server" That chapter is a comprehensive introduction to the concepts andterminology 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 primaryinterest is installation, refer to your operating system-specific Oracle
documentation, or if your primary interest is database and application migration,
refer to Oracle8i Migration.
If You’re Interested in Database Administration
While this manual describes the architecture, processes, structures, and otherconcepts 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 databaseapplication designers will find information in this manual useful However,
database application developers should also refer to Oracle8i Application Developer’s Guide - Fundamentals and to the documentation for the tool or language product
they are using to develop Oracle database applications
How This Manual Is Organized
This manual is divided into the following parts:
■ Part I: What Is Oracle?
■ Part II: Database Structures
■ Part III: The Oracle Instance
■ Part IV: The Object-Relational DBMS
Trang 29■ Part V: Data Access
■ Part VI: Optimization of SQL Statements
■ Part VII: Parallel SQL and Direct-Load INSERT
■ Part VIII: Data Protection
■ Part IX: Distributed Databases and Replication
■ 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 forunderstanding the Oracle data server You should read this overview before usingthe detailed information in the remainder of this manual
Part II: Database Structures
Chapter 2, "The Data Dictionary"
This chapter describes the data dictionary, which is a set of reference tables andviews that contain read-only information about an Oracle database
Chapter 3, "Tablespaces and Datafiles"
This chapter discusses how physical storage space in an Oracle database is dividedinto logical divisions called tablespaces The physical operating system files
associated with tablespaces, called datafiles, are also discussed
Chapter 4, "Data Blocks, Extents, and Segments"
This chapter discusses how data is stored and how storage space is allocated forand consumed by various objects within an Oracle database The space
management background information here supplements that in the followingchapter and inChapter 10, "Schema Objects"
Part III: The Oracle Instance
Chapter 5, "Database and Instance Startup and Shutdown"
This chapter describes an Oracle instance and explains how the database
administrator can control the accessibility of an Oracle database system Thischapter also describes the parameters that control how the database operates
Trang 30Chapter 6, "Distributed Processing"
This chapter discusses distributed processing environments in which the Oracledata server can operate
Chapter 7, "Memory Architecture"
This chapter describes the memory structures used by an Oracle database system.Chapter 8, "Process Architecture"
This chapter describes the process architecture of an Oracle instance and thedifferent process configurations available for Oracle
Chapter 9, "Database Resource Management"
This chapter describes how the Database Resource Manager can be used to controlresource use
Part IV: The Object-Relational DBMS
Chapter 10, "Schema Objects"
This chapter describes the database objects that can be created in the domain of aspecific user (a schema), including tables, views, numeric sequences, and
synonyms Optional structures that make data retrieval more efficient, includingindexes, materialized views, dimensions, and clusters, are also described
Chapter 11, "Partitioned Tables and Indexes"
This chapter describes how partitioning can be used to split large tables and indexesinto more manageable pieces
Chapter 12, "Built-In Datatypes"
This chapter describes the types of relational data that can be stored in an Oracledatabase table, such as fixed- and variable-length character strings, numbers, dates,and binary large objects (BLOBs)
Chapter 13, "User-Defined Datatypes"
This chapter gives an overview of the object extensions that Oracle provides.Chapter 14, "Using User-Defined Datatypes"
This chapter describes the user-defined object types that are available in the Oracledata server
Chapter 15, "Object Views"
This chapter describes the extensions to views provided by the Oracle data server
Trang 31Part V: Data Access
Chapter 16, "SQL and PL/SQL"
This chapter briefly describes SQL (the Structured Query Language), the languageused to communicate with Oracle, as well as PL/SQL, the Oracle procedural
language extension to SQL
Chapter 17, "Transaction Management"
This chapter defines the concept of transactions and explains the SQL statementsused to control them Transactions are logical units of work that are executedtogether as a unit
Chapter 18, "Procedures and Packages"
This chapter discusses the procedural language constructs called procedures,functions, and packages, which are PL/SQL program units that are stored in thedatabase
Chapter 19, "Advanced Queuing"
This chapter describes the Oracle Advanced Queuing feature, which allows users tostore messages in queues for deferred retrieval and processing by the Oracle server.Chapter 20, "Triggers"
This chapter describes the procedural language constructs called triggers,
procedures that are implicitly executed when anyone inserts rows into, updates, ordeletes rows from a database table
Chapter 21, "Oracle Dependency Management"
This chapter explains how Oracle manages the dependencies for objects such asprocedures, packages, triggers, and views
Part VI: Optimization of SQL Statements
Chapter 22, "The Optimizer"
This chapter introduces the optimizer, which is the part of Oracle that chooses themost efficient way to execute each SQL statement
Chapter 23, "Optimizer Operations"
This chapter explains how the optimizer chooses the best way to execute SQLstatements
Trang 32Chapter 24, "Optimization of Joins"
This chapter discusses how the optimizer executes SQL statements that containjoins, anti-joins, and semi-joins It also describes how the optimizer can use bitmapindexes to execute star queries, which join a fact table to multiple dimension tables
Part VII: Parallel SQL and Direct-Load INSERT
Chapter 25, "Direct-Load INSERT"
This chapter describes the direct-load insert path, which can be performed serially
or in parallel, and the NOLOGGING option
Chapter 26, "Parallel Execution"
This chapter describes parallel execution of SQL statements (queries, DML, andDDL statements) and explains the rules for parallelizing SQL statements
Part VIII: Data Protection
Chapter 27, "Data Concurrency and Consistency"
This chapter explains how Oracle provides concurrent access to and maintains theaccuracy of shared information in a multiuser environment It describes theautomatic mechanisms that Oracle uses to guarantee that the concurrent operations
of multiple users do not interfere with each other
Chapter 28, "Data Integrity"
This chapter discusses data integrity and the declarative integrity constraints thatyou can use to enforce data integrity
Chapter 29, "Controlling Database Access"
This chapter describes how to control user access to data and database resources.Chapter 30, "Privileges, Roles, and Security Policies"
This chapter discusses security at the system and schema object levels
Trang 33Part IX: Distributed Databases and Replication
Chapter 33, "Distributed Databases"
This chapter discusses distributed database architecture, remote data access, andtable replication
Chapter 34, "Database Replication"
This chapter discusses replication of Oracle databases in a distributed databasesystem
Part X: Appendix
Appendix A, "Operating System-Specific Information"
This appendix lists all the operating system-specific references within this manual
How to Use This Manual
Every reader of this manual should readChapter 1, "Introduction to the OracleServer" This overview of the concepts and terminology related to Oracle provides afoundation for the more detailed information that follows in later chapters
Each part of this manual addresses a specific audience within the general audiencespreviously described For example, after readingChapter 1, administrators who areinterested primarily in managing security should focus on the information
presented in Part VII,"Data Protection", particularlyChapter 29, "ControllingDatabase Access",Chapter 30, "Privileges, Roles, and Security Policies", andChapter 31, "Auditing"
Conventions Used in This Manual
This manual uses different fonts to represent different types of information
Text of the Manual
The text of this manual uses the following conventions
Trang 34INSERT INTO emp (empno, ename) VALUES (1000, ’SMITH’);
ALTER TABLESPACE users ADD DATAFILE ’users2.ora’ SIZE 50K;
Example statements may include punctuation, such as commas or quotation marks.All punctuation in example statements is required All example statements
terminate with a semicolon (;) Depending on the application, a semicolon or otherterminator may or may not be required to end a statement
UPPERCASE in Code Examples
Uppercase words in example statements indicate the keywords within Oracle SQL.When you issue statements, however, keywords are not case sensitive
lowercase in Code Examples
Lowercase words in example statements indicate words supplied only for thecontext of the example For example, lowercase words may indicate the name of atable, column, or file
Trang 35Your Comments Are Welcome
We value and appreciate your comment as an Oracle user and reader of ourmanuals As we write, revise, and evaluate our documentation, your opinions arethe most important feedback we receive
You can send comments and suggestions about this manual to the InformationDevelopment department at the following e-mail address:
infodev@us.oracle.com
If you prefer, you can send letters or faxes containing your comments to:
Server Technologies Documentation ManagerOracle Corporation
500 Oracle Parkway Redwood Shores, CA 94065Fax: (650) 506-7228
Trang 36xxxvi
Trang 39Introduction to the Oracle Server
I am Sir Oracle,
And when I ope my lips, let no dog bark!
Shakespeare: The Merchant of Venice
This chapter provides an overview of the Oracle server The topics include:
■ Databases and Information Management
■ Database Structure and Space Management
■ Memory Structure and Processes
■ The Object-Relational Model for Database Management
■ Data Concurrency and Consistency
■ Distributed Processing and Distributed Databases
■ Startup and Shutdown Operations
■ Database Security
■ Database Backup and Recovery
■ Data Access
Attention: This chapter contains information relating to both
Oracle8i and the Oracle8i Enterprise Edition Some of the features
and options documented in this chapter are available only if you
have purchased the Oracle8i Enterprise Edition See Getting to Know
Oracle8i for information about the differences between Oracle8i and
the Oracle8i Enterprise Edition.
Trang 40Databases and Information Management
1-2 Oracle8i Concepts
Databases and Information Management
A database server is the key to solving the problems of information management Ingeneral, a server must reliably manage a large amount of data in a multiuserenvironment so that many users can concurrently access the same data All thismust be accomplished while delivering high performance A database server mustalso prevent unauthorized access and provide efficient solutions for failure
recovery
The Oracle server provides efficient and effective solutions with the followingfeatures:
client/serverenvironments(distributedprocessing)
To take full advantage of a given computer system ornetwork, Oracle allows processing to be split between thedatabase server and the client application programs Thecomputer running the database management system handlesall of the database server responsibilities while the
workstations running the database application concentrate
on the interpretation and display of data
large databases andspace management
Oracle supports the largest of databases, which can containterabytes of data To make efficient use of expensivehardware devices, Oracle allows full control of space usage.many concurrent
database users
Oracle supports large numbers of concurrent users executing
a variety of database applications operating on the samedata It minimizes data contention and guarantees dataconcurrency
connectibility Oracle software allows different types of computers and
operating systems to share information across networks.high transaction
processingperformance
Oracle maintains the preceding features with a high degree
of overall system performance Database users do not sufferfrom slow processing performance
high availability At some sites, Oracle works 24 hours per day with no down
time to limit database throughput Normal systemoperations such as database backup and partial computersystem failures do not interrupt database use