Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Semestr2 / 1 - Oracle / Oracle selected docs / Database concepts.pdf
Скачиваний:
29
Добавлен:
12.05.2015
Размер:
6.96 Mб
Скачать

Oracle9i

Database Concepts

Release 2 (9.2)

March 2002

Part No. A96524-01

Oracle9i Database Concepts, Release 2 (9.2)

Part No. A96524-01

Copyright © 1996, 2002 Oracle Corporation. All rights reserved.

Primary Author: Michele Cyran

Contributors: Lance Ashdown, Cathy Baird, Sandeepan Banerjee, Mark Bauer, Ruth Baylis, Pradeep Bhanot, Janet Blowney, Allen Brumm, Ted Burroughs, Larry Carpenter, Donna Carver, Chandra Chandrasekar, Gary Chen, Amit Ganesh, Tom Grant, Mike Hartstein, John Haydu, Susan Hillson, Dominique Jeunot, Archna Kalra Johnson, Vishy Karra, Alex Keh, Susan Kotsovolos, Sushil Kumar, Tirthankar Lahiri, Paul Lane, Simon Law, Jeff Levinger, Yunrui Li, Bryn Llewellyn, Diana Lorentz, Lenore Luscher, Sheryl Maring, Ben Meng, Kuassi Mensah, Tony Morales, Ari Mozes, Subramanian Muralidhar, Ravi Murthy, Sujatha Muthulingam, Gary Ngai, Kant Patel, Ananth Raghavan, Jack Raitto, Beck Reitmeyer, Ann Rhee, Kathy Rich, John Russell, Vivian Schupmann, Ravi Shankar, Mark Smith, Richard Smith, Ekrem Soylemez, Marie St. Gelais, Debbie Steiner, Bob Thome, Anh-Tuan Tran, Randy Urbano, Stephen Vivian, Daniel Wong, Wanli Yang, Ruiling Zhang, Zulaikha

Graphic Designer: Valarie Moore

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 Oracle9i, Oracle8i, Oracle7, Oracle Store, Oracle Transparent Gateway, PL/SQL, Pro*C, Pro*Cobol, Pro*C/C++, Express, SQL*Net, and SQL*Plus are trademarks or registered trademarks of Oracle Corporation. Other names may be trademarks of their respective owners.

 

Contents

Send Us Your Comments ...............................................................................................................

xxxi

Preface.......................................................................................................................................................

xxxiii

Audience ...........................................................................................................................................

xxxiv

Organization.....................................................................................................................................

xxxiv

Related Documentation .................................................................................................................

xxxvii

Conventions......................................................................................................................................

xxxix

Documentation Accessibility ..............................................................................................................

xlii

Part I What Is Oracle?

 

1 Introduction to the Oracle Server

 

Database Structure and Space Management Overview..............................................................

1-2

Logical Database Structures........................................................................................................

1-2

Schemas and Schema Objects ..............................................................................................

1-2

Data Blocks, Extents, and Segments ...................................................................................

1-3

Tablespaces.............................................................................................................................

1-5

Physical Database Structures ......................................................................................................

1-6

Datafiles ..................................................................................................................................

1-7

Redo Log Files........................................................................................................................

1-7

Control Files ...........................................................................................................................

1-8

Data Utilities ..........................................................................................................................

1-8

Data Dictionary Overview ..........................................................................................................

1-9

Data Access Overview .....................................................................................................................

1-10

iii

SQL Overview .............................................................................................................................

1-10

SQL Statements ....................................................................................................................

1-10

Objects Overview........................................................................................................................

1-12

Advantages of Objects ........................................................................................................

1-12

PL/SQL Overview......................................................................................................................

1-13

PL/SQL Program Units ......................................................................................................

1-13

Java Overview .............................................................................................................................

1-14

XML Overview............................................................................................................................

1-15

Transactions Overview ..............................................................................................................

1-17

Commit and Roll Back Transactions.................................................................................

1-18

Savepoints.............................................................................................................................

1-19

Data Consistency Using Transactions ..............................................................................

1-19

Data Integrity Overview............................................................................................................

1-19

Integrity Constraints ...........................................................................................................

1-20

Keys .......................................................................................................................................

1-20

SQL*Plus Overview....................................................................................................................

1-21

Memory Structure and Processes Overview................................................................................

1-21

An Oracle Instance......................................................................................................................

1-24

Real Application Clusters: Multiple Instance Systems ..................................................

1-24

Memory Structures.....................................................................................................................

1-25

System Global Area.............................................................................................................

1-25

Program Global Area ..........................................................................................................

1-26

Process Architecture...................................................................................................................

1-26

User (Client) Processes........................................................................................................

1-26

Oracle Processes...................................................................................................................

1-27

The Program Interface Mechanism ..........................................................................................

1-30

Communications Software and Oracle Net Services......................................................

1-30

An Example of How Oracle Works..........................................................................................

1-31

Application Architecture Overview ..............................................................................................

1-32

Client/Server Architecture........................................................................................................

1-32

The Client..............................................................................................................................

1-32

The Server .............................................................................................................................

1-32

Multitier Architecture: Application Servers ...........................................................................

1-32

Distributed Databases Overview...................................................................................................

1-33

Location Transparency .......................................................................................................

1-34

iv

Site Autonomy .....................................................................................................................

1-34

Distributed Data Manipulation.........................................................................................

1-34

Two-Phase Commit.............................................................................................................

1-34

Replication Overview ................................................................................................................

1-35

Table Replication .................................................................................................................

1-35

Multitier Materialized Views.............................................................................................

1-35

Streams Overview ......................................................................................................................

1-36

Advanced Queuing Overview..................................................................................................

1-38

Heterogeneous Services Overview ..........................................................................................

1-39

Data Concurrency and Consistency Overview ...........................................................................

1-40

Concurrency ................................................................................................................................

1-40

Read Consistency........................................................................................................................

1-40

Read Consistency, Undo Records, and Transactions.....................................................

1-41

Read-Only Transactions .....................................................................................................

1-41

Locking Mechanisms..................................................................................................................

1-42

Automatic Locking..............................................................................................................

1-42

Manual Locking...................................................................................................................

1-42

Quiesce Database........................................................................................................................

1-42

Database Security Overview ..........................................................................................................

1-43

Security Mechanisms .................................................................................................................

1-44

Database Users and Schemas.............................................................................................

1-45

Privileges ..............................................................................................................................

1-45

Roles ......................................................................................................................................

1-46

Storage Settings and Quotas ..............................................................................................

1-47

Profiles and Resource Limits .............................................................................................

1-47

Selective Auditing of User Actions...................................................................................

1-48

Fine-Grained Auditing .......................................................................................................

1-49

Database Administration Overview .............................................................................................

1-49

Enterprise Manager Overview .................................................................................................

1-49

Database Backup and Recovery Overview.............................................................................

1-50

Why Recovery Is Important...............................................................................................

1-50

Types of Failures..................................................................................................................

1-50

Structures Used for Recovery ............................................................................................

1-52

Data Warehousing Overview .........................................................................................................

1-53

Differences Between Data Warehouse and OLTP Systems..................................................

1-54

v

Workload ..............................................................................................................................

1-54

Data Modifications ..............................................................................................................

1-54

Schema Design .....................................................................................................................

1-54

Typical Operations ..............................................................................................................

1-54

Historical Data .....................................................................................................................

1-55

Data Warehouse Architecture...................................................................................................

1-55

Data Warehouse Architecture (Basic)...............................................................................

1-55

Data Warehouse Architecture (with a Staging Area).....................................................

1-56

Data Warehouse Architecture (with a Staging Area and Data Marts) ........................

1-57

Materialized Views.....................................................................................................................

1-58

OLAP Overview..........................................................................................................................

1-58

Change Data Capture Overview ..............................................................................................

1-59

High Availability Overview ...........................................................................................................

1-60

Transparent Application Failover ............................................................................................

1-61

Elements Affected by Transparent Application Failover ..............................................

1-61

Online Reorganization Architecture ........................................................................................

1-62

Data Guard Overview................................................................................................................

1-63

Data Guard Configurations ...............................................................................................

1-63

Data Guard Components ...................................................................................................

1-63

LogMiner Overview ...................................................................................................................

1-65

Real Application Clusters..........................................................................................................

1-65

Real Application Clusters Guard .............................................................................................

1-66

Content Management Overview....................................................................................................

1-67

Oracle Internet File System Overview.....................................................................................

1-68

Part II Database Structures

 

2 Data Blocks, Extents, and Segments

 

Introduction to Data Blocks, Extents, and Segments...................................................................

2-2

Data Blocks Overview........................................................................................................................

2-3

Data Block Format ........................................................................................................................

2-4

Header (Common and Variable).........................................................................................

2-4

Table Directory.......................................................................................................................

2-5

Row Directory ........................................................................................................................

2-5

Overhead ................................................................................................................................

2-5

vi

Row Data ................................................................................................................................

2-5

Free Space ...............................................................................................................................

2-5

Free Space Management..............................................................................................................

2-6

Availability and Compression of Free Space in a Data Block.........................................

2-6

Row Chaining and Migrating..............................................................................................

2-7

PCTFREE, PCTUSED, and Row Chaining.........................................................................

2-7

Extents Overview................................................................................................................................

2-8

When Extents Are Allocated.......................................................................................................

2-8

Determine the Number and Size of Extents .............................................................................

2-8

How Extents Are Allocated.........................................................................................................

2-9

When Extents Are Deallocated.................................................................................................

2-10

Extents in Nonclustered Tables.........................................................................................

2-10

Extents in Clustered Tables................................................................................................

2-11

Extents in Materialized Views and Their Logs ...............................................................

2-11

Extents in Indexes................................................................................................................

2-11

Extents in Temporary Segments .......................................................................................

2-11

Extents in Rollback Segments............................................................................................

2-12

Segments Overview..........................................................................................................................

2-12

Introduction to Data Segments.................................................................................................

2-12

Introduction to Index Segments ...............................................................................................

2-13

Introduction to Temporary Segments .....................................................................................

2-13

Operations that Require Temporary Segments ..............................................................

2-14

Segments in Temporary Tables and Their Indexes ........................................................

2-14

How Temporary Segments Are Allocated ......................................................................

2-14

Automatic Undo Management.................................................................................................

2-16

Undo Mode ..........................................................................................................................

2-16

Undo Quota..........................................................................................................................

2-17

Undo Retention Control .....................................................................................................

2-17

External Views .....................................................................................................................

2-18

3 Tablespaces, Datafiles, and Control Files

Introduction to Tablespaces, Datafiles, and Control Files..........................................................

3-2

Oracle-Managed Files ..................................................................................................................

3-3

Allocate More Space for a Database ..........................................................................................

3-3

Tablespaces Overview........................................................................................................................

3-7

vii

The SYSTEM Tablespace..............................................................................................................

3-7

The Data Dictionary ..............................................................................................................

3-8

PL/SQL Program Units Description ..................................................................................

3-8

Undo Tablespaces .........................................................................................................................

3-8

Creation of Undo Tablespaces.............................................................................................

3-9

Assignment of Undo Tablespaces .......................................................................................

3-9

Default Temporary Tablespace.................................................................................................

3-10

How to Specify a Default Temporary Tablespace ..........................................................

3-10

Using Multiple Tablespaces ......................................................................................................

3-10

Managing Space in Tablespaces ...............................................................................................

3-11

Locally Managed Tablespaces ...........................................................................................

3-11

Segment Space Management in Locally Managed Tablespaces...................................

3-12

Dictionary Managed Tablespaces .....................................................................................

3-13

Multiple Block Sizes ...................................................................................................................

3-13

Online and Offline Tablespaces................................................................................................

3-13

When a Tablespace Goes Offline.......................................................................................

3-14

Use of Tablespaces for Special Procedures ......................................................................

3-14

Read-Only Tablespaces..............................................................................................................

3-15

Temporary Tablespaces for Sort Operations ..........................................................................

3-16

Sort Segments.......................................................................................................................

3-16

Creation of Temporary Tablespaces .................................................................................

3-16

Transport of Tablespaces Between Databases........................................................................

3-17

How to Move or Copy a Tablespace to Another Database ...........................................

3-17

Datafiles Overview...........................................................................................................................

3-18

Datafile Contents ........................................................................................................................

3-18

Size of Datafiles...........................................................................................................................

3-19

Offline Datafiles ..........................................................................................................................

3-19

Temporary Datafiles...................................................................................................................

3-19

Control Files Overview....................................................................................................................

3-20

Control File Contents .................................................................................................................

3-20

Multiplexed Control Files..........................................................................................................

3-22

4 The Data Dictionary

Introduction to the Data Dictionary................................................................................................

4-2

Structure of the Data Dictionary.................................................................................................

4-2

viii

Base Tables .............................................................................................................................

4-3

User-Accessible Views..........................................................................................................

4-3

SYS, Owner of the Data Dictionary............................................................................................

4-3

How the Data Dictionary Is Used....................................................................................................

4-3

How Oracle Uses the Data Dictionary ......................................................................................

4-3

Public Synonyms for Data Dictionary Views....................................................................

4-4

Cache the Data Dictionary for Fast Access........................................................................

4-4

Other Programs and the Data Dictionary..........................................................................

4-4

How to Use the Data Dictionary ................................................................................................

4-5

Views with the Prefix USER ................................................................................................

4-5

Views with the Prefix ALL...................................................................................................

4-6

Views with the Prefix DBA ..................................................................................................

4-6

The DUAL Table....................................................................................................................

4-6

Dynamic Performance Tables ..........................................................................................................

4-7

Database Object Metadata ................................................................................................................

4-7

Part III The Oracle Instance

 

5 Database and Instance Startup and Shutdown

 

Introduction to an Oracle Instance .................................................................................................

5-2

The Instance and the Database ...................................................................................................

5-3

Connection with Administrator Privileges...............................................................................

5-3

Initialization Parameter Files ......................................................................................................

5-4

How Parameter Values Are Changed ................................................................................

5-4

Instance and Database Startup.........................................................................................................

5-5

How an Instance Is Started..........................................................................................................

5-5

Restricted Mode of Instance Startup ..................................................................................

5-6

Forced Startup in Abnormal Situations .............................................................................

5-6

How a Database Is Mounted.......................................................................................................

5-6

How a Database Is Mounted with Real Application Clusters........................................

5-6

How a Standby Database Is Mounted................................................................................

5-7

How a Clone Database Is Mounted ....................................................................................

5-8

What Happens When You Open a Database............................................................................

5-8

Instance Recovery..................................................................................................................

5-8

Undo Space Acquisition and Management.......................................................................

5-8

ix

 

Resolution of In-Doubt Distributed Transaction ..............................................................

5-9

 

Open a Database in Read-Only Mode ................................................................................

5-9

 

Database and Instance Shutdown .................................................................................................

5-10

 

Close a Database .........................................................................................................................

5-10

 

Close the Database by Terminating the Instance............................................................

5-10

 

Unmount a Database..................................................................................................................

5-11

 

Shut Down an Instance ..............................................................................................................

5-11

 

Abnormal Instance Shutdown...........................................................................................

5-11

6

Application Architecture

 

 

Client/Server Architecture.................................................................................................................

6-2

 

Multitier Architecture ........................................................................................................................

6-5

 

Clients.............................................................................................................................................

6-6

 

Application Servers ......................................................................................................................

6-6

 

Database Servers ...........................................................................................................................

6-7

 

Oracle Net Services.............................................................................................................................

6-7

 

Connectivity ...........................................................................................................................

6-8

 

Manageability.........................................................................................................................

6-8

 

Internet Scalability.................................................................................................................

6-8

 

Internet Security.....................................................................................................................

6-8

 

How Oracle Net Services Works ................................................................................................

6-8

 

The Listener ...................................................................................................................................

6-9

 

Service Information Registration.........................................................................................

6-9

7

Memory Architecture

 

 

Introduction to Oracle Memory Structures....................................................................................

7-2

 

System Global Area (SGA) Overview ............................................................................................

7-3

 

Dynamic SGA................................................................................................................................

7-4

 

Dynamic SGA Granules........................................................................................................

7-5

 

Database Buffer Cache .................................................................................................................

7-7

 

Organization of the Database Buffer Cache ......................................................................

7-7

 

The LRU Algorithm and Full Table Scans .........................................................................

7-8

 

Size of the Database Buffer Cache.......................................................................................

7-8

 

Multiple Buffer Pools ..........................................................................................................

7-10

 

Redo Log Buffer ..........................................................................................................................

7-11

x

Shared Pool..................................................................................................................................

7-11

Library Cache.......................................................................................................................

7-12

Shared SQL Areas and Private SQL Areas ......................................................................

7-12

PL/SQL Program Units and the Shared Pool .................................................................

7-12

Dictionary Cache .................................................................................................................

7-13

Allocation and Reuse of Memory in the Shared Pool ....................................................

7-13

Large Pool....................................................................................................................................

7-15

Control of the SGA’s Use of Memory......................................................................................

7-16

Other SGA Initialization Parameters .......................................................................................

7-16

Physical Memory.................................................................................................................

7-16

SGA Starting Address.........................................................................................................

7-16

Extended Buffer Cache Mechanism..................................................................................

7-17

Program Global Areas (PGA) Overview ......................................................................................

7-17

Content of the PGA ....................................................................................................................

7-17

Private SQL Area.................................................................................................................

7-17

Session Memory...................................................................................................................

7-19

SQL Work Areas .........................................................................................................................

7-19

PGA Memory Management for Dedicated Mode .................................................................

7-20

Dedicated and Shared Servers .......................................................................................................

7-22

Software Code Areas........................................................................................................................

7-22

8 Process Architecture

Introduction to Processes ..................................................................................................................

8-2

Multiple-Process Oracle Systems ...............................................................................................

8-2

Types of Processes ........................................................................................................................

8-2

User Processes Overview...................................................................................................................

8-4

Connections and Sessions ...........................................................................................................

8-4

Oracle Processes Overview ...............................................................................................................

8-5

Server Processes............................................................................................................................

8-5

Background Processes..................................................................................................................

8-5

Database Writer Process (DBWn) .......................................................................................

8-8

Log Writer Process (LGWR) ................................................................................................

8-9

Checkpoint Process (CKPT)...............................................................................................

8-11

System Monitor Process (SMON) .....................................................................................

8-11

Process Monitor Process (PMON) ....................................................................................

8-12

xi

Recoverer Process (RECO) .................................................................................................

8-12

Job Queue Processes............................................................................................................

8-12

Archiver Processes (ARCn)................................................................................................

8-13

Lock Manager Server Process (LMS) ................................................................................

8-14

Queue Monitor Processes (QMNn)...................................................................................

8-14

Trace Files and the Alert Log ....................................................................................................

8-14

Shared Server Architecture .............................................................................................................

8-15

Scalability .....................................................................................................................................

8-16

Dispatcher Request and Response Queues.............................................................................

8-16

Dispatcher Processes (Dnnn)..............................................................................................

8-19

Shared Server Processes (Snnn) ................................................................................................

8-19

Restricted Operations of the Shared Server ............................................................................

8-20

Dedicated Server Configuration ....................................................................................................

8-21

The Program Interface......................................................................................................................

8-22

Program Interface Structure......................................................................................................

8-23

Program Interface Drivers.........................................................................................................

8-23

Communications Software for the Operating System...........................................................

8-24

9 Database Resource Management

Introduction to the Database Resource Manager .........................................................................

9-2

Database Resource Manager Overview ....................................................................................

9-3

Example of a Simple Resource Plan...........................................................................................

9-4

How the Database Resource Manager Works ...............................................................................

9-5

Resource Control...........................................................................................................................

9-5

Example of Resource Control ..............................................................................................

9-5

Effectiveness of the Database Resource Manager.............................................................

9-6

Database Integration ....................................................................................................................

9-6

Performance Overhead ................................................................................................................

9-7

Resource Plans and Resource Consumer Groups.........................................................................

9-7

Activation of a Resource Plan .....................................................................................................

9-8

Persistent.................................................................................................................................

9-8

Dynamic ..................................................................................................................................

9-8

Groups of Resource Plans............................................................................................................

9-9

Resource Allocation Methods and Resource Plan Directives ..................................................

9-11

Resource Plan Directives ...........................................................................................................

9-11

xii

CPU Method.........................................................................................................................

9-12

Active Session Pool with Queuing....................................................................................

9-12

Degree of Parallelism Limit ...............................................................................................

9-12

Automatic Consumer Group Switching ..........................................................................

9-12

Execution Time Limit..........................................................................................................

9-13

Undo Pool.............................................................................................................................

9-13

CPU Resource Allocation ..........................................................................................................

9-13

CPU Allocation Rules .........................................................................................................

9-15

Levels and Priorities............................................................................................................

9-16

Interaction with Operating-System Resource Control..............................................................

9-17

Dynamic Reconfiguration .........................................................................................................

9-18

Part IV Data

 

10 Schema Objects

 

Introduction to Schema Objects ....................................................................................................

10-2

Tables...................................................................................................................................................

10-5

How Table Data Is Stored..........................................................................................................

10-6

Row Format and Size..........................................................................................................

10-6

Rowids of Row Pieces.........................................................................................................

10-9

Column Order......................................................................................................................

10-9

Nulls Indicate Absence of Value ............................................................................................

10-10

Default Values for Columns....................................................................................................

10-10

Default Value Insertion and Integrity Constraint Checking.......................................

10-11

Partitioned Tables.....................................................................................................................

10-12

Nested Tables ............................................................................................................................

10-13

Temporary Tables.....................................................................................................................

10-13

Segment Allocation ...........................................................................................................

10-14

Parent and Child Transactions ........................................................................................

10-14

External Tables..........................................................................................................................

10-14

The Access Driver..............................................................................................................

10-15

Data Loading with External Tables ................................................................................

10-15

Parallel Access to External Tables...................................................................................

10-16

Views.................................................................................................................................................

10-16

How Views are Stored .............................................................................................................

10-17

xiii

How Views Are Used...............................................................................................................

10-18

Mechanics of Views ..................................................................................................................

10-19

Globalization Support Parameters in Views .................................................................

10-19

Use of Indexes Against Views .........................................................................................

10-19

Dependencies and Views.........................................................................................................

10-20

Updatable Join Views...............................................................................................................

10-20

Object Views ..............................................................................................................................

10-21

Inline Views ...............................................................................................................................

10-21

Materialized Views.........................................................................................................................

10-22

Define Constraints on Views...................................................................................................

10-23

Refresh Materialized Views ....................................................................................................

10-24

Materialized View Logs ...........................................................................................................

10-24

Dimensions ......................................................................................................................................

10-25

The Sequence Generator ...............................................................................................................

10-25

Synonyms .........................................................................................................................................

10-27

Indexes ..............................................................................................................................................

10-28

Unique and Nonunique Indexes ............................................................................................

10-30

Composite Indexes ...................................................................................................................

10-30

Indexes and Keys ......................................................................................................................

10-31

Indexes and Nulls .....................................................................................................................

10-31

Function-Based Indexes ...........................................................................................................

10-32

Uses of Function-Based Indexes......................................................................................

10-32

Optimization with Function-Based Indexes ..................................................................

10-33

Dependencies of Function-Based Indexes .....................................................................

10-33

How Indexes Are Stored..........................................................................................................

10-34

Format of Index Blocks .....................................................................................................

10-34

The Internal Structure of Indexes....................................................................................

10-35

Index Properties.................................................................................................................

10-36

Advantages of B-tree Structure .......................................................................................

10-37

How Indexes Are Searched .....................................................................................................

10-38

Index Unique Scan.............................................................................................................

10-38

Index Range Scan...............................................................................................................

10-40

Index Range Scan Descending.........................................................................................

10-43

Key Compression......................................................................................................................

10-45

Prefix and Suffix Entries...................................................................................................

10-45

xiv

Performance and Storage Considerations .....................................................................

10-46

Uses of Key Compression ................................................................................................

10-46

Reverse Key Indexes ................................................................................................................

10-47

Bitmap Indexes..........................................................................................................................

10-48

Benefits for Data Warehousing Applications................................................................

10-48

Cardinality..........................................................................................................................

10-49

Bitmap Index Example .....................................................................................................

10-50

Bitmap Indexes and Nulls................................................................................................

10-52

Bitmap Indexes on Partitioned Tables............................................................................

10-53

Bitmap Join Indexes..................................................................................................................

10-53

Four Join Models ...............................................................................................................

10-53

Creation of a Bitmap Join Index ......................................................................................

10-56

Index-Organized Tables ................................................................................................................

10-57

Benefits of Index-Organized Tables.......................................................................................

10-58

Index-Organized Tables with Row Overflow Area.............................................................

10-59

Secondary Indexes on Index-Organized Tables...................................................................

10-60

Bitmap Indexes on Index-Organized Tables ........................................................................

10-61

Mapping Table...................................................................................................................

10-61

Partitioned Index-Organized Tables......................................................................................

10-62

B-tree Indexes on UROWID Columns for Heapand Index-Organized Tables .............

10-62

Index-Organized Table Applications ....................................................................................

10-62

Application Domain Indexes .......................................................................................................

10-62

Clusters .............................................................................................................................................

10-63

Hash Clusters...................................................................................................................................

10-65

11 Partitioned Tables and Indexes

Introduction to Partitioning............................................................................................................

11-2

Partition Key................................................................................................................................

11-4

Partitioned Tables.......................................................................................................................

11-4

Partitioned Index-Organized Tables........................................................................................

11-5

Partitioning Methods .......................................................................................................................

11-5

Range Partitioning......................................................................................................................

11-7

Range Partitioning Example ..............................................................................................

11-8

List Partitioning ..........................................................................................................................

11-8

List Partitioning Example...................................................................................................

11-8

xv

Hash Partitioning........................................................................................................................

11-9

Hash Partitioning Example ..............................................................................................

11-10

Composite Partitioning............................................................................................................

11-10

Composite Partitioning Range-Hash Example .............................................................

11-11

Composite Partitioning Range-List Example ................................................................

11-12

When to Partition a Table ........................................................................................................

11-13

Partitioned Indexes.........................................................................................................................

11-13

Local Partitioned Indexes ........................................................................................................

11-14

Global Partitioned Indexes ......................................................................................................

11-15

Maintenance of Global Partitioned Indexes ..................................................................

11-16

Global Nonpartitioned Indexes ..............................................................................................

11-17

Partitioned Index Examples ....................................................................................................

11-18

Example of Index Creation: Starting Table Used for Examples .................................

11-18

Example of a Local Index Creation .................................................................................

11-18

Example of a Global Index Creation...............................................................................

11-18

Example of a Global Partitioned Index Creation ..........................................................

11-18

Example of a Partitioned Index-Organized Table Creation........................................

11-19

Miscellaneous Information about Creating Indexes on Partitioned Tables.....................

11-19

Using Partitioned Indexes in OLTP Applications................................................................

11-19

Using Partitioned Indexes in Data Warehousing and DSS Applications.........................

11-19

Partitioned Indexes on Composite Partitions.......................................................................

11-20

Partitioning to Improve Performance .........................................................................................

11-20

Partition Pruning ......................................................................................................................

11-20

Partition Pruning Example...............................................................................................

11-21

Partition-wise Joins...................................................................................................................

11-21

Parallel DML..............................................................................................................................

11-22

12 Native Datatypes

Introduction to Oracle Datatypes ..................................................................................................

12-2

Character Datatypes .........................................................................................................................

12-3

CHAR Datatype ..........................................................................................................................

12-3

VARCHAR2 and VARCHAR Datatypes ................................................................................

12-4

VARCHAR Datatype ..........................................................................................................

12-4

Length Semantics for Character Datatypes.............................................................................

12-4

NCHAR and NVARCHAR2 Datatypes ..................................................................................

12-5

xvi

NCHAR.................................................................................................................................

12-6

NVARCHAR2......................................................................................................................

12-6

Use of Unicode Data in an Oracle Database...........................................................................

12-6

Implicit Type Conversion...................................................................................................

12-7

LOB Character Datatypes..........................................................................................................

12-7

LONG Datatype..........................................................................................................................

12-7

NUMBER Datatype ..........................................................................................................................

12-8

Internal Numeric Format...........................................................................................................

12-9

DATE Datatype ...............................................................................................................................

12-10

Use of Julian Dates ...................................................................................................................

12-11

Date Arithmetic.........................................................................................................................

12-11

Centuries and the Year 2000 ...................................................................................................

12-12

Daylight Savings Support .......................................................................................................

12-12

Time Zones ................................................................................................................................

12-12

Example: .............................................................................................................................

12-13

LOB Datatypes ................................................................................................................................

12-13

BLOB Datatype .........................................................................................................................

12-14

CLOB and NCLOB Datatypes ................................................................................................

12-15

BFILE Datatype.........................................................................................................................

12-15

RAW and LONG RAW Datatypes ...............................................................................................

12-15

ROWID and UROWID Datatypes...............................................................................................

12-16

The ROWID Pseudocolumn....................................................................................................

12-17

Physical Rowids........................................................................................................................

12-17

Extended Rowids...............................................................................................................

12-18

Restricted Rowids..............................................................................................................

12-19

Examples of Rowid Use....................................................................................................

12-19

How Rowids Are Used.....................................................................................................

12-21

Logical Rowids..........................................................................................................................

12-21

Comparison of Logical Rowids with Physical Rowids................................................

12-22

Guesses in Logical Rowids...............................................................................................

12-22

Rowids in Non-Oracle Databases ..........................................................................................

12-23

ANSI, DB2, and SQL/DS Datatypes ...........................................................................................

12-23

XML Datatypes................................................................................................................................

12-25

XMLType Datatype..................................................................................................................

12-25

URI Datatypes .................................................................................................................................

12-26

xvii

Data Conversion..............................................................................................................................

12-26

13 Object Datatypes and Object Views

Introduction to Object Datatypes ..................................................................................................

13-2

Complex Data Models................................................................................................................

13-2

Complex Data Model Example..........................................................................................

13-2

Multimedia Datatypes ...............................................................................................................

13-3

Object Datatype Categories ............................................................................................................

13-3

Object Types ................................................................................................................................

13-4

Purchase Order Example....................................................................................................

13-4

Types of Methods ................................................................................................................

13-5

Object Tables ........................................................................................................................

13-8

Object Identifiers..................................................................................................................

13-9

Object Views Description ...................................................................................................

13-9

REFs .......................................................................................................................................

13-9

Collection Types........................................................................................................................

13-11

VARRAYs ...........................................................................................................................

13-11

Nested Tables Description ...............................................................................................

13-12

Type Inheritance..............................................................................................................................

13-13

FINAL and NOT FINAL Types..............................................................................................

13-13

Example of Creating a NOT FINAL Object Type .........................................................

13-14

NOT INSTANTIABLE Types and Methods .........................................................................

13-14

User-Defined Aggregate Functions.............................................................................................

13-15

Why Have User-Defined Aggregate Functions?..................................................................

13-15

Creation and Use of UDAGs...................................................................................................

13-15

How Do Aggregate Functions Work? ...................................................................................

13-16

Application Interfaces....................................................................................................................

13-17

SQL..............................................................................................................................................

13-17

PL/SQL ......................................................................................................................................

13-18

Pro*C/C++.................................................................................................................................

13-18

Dynamic Creation and Access of Type Descriptions ...................................................

13-19

OCI ..............................................................................................................................................

13-20

OTT .............................................................................................................................................

13-20

JPublisher ...................................................................................................................................

13-21

JDBC............................................................................................................................................

13-21

xviii

SQLJ ............................................................................................................................................

13-21

SQLJ Object Types.............................................................................................................

13-21

Datatype Evolution.........................................................................................................................

13-22

Introduction to Object Views .......................................................................................................

13-23

Advantages of Object Views ...................................................................................................

13-23

How Object Views Are Defined .............................................................................................

13-24

Use of Object Views..................................................................................................................

13-25

Updates of Object Views .........................................................................................................

13-26

Updates of Nested Table Columns in Views........................................................................

13-26

View Hierarchies ......................................................................................................................

13-27

Part V Data Access

 

14 SQL, PL/SQL, and Java

 

SQL Overview ...................................................................................................................................

14-2

SQL Statements ...........................................................................................................................

14-2

Data Manipulation Language Statements .......................................................................

14-3

Data Definition Language Statements..............................................................................

14-4

Transaction Control Statements ........................................................................................

14-5

Session Control Statements................................................................................................

14-5

System Control Statements ................................................................................................

14-5

Embedded SQL Statements ...............................................................................................

14-5

Identification of Nonstandard SQL .........................................................................................

14-6

Recursive SQL .............................................................................................................................

14-6

Cursors .........................................................................................................................................

14-6

Scrollable Cursors................................................................................................................

14-7

Shared SQL ..................................................................................................................................

14-7

Parsing..........................................................................................................................................

14-7

SQL Processing ...........................................................................................................................

14-8

SQL Statement Execution...................................................................................................

14-8

DML Statement Processing..............................................................................................

14-10

DDL Statement Processing...............................................................................................

14-14

Control of Transactions ....................................................................................................

14-14

The Optimizer Overview.........................................................................................................

14-14

Execution Plans..................................................................................................................

14-15

xix

PL/SQL Overview ...........................................................................................................................

14-16

How PL/SQL Runs ..................................................................................................................

14-17

Native Execution................................................................................................................

14-17

Interpreted Execution .......................................................................................................

14-17

Language Constructs for PL/SQL..........................................................................................

14-19

Variables and Constants ...................................................................................................

14-19

Cursors ................................................................................................................................

14-19

Exceptions...........................................................................................................................

14-20

Dynamic SQL in PL/SQL.................................................................................................

14-20

PL/SQL Program Units ...........................................................................................................

14-21

Stored Procedures and Functions ...................................................................................

14-21

PL/SQL Packages..............................................................................................................

14-27

PL/SQL Collections and Records...........................................................................................

14-30

Collections ..........................................................................................................................

14-30

Records................................................................................................................................

14-30

PL/SQL Server Pages...............................................................................................................

14-30

Java Overview..................................................................................................................................

14-31

Java and Object-Oriented Programming Terminology.......................................................

14-32

Classes .................................................................................................................................

14-32

Class Hierarchy.........................................................................................................................

14-34

Interfaces ....................................................................................................................................

14-35

Polymorphism...........................................................................................................................

14-36

The Java Virtual Machine (JVM).............................................................................................

14-37

Why Use Java in Oracle?..........................................................................................................

14-39

Multithreading...................................................................................................................

14-40

Automated Storage Management ...................................................................................

14-41

Footprint .............................................................................................................................

14-41

Performance........................................................................................................................

14-42

Dynamic Class Loading....................................................................................................

14-43

Oracle’s Java Application Strategy.........................................................................................

14-44

Java Stored Procedures .....................................................................................................

14-45

PL/SQL Integration and Oracle RDBMS Functionality ..............................................

14-45

15 Dependencies Among Schema Objects

Introduction to Dependency Issues ..............................................................................................

15-2

xx

Resolution of Schema Object Dependencies ..............................................................................

15-4

Compilation of Views and PL/SQL Program Units .............................................................

15-5

Views and Base Tables........................................................................................................

15-5

Program Units and Referenced Objects ...........................................................................

15-6

Data Warehousing Considerations...................................................................................

15-7

Session State and Referenced Packages ...........................................................................

15-7

Security Authorizations......................................................................................................

15-7

Function-Based Index Dependencies.......................................................................................

15-8

Requirements .......................................................................................................................

15-8

DETERMINISTIC Functions..............................................................................................

15-8

Privileges on the Defining Function .................................................................................

15-8

Resolve Dependencies of Function-Based Indexes ........................................................

15-9

Object Name Resolution .................................................................................................................

15-9

Shared SQL Dependency Management .....................................................................................

15-10

Local and Remote Dependency Management...........................................................................

15-10

Management of Local Dependencies.....................................................................................

15-10

Management of Remote Dependencies.................................................................................

15-11

Dependencies Among Local and Remote Database Procedures................................

15-11

Dependencies Among Other Remote Schema Objects ................................................

15-13

Dependencies of Applications.........................................................................................

15-13

16 Transaction Management

Introduction to Transactions...........................................................................................................

16-2

Statement Execution and Transaction Control.......................................................................

16-3

Statement-Level Rollback..........................................................................................................

16-4

Resumable Space Allocation .....................................................................................................

16-5

Transaction Management Overview .............................................................................................

16-5

Commit Transactions .................................................................................................................

16-6

Rollback of Transactions............................................................................................................

16-7

Savepoints In Transactions........................................................................................................

16-8

Transaction Naming...................................................................................................................

16-9

How Transactions Are Named..........................................................................................

16-9

Commit Comment...............................................................................................................

16-9

The Two-Phase Commit Mechanism.....................................................................................

16-10

Discrete Transaction Management ..............................................................................................

16-11

xxi

Autonomous Transactions.............................................................................................................

16-12

Autonomous PL/SQL Blocks .................................................................................................

16-12

Transaction Control Statements in Autonomous Blocks ....................................................

16-13

17 Triggers

Introduction to Triggers...................................................................................................................

17-2

How Triggers Are Used.............................................................................................................

17-4

Some Cautionary Notes about Triggers...........................................................................

17-4

Triggers Compared with Declarative Integrity Constraints .........................................

17-5

Parts of a Trigger ...............................................................................................................................

17-6

The Triggering Event or Statement ..........................................................................................

17-7

Trigger Restriction ......................................................................................................................

17-8

Trigger Action .............................................................................................................................

17-8

Types of Triggers ...............................................................................................................................

17-9

Row Triggers and Statement Triggers.....................................................................................

17-9

Row Triggers ........................................................................................................................

17-9

Statement Triggers ..............................................................................................................

17-9

BEFORE and AFTER Triggers ................................................................................................

17-10

BEFORE Triggers ..............................................................................................................

17-10

AFTER Triggers ................................................................................................................

17-10

Trigger Type Combinations .............................................................................................

17-11

INSTEAD OF Triggers .............................................................................................................

17-12

Modify Views.....................................................................................................................

17-12

Views That Are Not Modifiable ......................................................................................

17-13

INSTEAD OF Triggers on Nested Tables ......................................................................

17-13

Triggers on System Events and User Events ........................................................................

17-14

Event Publication...............................................................................................................

17-14

Event Attributes.................................................................................................................

17-15

System Events ....................................................................................................................

17-15

User Events.........................................................................................................................

17-15

Trigger Execution ............................................................................................................................

17-17

The Execution Model for Triggers and Integrity Constraint Checking............................

17-18

Data Access for Triggers ..........................................................................................................

17-20

Storage of PL/SQL Triggers....................................................................................................

17-21

Execution of Triggers ...............................................................................................................

17-21

xxii

Dependency Maintenance for Triggers.................................................................................

17-21

Part VI Parallel SQL and Direct-Load INSERT

 

18 Parallel Execution of SQL Statements

 

Introduction to Parallel Execution.................................................................................................

18-2

When to Implement Parallel Execution...................................................................................

18-2

When Not to Implement Parallel Execution...........................................................................

18-3

How Parallel Execution Works.......................................................................................................

18-4

Parallelized SQL Statements .....................................................................................................

18-5

Parallelism Between Operations .......................................................................................

18-6

Degree of Parallelism .................................................................................................................

18-8

Parallel Query Intraand Inter-Operation Example .............................................................

18-9

SQL Operations That Can Be Parallelized ................................................................................

18-12

Parallel Query ...........................................................................................................................

18-12

Parallel DDL ..............................................................................................................................

18-12

DDL Statements that can be Parallelized.......................................................................

18-12

Parallel DML .............................................................................................................................

18-13

SQL*Loader ...............................................................................................................................

18-13

How to Make a Statement Run in Parallel............................................................................

18-14

Parallel Query ....................................................................................................................

18-14

Parallel DDL.......................................................................................................................

18-14

Parallel DML ......................................................................................................................

18-14

19 Direct-Path INSERT

 

Introduction to Direct-Path INSERT.............................................................................................

19-2

Advantages of Direct-Path INSERT..............................................................................................

19-2

Serial and Parallel Direct-Path INSERT.......................................................................................

19-3

Direct-Path INSERT Into Partitioned and Nonpartitioned Tables .........................................

19-4

Serial Direct-Path INSERT into Partitioned and Nonpartitioned Tables...........................

19-4

Parallel Direct-Path INSERT into Partitioned Tables............................................................

19-4

Parallel Direct-Path INSERT into Nonpartitioned Tables ....................................................

19-4

Direct-Path INSERT and Logging Mode......................................................................................

19-4

Direct-Path INSERT with Logging...........................................................................................

19-5

xxiii

Direct-Path INSERT without Logging.....................................................................................

19-5

Additional Considerations for Direct-Path INSERT .................................................................

19-5

Index Maintenance with Direct-Path INSERT........................................................................

19-5

Space Considerations with Direct-Path INSERT....................................................................

19-6

Locking Considerations with Direct-Path INSERT ...............................................................

19-6

Part VII Data Protection

 

20 Data Concurrency and Consistency

 

Introduction to Data Concurrency and Consistency in a Multiuser Environment..............

20-2

Preventable Phenomena and Transaction Isolation Levels..................................................

20-2

Overview of Locking Mechanisms...........................................................................................

20-3

How Oracle Manages Data Concurrency and Consistency ......................................................

20-4

Multiversion Concurrency Control..........................................................................................

20-4

Statement-Level Read Consistency ..........................................................................................

20-5

Transaction-Level Read Consistency.......................................................................................

20-6

Read Consistency with Real Application Clusters ................................................................

20-6

Oracle Isolation Levels...............................................................................................................

20-7

Set the Isolation Level .........................................................................................................

20-7

Read Committed Isolation .................................................................................................

20-8

Serializable Isolation ...........................................................................................................

20-8

Comparison of Read Committed and Serializable Isolation ..............................................

20-10

Transaction Set Consistency ............................................................................................

20-10

Row-Level Locking............................................................................................................

20-11

Referential Integrity ..........................................................................................................

20-12

Distributed Transactions ..................................................................................................

20-12

Choice of Isolation Level .........................................................................................................

20-13

Read Committed Isolation ...............................................................................................

20-13

Serializable Isolation .........................................................................................................

20-14

Quiesce Database...............................................................................................................

20-15

How Oracle Locks Data .................................................................................................................

20-17

Transactions and Data Concurrency......................................................................................

20-17

Modes of Locking ..............................................................................................................

20-18

Lock Duration ....................................................................................................................

20-18

Data Lock Conversion Versus Lock Escalation.............................................................

20-18

xxiv

Deadlocks...................................................................................................................................

20-19

Deadlock Detection ...........................................................................................................

20-20

Avoid Deadlocks ...............................................................................................................

20-21

Types of Locks...........................................................................................................................

20-21

DML Locks ................................................................................................................................

20-22

Row Locks (TX)..................................................................................................................

20-22

Table Locks (TM)...............................................................................................................

20-23

DML Locks Automatically Acquired for DML Statements ........................................

20-27

DDL Locks .................................................................................................................................

20-30

Exclusive DDL Locks ........................................................................................................

20-30

Share DDL Locks...............................................................................................................

20-30

Breakable Parse Locks ......................................................................................................

20-31

Duration of DDL Locks ....................................................................................................

20-31

DDL Locks and Clusters...................................................................................................

20-31

Latches and Internal Locks......................................................................................................

20-31

Latches ................................................................................................................................

20-31

Internal Locks.....................................................................................................................

20-32

Explicit (Manual) Data Locking .............................................................................................

20-32

Examples of Concurrency under Explicit Locking.......................................................

20-33

Oracle Lock Management Services ........................................................................................

20-41

Flashback Query .............................................................................................................................

20-41

Flashback Query Benefits ........................................................................................................

20-42

Some Uses of Flashback Query...............................................................................................

20-43

Self-Service Repair.............................................................................................................

20-43

E-Mail or Voice Mail Applications .................................................................................

20-44

Account Balances...............................................................................................................

20-44

Packaged Applications .....................................................................................................

20-44

21 Data Integrity

Introduction to Data Integrity........................................................................................................

21-2

Types of Data Integrity ..............................................................................................................

21-3

Null Rule...............................................................................................................................

21-3

Unique Column Values ......................................................................................................

21-3

Primary Key Values ............................................................................................................

21-3

Referential Integrity Rules .................................................................................................

21-3

xxv

Complex Integrity Checking..............................................................................................

21-4

How Oracle Enforces Data Integrity........................................................................................

21-4

Integrity Constraints Description......................................................................................

21-4

Database Triggers ................................................................................................................

21-5

Introduction to Integrity Constraints............................................................................................

21-5

Advantages of Integrity Constraints........................................................................................

21-5

Declarative Ease...................................................................................................................

21-6

Centralized Rules.................................................................................................................

21-6

Maximum Application Development Productivity .......................................................

21-6

Immediate User Feedback..................................................................................................

21-6

Superior Performance .........................................................................................................

21-6

Flexibility for Data Loads and Identification of Integrity Violations...........................

21-7

The Performance Cost of Integrity Constraints......................................................................

21-7

Types of Integrity Constraints........................................................................................................

21-7

NOT NULL Integrity Constraints ............................................................................................

21-7

UNIQUE Key Integrity Constraints.........................................................................................

21-8

Unique Keys .........................................................................................................................

21-9

UNIQUE Key Constraints and Indexes..........................................................................

21-10

Combine UNIQUE Key and NOT NULL Integrity Constraints.................................

21-11

PRIMARY KEY Integrity Constraints....................................................................................

21-11

Primary Keys......................................................................................................................

21-12

PRIMARY KEY Constraints and Indexes ......................................................................

21-12

Referential Integrity Constraints ............................................................................................

21-13

Self-Referential Integrity Constraints .............................................................................

21-14

Nulls and Foreign Keys ....................................................................................................

21-15

Actions Defined by Referential Integrity Constraints..................................................

21-16

Concurrency Control, Indexes, and Foreign Keys........................................................

21-17

CHECK Integrity Constraints .................................................................................................

21-20

The Check Condition ........................................................................................................

21-21

Multiple CHECK Constraints ..........................................................................................

21-21

The Mechanisms of Constraint Checking..................................................................................

21-21

Default Column Values and Integrity Constraint Checking..............................................

21-24

Deferred Constraint Checking .....................................................................................................

21-24

Constraint Attributes................................................................................................................

21-24

SET CONSTRAINTS Mode .....................................................................................................

21-25

xxvi

Unique Constraints and Indexes ............................................................................................

21-26

Constraint States .............................................................................................................................

21-26

Constraint State Modification.................................................................................................

21-27

22 Controlling Database Access

Introduction to Database Security.................................................................................................

22-2

Schemas, Database Users, and Security Domains......................................................................

22-2

User Authentication .........................................................................................................................

22-3

Authentication by the Operating System................................................................................

22-4

Authentication by the Network................................................................................................

22-4

Third Party-Based Authentication Technologies............................................................

22-4

Public Key Infrastructure-Based Authentication............................................................

22-5

Remote Authentication.......................................................................................................

22-7

Authentication by the Oracle Database...................................................................................

22-8

Password Encryption While Connecting.........................................................................

22-8

Account Locking..................................................................................................................

22-8

Password Lifetime and Expiration ...................................................................................

22-9

Password History ................................................................................................................

22-9

Password Complexity Verification...................................................................................

22-9

Multitier Authentication and Authorization........................................................................

22-10

Clients, Application Servers, and Database Servers ....................................................

22-10

Security Issues for Middle-Tier Applications ...............................................................

22-12

Identity Issues in a Multitier Environment ...................................................................

22-12

Restricted Privileges in a Multitier Environment.........................................................

22-12

Authentication by the Secure Socket Layer Protocol ..........................................................

22-12

Authentication of Database Administrators.........................................................................

22-13

Oracle Internet Directory ..............................................................................................................

22-14

User Tablespace Settings and Quotas.........................................................................................

22-14

Default Tablespace Option......................................................................................................

22-15

Temporary Tablespace Option ...............................................................................................

22-15

Tablespace Access and Quotas ...............................................................................................

22-15

The User Group PUBLIC...............................................................................................................

22-16

User Resource Limits and Profiles ..............................................................................................

22-17

Types of System Resources and Limits .................................................................................

22-17

CPU Time ...........................................................................................................................

22-18

xxvii

Logical Reads .....................................................................................................................

22-18

Other Resources.................................................................................................................

22-19

Profiles........................................................................................................................................

22-20

When to Use Profiles.........................................................................................................

22-20

Determine Values for Resource Limits of a Profile ......................................................

22-20

23 Privileges, Roles, and Security Policies

Introduction to Privileges................................................................................................................

23-2

System Privileges ........................................................................................................................

23-2

Grant and Revoke System Privileges................................................................................

23-3

Who Can Grant or Revoke System Privileges? ...............................................................

23-3

Schema Object Privileges...........................................................................................................

23-3

Grant and Revoke Schema Object Privileges ..................................................................

23-4

Who Can Grant Schema Object Privileges?.....................................................................

23-4

Table Security ..............................................................................................................................

23-5

Data Manipulation Language Operations .......................................................................

23-5

Data Definition Language Operations .............................................................................

23-6

View Security...............................................................................................................................

23-6

Privileges Required to Create Views ................................................................................

23-6

Increase Table Security with Views ..................................................................................

23-7

Procedure Security......................................................................................................................

23-8

Procedure Execution and Security Domains ...................................................................

23-8

System Privileges Needed to Create or Alter a Procedure..........................................

23-10

Packages and Package Objects.........................................................................................

23-10

Type Security.............................................................................................................................

23-12

System Privileges for Named Types...............................................................................

23-12

Object Privileges ................................................................................................................

23-12

Method Execution Model .................................................................................................

23-13

Privileges Required to Create Types and Tables Using Types ...................................

23-13

Privileges Required to Create Types and Tables Using Types Example...................

23-14

Privileges on Type Access and Object Access ...............................................................

23-15

Type Dependencies ...........................................................................................................

23-16

Introduction to Roles......................................................................................................................

23-17

Common Uses for Roles...........................................................................................................

23-18

Application Roles ..............................................................................................................

23-19

xxviii

User Roles...........................................................................................................................

23-19

The Mechanisms of Roles ........................................................................................................

23-19

Grant and Revoke Roles ..........................................................................................................

23-20

Who Can Grant or Revoke Roles?..........................................................................................

23-20

Role Names................................................................................................................................

23-21

Security Domains of Roles and Users....................................................................................

23-21

PL/SQL Blocks and Roles .......................................................................................................

23-21

Named Blocks with Definer Rights ................................................................................

23-21

Anonymous Blocks with Invoker Rights .......................................................................

23-21

Data Definition Language Statements and Roles ................................................................

23-22

Predefined Roles .......................................................................................................................

23-23

The Operating System and Roles ...........................................................................................

23-23

Roles in a Distributed Environment ......................................................................................

23-24

Fine-Grained Access Control........................................................................................................

23-24

Dynamic Predicates..................................................................................................................

23-25

Application Context .......................................................................................................................

23-25

Secure Application Roles ..............................................................................................................

23-26

Creation of Secure Application Roles....................................................................................

23-26

24 Auditing

Introduction to Auditing.................................................................................................................

24-2

Features of Auditing ..................................................................................................................

24-2

Types of Auditing................................................................................................................

24-2

Focus of Auditing................................................................................................................

24-3

Audit Records and the Audit Trail ...................................................................................

24-3

Mechanisms for Auditing..........................................................................................................

24-4

When Are Audit Records Generated?..............................................................................

24-4

Events Always Audited to the Operating System Audit Trail.....................................

24-5

When Do Audit Options Take Effect?..............................................................................

24-6

Audit in a Distributed Database .......................................................................................

24-6

Audit to the Operating System Audit Trail.....................................................................

24-6

Statement Auditing ..........................................................................................................................

24-7

Privilege Auditing ............................................................................................................................

24-7

Schema Object Auditing .................................................................................................................

24-8

Schema Object Audit Options for Views and Procedures....................................................

24-8

xxix

Fine-Grained Auditing ....................................................................................................................

24-9

Focus Statement, Privilege, and Schema Object Auditing .....................................................

24-10

Successful and Unsuccessful Statement Executions Auditing...........................................

24-10

BY SESSION and BY ACCESS Clauses of Audit Statement...............................................

24-11

BY SESSION .......................................................................................................................

24-11

BY ACCESS.........................................................................................................................

24-12

Defaults and Excluded Operations .................................................................................

24-12

Audit By User............................................................................................................................

24-13

Audit in a Multitier Environment ...............................................................................................

24-13

A Operating System Specific Information

 

B Information on Deprecated Features

 

Allocating Extents in Dictionary Managed Tablespaces.............................................................

B-2

Introduction to Rollback Segments.................................................................................................

B-3

Contents of a Rollback Segment..........................................................................................

B-4

How Rollback Entries Are Logged .....................................................................................

B-4

When Rollback Information Is Required ...........................................................................

B-5

Transactions and Rollback Segments .................................................................................

B-5

How Extents Are Deallocated from a Rollback Segment ................................................

B-9

The Rollback Segment SYSTEM ........................................................................................

B-10

Oracle Instances and Types of Rollback Segments.........................................................

B-10

Rollback Segment States .....................................................................................................

B-12

Deferred Rollback Segments..............................................................................................

B-14

High Water Mark.................................................................................................................

B-15

PCTFREE, PCTUSED, and Row Chaining...................................................................................

B-15

Glossary

Index

xxx

Соседние файлы в папке Oracle selected docs