Tài liệu Oracle Database Concepts - Pdf 90

Oracle® Database
Concepts
10g Release 1 (10.1)
Part No. B10743-01
December 2003
Oracle Database Concepts, 10g Release 1 (10.1)
Part No. B10743-01
Copyright © 1993, 2003 Oracle Corporation. All rights reserved.
Primary Author: Michele Cyran
Contributing Author: Paul Lane
Contributors: Omar Alonso, Penny Avril, Hermann Baer, Sandeepan Banerjee, Mark Bauer, Ruth
Baylis, Bill Bridge, Sandra Cheevers, Carol Colrain, Vira Goorah, Mike Hartstein, John Haydu, Wei Hu,
Ramkumar Krishnan, Vasudha Krishnaswamy, Bill Lee, Bryn Llewellyn, Phil Locke, Rich Long, Diana
Lorentz, Paul Manning, Krishna Mohan, Valarie Moore, Mughees Minhas, Tony Morales, Gopal
Mulagund, Muthu Olagappan, Kathy Rich, John Russell, Vivian Schupmann, Bob Thome, Randy
Urbano, Michael Verheij, Ron Weiss, Steve Wertheimer, Ramana Yerneni
The Programs (which include both the software and documentation) contain proprietary information of
Oracle Corporation; they are provided under a license agreement containing restrictions on use and
disclosure and are also protected by copyright, patent and other intellectual and industrial property
laws. Reverse engineering, disassembly or decompilation of the Programs, except to the extent required
to obtain interoperability with other independently created software or as specified by law, is prohibited.
The information contained in this document is subject to change without notice. If you find any problems
in the documentation, please report them to us in writing. Oracle Corporation does not warrant that this
document is error-free. Except as may be expressly permitted in your license agreement for these
Programs, no part of these Programs may be reproduced or transmitted in any form or by any means,
electronic or mechanical, for any purpose, without the express written permission of Oracle Corporation.
If the Programs are delivered to the U.S. Government or anyone licensing or using the programs on
behalf of the U.S. Government, the following notice is applicable:
Restricted Rights Notice Programs delivered subject to the DOD FAR Supplement are "commercial
computer software" and use, duplication, and disclosure of the Programs, including documentation,
shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement.

Client/Server Architecture .................................................................................................. 1-7
Multitier Architecture: Application Servers...................................................................... 1-8
Overview of Physical Database Structures............................................................................... 1-8
Datafiles ................................................................................................................................. 1-8
Control Files ........................................................................................................................... 1-9
Redo Log Files........................................................................................................................ 1-9
Archive Log Files................................................................................................................. 1-10
iv
Parameter Files..................................................................................................................... 1-10
Alert and Trace Log Files.................................................................................................... 1-10
Backup Files.......................................................................................................................... 1-11
Overview of Logical Database Structures............................................................................... 1-11
Tablespaces........................................................................................................................... 1-11
Oracle Data Blocks............................................................................................................... 1-12
Extents................................................................................................................................... 1-12
Segments ............................................................................................................................... 1-12
Overview of Schemas and Common Schema Objects........................................................... 1-14
Tables..................................................................................................................................... 1-14
Indexes ................................................................................................................................. 1-14
Views ..................................................................................................................................... 1-14
Clusters ................................................................................................................................. 1-15
Synonyms ............................................................................................................................. 1-15
Overview of the Oracle Data Dictionary................................................................................. 1-15
Overview of the Oracle Instance .............................................................................................. 1-16
Real Application Clusters: Multiple Instance Systems .................................................. 1-16
Instance Memory Structures ............................................................................................. 1-16
System Global Area............................................................................................................. 1-16
Program Global Area .......................................................................................................... 1-17
Oracle Background Processes............................................................................................ 1-18
Process Architecture............................................................................................................ 1-18

Table Compression.............................................................................................................. 1-33
Parallel Execution................................................................................................................ 1-33
Analytic SQL ........................................................................................................................ 1-33
OLAP Capabilities............................................................................................................... 1-33
Data Mining.......................................................................................................................... 1-34
Partitioning........................................................................................................................... 1-34
Overview of Content Management Features ......................................................................... 1-35
XML in Oracle...................................................................................................................... 1-35
LOBs ...................................................................................................................................... 1-35
Oracle Text ........................................................................................................................... 1-35
Oracle Ultra Search ............................................................................................................ 1-35
Oracle interMedia ................................................................................................................ 1-36
Oracle Spatial ....................................................................................................................... 1-36
Overview of Security Features ................................................................................................. 1-36
Security Mechanisms ......................................................................................................... 1-37
Overview of Data Integrity and Triggers................................................................................ 1-37
Integrity Constraints ........................................................................................................... 1-38
Keys ...................................................................................................................................... 1-38
Triggers ................................................................................................................................ 1-39
vi
Overview of Information Integration Features ...................................................................... 1-39
Distributed SQL .................................................................................................................. 1-39
Oracle Streams .................................................................................................................... 1-40
Oracle Transparent Gateways and Generic Connectivity ............................................. 1-42
Oracle Database Application Development ............................................................................... 1-42
Overview of Oracle SQL............................................................................................................ 1-43
SQL Statements.................................................................................................................... 1-43
Overview of PL/SQL ................................................................................................................. 1-44
PL/SQL Program Units...................................................................................................... 1-45
Overview of Java......................................................................................................................... 1-45

Extents in Clustered Tables................................................................................................ 2-14
Extents in Materialized Views and Their Logs ............................................................... 2-14
Extents in Indexes................................................................................................................ 2-15
Extents in Temporary Segments ....................................................................................... 2-15
Extents in Rollback Segments............................................................................................ 2-15
Overview of Segments..................................................................................................................... 2-15
Introduction to Data Segments ................................................................................................ 2-16
Introduction to Index Segments .............................................................................................. 2-17
Introduction to Temporary Segments .................................................................................... 2-17
Operations that Require Temporary Segments ............................................................. 2-17
Segments in Temporary Tables and Their Indexes ....................................................... 2-18
How Temporary Segments Are Allocated ..................................................................... 2-18
Introduction to Automatic Undo Management..................................................................... 2-19
Undo Mode........................................................................................................................... 2-20
Undo Quota.......................................................................................................................... 2-21
Automatic Undo Retention................................................................................................ 2-21
External Views ..................................................................................................................... 2-21
3 Tablespaces, Datafiles, and Control Files
Introduction to Tablespaces, Datafiles, and Control Files.......................................................... 3-1
Oracle-Managed Files .................................................................................................................. 3-3
Allocate More Space for a Database .......................................................................................... 3-3
Overview of Tablespaces................................................................................................................... 3-6
Bigfile Tablespaces ....................................................................................................................... 3-7
Benefits of Bigfile Tablespaces............................................................................................. 3-8
Considerations with Bigfile Tablespaces ........................................................................... 3-8
The SYSTEM Tablespace ............................................................................................................ 3-9
The Data Dictionary.............................................................................................................. 3-9
PL/SQL Program Units Description .................................................................................. 3-9
viii
The SYSAUX Tablespace ........................................................................................................... 3-10

Statement Execution and Transaction Control ........................................................................ 4-2
Statement-Level Rollback ........................................................................................................... 4-3
Resumable Space Allocation ....................................................................................................... 4-4
ix
Overview of Transaction Management .......................................................................................... 4-4
Commit Transactions .................................................................................................................. 4-5
Rollback of Transactions ............................................................................................................. 4-6
Savepoints In Transactions.......................................................................................................... 4-7
Transaction Naming..................................................................................................................... 4-8
How Transactions Are Named............................................................................................ 4-8
Commit Comment................................................................................................................. 4-8
The Two-Phase Commit Mechanism ........................................................................................ 4-9
Overview of Autonomous Transactions....................................................................................... 4-10
Autonomous PL/SQL Blocks .................................................................................................. 4-10
Transaction Control Statements in Autonomous Blocks .............................................. 4-11
5 Schema Objects
Introduction to Schema Objects ..................................................................................................... 5-1
Overview of Tables ............................................................................................................................ 5-4
How Table Data Is Stored ........................................................................................................... 5-5
Row Format and Size ........................................................................................................... 5-5
Rowids of Row Pieces .......................................................................................................... 5-7
Column Order ....................................................................................................................... 5-7
Table Compression....................................................................................................................... 5-8
Using Table Compression .................................................................................................... 5-8
Nulls Indicate Absence of Value ................................................................................................ 5-9
Default Values for Columns ..................................................................................................... 5-10
Default Value Insertion and Integrity Constraint Checking ........................................ 5-10
Partitioned Tables....................................................................................................................... 5-11
Nested Tables ............................................................................................................................. 5-12
Temporary Tables ...................................................................................................................... 5-12

Uses of Function-Based Indexes ....................................................................................... 5-32
Optimization with Function-Based Indexes ................................................................... 5-32
Dependencies of Function-Based Indexes ...................................................................... 5-33
How Indexes Are Stored ........................................................................................................... 5-34
Format of Index Blocks ....................................................................................................... 5-34
The Internal Structure of Indexes...................................................................................... 5-35
Index Properties................................................................................................................... 5-36
Advantages of B-tree Structure ......................................................................................... 5-36
Index Unique Scan...................................................................................................................... 5-37
Index Range Scan........................................................................................................................ 5-37
Key Compression ....................................................................................................................... 5-37
Prefix and Suffix Entries .................................................................................................... 5-37
Performance and Storage Considerations ....................................................................... 5-38
Uses of Key Compression .................................................................................................. 5-38
xi
Reverse Key Indexes ................................................................................................................. 5-39
Bitmap Indexes ........................................................................................................................... 5-40
Benefits for Data Warehousing Applications ................................................................. 5-40
Cardinality............................................................................................................................ 5-41
Bitmap Index Example ....................................................................................................... 5-42
Bitmap Indexes and Nulls ................................................................................................. 5-43
Bitmap Indexes on Partitioned Tables.............................................................................. 5-43
Bitmap Join Indexes.................................................................................................................... 5-44
Overview of Index-Organized Tables........................................................................................... 5-44
Benefits of Index-Organized Tables ........................................................................................ 5-46
Index-Organized Tables with Row Overflow Area............................................................... 5-46
Secondary Indexes on Index-Organized Tables..................................................................... 5-47
Bitmap Indexes on Index-Organized Tables .......................................................................... 5-48
Mapping Table..................................................................................................................... 5-48
Partitioned Index-Organized Tables........................................................................................ 5-49

How Oracle Uses the Data Dictionary ...................................................................................... 7-3
Public Synonyms for Data Dictionary Views.................................................................... 7-3
Cache the Data Dictionary for Fast Access ........................................................................ 7-4
Other Programs and the Data Dictionary.......................................................................... 7-4
How to Use the Data Dictionary ............................................................................................... 7-4
Views with the Prefix USER................................................................................................. 7-5
Views with the Prefix ALL................................................................................................... 7-5
Views with the Prefix DBA .................................................................................................. 7-5
The DUAL Table.................................................................................................................... 7-6
Dynamic Performance Tables .......................................................................................................... 7-6
Database Object Metadata ................................................................................................................ 7-7
8 Memory Architecture
Introduction to Oracle Memory Structures ................................................................................... 8-1
Overview of the System Global Area ............................................................................................. 8-2
The SGA_MAX_SIZE Initialization Parameter ........................................................................ 8-4
Automatic Shared Memory Management................................................................................. 8-5
The SGA_TARGET Initialization Parameter ..................................................................... 8-6
Automatically Managed SGA Components ...................................................................... 8-6
Manually Managed SGA Components .............................................................................. 8-7
Persistence of Automatically Tuned Values...................................................................... 8-8
Adding Granules and Tracking Component Size.................................................................... 8-8
Database Buffer Cache ................................................................................................................. 8-9
Organization of the Database Buffer Cache ...................................................................... 8-9
xiii
The LRU Algorithm and Full Table Scans ...................................................................... 8-10
Size of the Database Buffer Cache..................................................................................... 8-10
Multiple Buffer Pools ......................................................................................................... 8-12
Redo Log Buffer ......................................................................................................................... 8-13
Shared Pool ................................................................................................................................. 8-13
Library Cache....................................................................................................................... 8-13

Database Writer Process (DBWn) ....................................................................................... 9-8
Log Writer Process (LGWR) ................................................................................................ 9-9
Checkpoint Process (CKPT) .............................................................................................. 9-11
System Monitor Process (SMON) ..................................................................................... 9-11
Process Monitor Process (PMON) .................................................................................... 9-12
Recoverer Process (RECO) ................................................................................................ 9-12
Job Queue Processes............................................................................................................ 9-12
Archiver Processes (ARCn) ............................................................................................... 9-13
Queue Monitor Processes (QMNn) .................................................................................. 9-14
Other Background Processes ............................................................................................. 9-14
Trace Files and the Alert Log ................................................................................................... 9-15
Shared Server Architecture ............................................................................................................ 9-16
Dispatcher Request and Response Queues ............................................................................ 9-17
Dispatcher Processes (Dnnn).............................................................................................. 9-20
Shared Server Processes (Snnn)......................................................................................... 9-20
Restricted Operations of the Shared Server ........................................................................... 9-21
Dedicated Server Configuration .................................................................................................... 9-22
The Program Interface ..................................................................................................................... 9-23
Program Interface Structure ..................................................................................................... 9-24
Program Interface Drivers ........................................................................................................ 9-24
Communications Software for the Operating System .......................................................... 9-25
10 Application Architecture
Introduction to Client/Server Architecture.................................................................................. 10-1
Overview of Multitier Architecture ............................................................................................. 10-5
Clients........................................................................................................................................... 10-6
Application Servers .................................................................................................................... 10-6
Database Servers......................................................................................................................... 10-6
Overview of Oracle Net Services................................................................................................... 10-6
How Oracle Net Services Works .............................................................................................. 10-7
The Listener ................................................................................................................................ 10-8

Undo Space Acquisition and Management..................................................................... 12-8
Resolution of In-Doubt Distributed Transaction............................................................ 12-8
Open a Database in Read-Only Mode ............................................................................. 12-9
Overview of Database and Instance Shutdown ......................................................................... 12-9
Close a Database ...................................................................................................................... 12-10
Close the Database by Terminating the Instance.......................................................... 12-10
xvi
Unmount a Database ............................................................................................................... 12-10
Shut Down an Instance ........................................................................................................... 12-10
Abnormal Instance Shutdown......................................................................................... 12-10
Part III Oracle Database Features
13 Data Concurrency and Consistency
Introduction to Data Concurrency and Consistency in a Multiuser Environment.............. 13-1
Preventable Phenomena and Transaction Isolation Levels ................................................. 13-2
Overview of Locking Mechanisms........................................................................................... 13-3
How Oracle Manages Data Concurrency and Consistency...................................................... 13-3
Multiversion Concurrency Control ......................................................................................... 13-4
Statement-Level Read Consistency ......................................................................................... 13-5
Transaction-Level Read Consistency ...................................................................................... 13-6
Read Consistency with Real Application Clusters ................................................................ 13-6
Oracle Isolation Levels .............................................................................................................. 13-6
Set the Isolation Level ........................................................................................................ 13-7
Read Committed Isolation ................................................................................................. 13-8
Serializable Isolation ........................................................................................................... 13-8
Comparison of Read Committed and Serializable Isolation ............................................... 13-9
Transaction Set Consistency............................................................................................. 13-10
Row-Level Locking............................................................................................................ 13-11
Referential Integrity .......................................................................................................... 13-11
Distributed Transactions .................................................................................................. 13-12
Choice of Isolation Level ......................................................................................................... 13-12

Some Uses of Flashback Query............................................................................................... 13-36
14 Manageability
Installing Oracle and Getting Started........................................................................................... 14-2
Simplified Database Creation ................................................................................................... 14-2
Instant Client............................................................................................................................... 14-2
Automated Upgrades................................................................................................................. 14-3
Basic Initialization Parameters ................................................................................................. 14-3
Data Loading, Transfer, and Archiving .................................................................................. 14-3
Intelligent Infrastructure................................................................................................................. 14-4
Automatic Workload Repository ............................................................................................. 14-4
Automatic Maintenance Tasks ................................................................................................. 14-5
Server-Generated Alerts ............................................................................................................ 14-5
Advisor Framework ................................................................................................................... 14-6
Performance Diagnostic and Troubleshooting ........................................................................... 14-6
Application and SQL Tuning ......................................................................................................... 14-7
xviii
Memory Management...................................................................................................................... 14-9
Space Management......................................................................................................................... 14-12
Automatic Undo Management ............................................................................................... 14-12
Oracle-Managed Files............................................................................................................... 14-13
Free Space Management .......................................................................................................... 14-13
Proactive Space Management ................................................................................................. 14-13
Intelligent Capacity Planning ................................................................................................. 14-14
Transparent Space Reclamation ............................................................................................. 14-14
Storage Management...................................................................................................................... 14-15
Backup and Recovery..................................................................................................................... 14-16
Recovery Manager.................................................................................................................... 14-16
Mean Time to Recovery ........................................................................................................... 14-17
Self Service Error Correction................................................................................................... 14-18
Configuration Management.......................................................................................................... 14-19

Windows............................................................................................................................. 14-34
15 Backup and Recovery
Introduction to Backup.................................................................................................................... 15-1
Consistent and Inconsistent Backups ...................................................................................... 15-2
Overview of Consistent Backups ...................................................................................... 15-3
Overview of Inconsistent Backups ................................................................................... 15-3
Whole Database and Partial Database Backups..................................................................... 15-4
Whole Database Backups ................................................................................................... 15-5
Tablespace Backups ............................................................................................................ 15-5
Datafile Backups.................................................................................................................. 15-6
RMAN and User-Managed Backups ....................................................................................... 15-6
RMAN with Online Backups............................................................................................. 15-6
Control File Backups........................................................................................................... 15-7
Archived Redo Log Backups ............................................................................................. 15-8
Introduction to Recovery................................................................................................................. 15-8
Overview of Media Recovery ................................................................................................. 15-10
Complete Recovery ........................................................................................................... 15-10
Incomplete Recovery......................................................................................................... 15-11
Datafile Media Recovery .................................................................................................. 15-13
Block Media Recovery ...................................................................................................... 15-14
Overview of RMAN and User-Managed Restore and Recovery ...................................... 15-14
RMAN Restore and Recovery ......................................................................................... 15-15
User-Managed Restore and Recovery............................................................................ 15-15
Recovery Using Oracle Flashback Technology.................................................................... 15-16
Overview of Oracle Flashback Database ....................................................................... 15-16
Overview of Oracle Flashback Table.............................................................................. 15-17
xx
Other Types of Oracle Recovery............................................................................................. 15-18
Overview of Redo Application........................................................................................ 15-18
Overview of Instance and Crash Recovery.................................................................... 15-20

Change Data Capture............................................................................................................... 16-11
xxi
Overview of Materialized Views for Data Warehouses.......................................................... 16-11
Overview of Bitmap Indexes in Data Warehousing ................................................................ 16-12
Overview of Parallel Execution.................................................................................................... 16-13
How Parallel Execution Works............................................................................................... 16-14
Overview of Analytic SQL............................................................................................................ 16-15
SQL for Aggregation................................................................................................................ 16-16
SQL for Analysis....................................................................................................................... 16-17
SQL for Modeling ..................................................................................................................... 16-17
Overview of OLAP Capabilities.................................................................................................. 16-18
Benefits of OLAP and RDBMS Integration........................................................................... 16-18
Scalability............................................................................................................................ 16-19
Availability......................................................................................................................... 16-19
Manageability .................................................................................................................... 16-19
Backup and Recovery ....................................................................................................... 16-19
Security ............................................................................................................................... 16-20
Overview of Data Mining............................................................................................................. 16-20
17 High Availability
Introduction to High Availability.................................................................................................. 17-1
Overview of Unplanned Downtime ............................................................................................. 17-1
Oracle Solutions to System Failures......................................................................................... 17-2
Overview of Fast-Start Fault Recovery ........................................................................... 17-2
Overview of Real Application Clusters ........................................................................... 17-3
Oracle Solutions to Data Failures............................................................................................. 17-3
Overview of Backup and Recovery Features for High Availability ............................ 17-3
Overview of Partitioning ................................................................................................... 17-5
Overview of Transparent Application Failover.............................................................. 17-5
Oracle Solutions to Disasters .................................................................................................... 17-6
Overview of Oracle Data Guard ....................................................................................... 17-6

Maintenance of Global Partitioned Indexes .................................................................. 18-14
Global Nonpartitioned Indexes .............................................................................................. 18-15
Miscellaneous Information about Creating Indexes on Partitioned Tables..................... 18-16
Using Partitioned Indexes in OLTP Applications................................................................ 18-16
Using Partitioned Indexes in Data Warehousing and DSS Applications......................... 18-16
Partitioned Indexes on Composite Partitions....................................................................... 18-16
Partitioning to Improve Performance ......................................................................................... 18-17
Partition Pruning ...................................................................................................................... 18-17
Partition Pruning Example............................................................................................... 18-18
Partition-wise Joins................................................................................................................... 18-18
Parallel DML.............................................................................................................................. 18-18
xxiii
19 Content Management
Introduction to Content Management.......................................................................................... 19-1
Overview of XML in Oracle............................................................................................................ 19-2
Overview of LOBs ............................................................................................................................ 19-3
Overview of Oracle Text.................................................................................................................. 19-4
Oracle Text Index Types............................................................................................................ 19-4
Oracle Text Document Services................................................................................................ 19-5
Oracle Text Query Package....................................................................................................... 19-5
Oracle Text Advanced Features ............................................................................................... 19-5
Overview of Oracle Ultra Search................................................................................................... 19-6
Overview of Oracle interMedia ..................................................................................................... 19-7
Overview of Oracle Spatial............................................................................................................. 19-7
20 Database Security
Introduction to Database Security................................................................................................. 20-1
Database Users and Schemas.................................................................................................... 20-2
Security Domain ................................................................................................................. 20-2
Privileges...................................................................................................................................... 20-2
Roles ............................................................................................................................................. 20-2

The Operating System and Roles ................................................................................... 20-18
Secure Application Roles......................................................................................................... 20-18
Overview of Access Restrictions on Tables, Views, Synonyms, or Rows............................ 20-19
Fine-Grained Access Control .................................................................................................. 20-19
Dynamic Predicates .......................................................................................................... 20-20
Application Context ................................................................................................................. 20-20
Dynamic Contexts ............................................................................................................. 20-21
Fine-Grained Auditing............................................................................................................. 20-21
Overview of Security Policies ..................................................................................................... 20-22
System Security Policy ............................................................................................................. 20-22
Database User Management ............................................................................................ 20-22
User Authentication .......................................................................................................... 20-23
Operating System Security............................................................................................... 20-23
Data Security Policy ................................................................................................................. 20-23
User Security Policy.................................................................................................................. 20-24
General User Security ....................................................................................................... 20-24
End-User Security.............................................................................................................. 20-25
Administrator Security ..................................................................................................... 20-25
Application Developer Security ...................................................................................... 20-26
Application Administrator Security ............................................................................... 20-27
Password Management Policy................................................................................................ 20-27
Auditing Policy ......................................................................................................................... 20-27
xxv
Overview of Database Auditing.................................................................................................. 20-27
Types and Records of Auditing.............................................................................................. 20-28
Audit Records and the Audit Trails ............................................................................... 20-29
21 Data Integrity
Introduction to Data Integrity........................................................................................................ 21-1
Types of Data Integrity ............................................................................................................. 21-2
Null Rule............................................................................................................................... 21-2


Nhờ tải bản gốc
Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status