Db concepts

1,163 views
1,118 views

Published on

Db concepts

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,163
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
58
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Db concepts

  1. 1. Oracle® DatabaseConcepts10g Release 2 (10.2)B14220-02October 2005
  2. 2. Oracle Database Concepts, 10g Release 2 (10.2)B14220-02Copyright © 1993, 2005, Oracle. All rights reserved.Primary Author: Michele CyranContributing Author: Paul Lane, JP PolkContributor: Omar Alonso, Penny Avril, Hermann Baer, Sandeepan Banerjee, Mark Bauer, Bill Bridge,Sandra Cheevers, Carol Colrain, Vira Goorah, Mike Hartstein, John Haydu, Wei Hu, Ramkumar Krishnan,Vasudha Krishnaswamy, Bill Lee, Bryn Llewellyn, Rich Long, Diana Lorentz, Paul Manning, Valarie Moore,Mughees Minhas, Gopal Mulagund, Muthu Olagappan, Jennifer Polk, Kathy Rich, John Russell, VivSchupmann, Bob Thome, Randy Urbano, Michael Verheij, Ron Weiss, Steve WertheimerThe Programs (which include both the software and documentation) contain proprietary information; theyare provided under a license agreement containing restrictions on use and disclosure and are also protectedby 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 otherindependently 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 inthe documentation, please report them to us in writing. This document is not warranted to be error-free.Except as may be expressly permitted in your license agreement for these Programs, no part of thesePrograms may be reproduced or transmitted in any form or by any means, electronic or mechanical, for anypurpose.If the Programs are delivered to the United States Government or anyone licensing or using the Programs onbehalf of the United States Government, the following notice is applicable:U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical datadelivered to U.S. Government customers are "commercial computer software" or "commercial technical data"pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. Assuch, use, duplication, disclosure, modification, and adaptation of the Programs, including documentationand technical data, shall be subject to the licensing restrictions set forth in the applicable Oracle licenseagreement, and, to the extent applicable, the additional rights set forth in FAR 52.227-19, CommercialComputer Software—Restricted Rights (June 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City,CA 94065The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherentlydangerous applications. It shall be the licensees 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 suchpurposes, and we disclaim liability for any damages caused by such use of the Programs.Oracle, JD Edwards, PeopleSoft, and Retek are registered trademarks of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respective owners.The Programs may provide links to Web sites and access to content, products, and services from thirdparties. Oracle is not responsible for the availability of, or any content provided on, third-party Web sites.You bear all risks associated with the use of such content. If you choose to purchase any products or servicesfrom a third party, the relationship is directly between you and the third party. Oracle is not responsible for:(a) the quality of third-party products or services; or (b) fulfilling any of the terms of the agreement with thethird party, including delivery of products or services and warranty obligations related to purchasedproducts or services. Oracle is not responsible for any loss or damage of any sort that you may incur fromdealing with any third party.
  3. 3. ContentsPreface ............................................................................................................................................................. xxv Audience................................................................................................................................................... xxv Documentation Accessibility ................................................................................................................. xxv Related Documentation .......................................................................................................................... xxvi Conventions ............................................................................................................................................. xxviPart I What Is Oracle?1 Introduction to the Oracle Database Oracle Database Architecture ............................................................................................................... 1-1 Overview of Oracle Grid Architecture............................................................................................ 1-2 Grid Computing Defined........................................................................................................... 1-2 Grid Computing in Oracle Database 10g................................................................................. 1-5 Overview of Application Architecture ........................................................................................... 1-7 Client/Server Architecture........................................................................................................ 1-7 Multitier Architecture: Application Servers ........................................................................... 1-7 Overview of Physical Database Structures..................................................................................... 1-8 Datafiles ....................................................................................................................................... 1-8 Control Files................................................................................................................................. 1-8 Redo Log Files ............................................................................................................................. 1-9 Archive Log Files ........................................................................................................................ 1-9 Parameter Files ............................................................................................................................ 1-9 Alert and Trace Log Files ........................................................................................................... 1-9 Backup Files .............................................................................................................................. 1-10 Overview of Logical Database Structures ................................................................................... 1-10 Tablespaces ............................................................................................................................... 1-10 Oracle Data Blocks ................................................................................................................... 1-10 Extents ....................................................................................................................................... 1-11 Segments ................................................................................................................................... 1-11 Overview of Schemas and Common Schema Objects ............................................................... 1-12 Tables ......................................................................................................................................... 1-12 Indexes ...................................................................................................................................... 1-12 Views ......................................................................................................................................... 1-12 Clusters...................................................................................................................................... 1-13 Synonyms.................................................................................................................................. 1-13 iii
  4. 4. Overview of the Oracle Data Dictionary ..................................................................................... 1-13 Overview of the Oracle Instance................................................................................................... 1-13 Real Application Clusters: Multiple Instance Systems....................................................... 1-13 Instance Memory Structures ................................................................................................. 1-14 System Global Area ................................................................................................................. 1-14 Program Global Area............................................................................................................... 1-15 Oracle Background Processes ................................................................................................ 1-15 Process Architecture ................................................................................................................ 1-15 Overview of Accessing the Database ........................................................................................... 1-16 Network Connections.............................................................................................................. 1-16 Starting Up the Database ........................................................................................................ 1-16 How Oracle Works ................................................................................................................. 1-17 Overview of Oracle Utilities .......................................................................................................... 1-17 Oracle Database Features .................................................................................................................... 1-17 Overview of Scalability and Performance Features ................................................................... 1-18 Concurrency ............................................................................................................................. 1-18 Read Consistency .................................................................................................................... 1-18 Locking Mechanisms .............................................................................................................. 1-19 Quiesce Database ..................................................................................................................... 1-20 Real Application Clusters ....................................................................................................... 1-20 Portability.................................................................................................................................. 1-20 Overview of Manageability Features ........................................................................................... 1-21 Self-Managing Database ......................................................................................................... 1-21 Oracle Enterprise Manager..................................................................................................... 1-21 SQL*Plus.................................................................................................................................... 1-21 Automatic Storage Management ........................................................................................... 1-21 The Scheduler ........................................................................................................................... 1-22 Database Resource Manager ................................................................................................. 1-22 Overview of Database Backup and Recovery Features............................................................. 1-22 Types of Failures ..................................................................................................................... 1-22 Structures Used for Recovery ................................................................................................ 1-23 Overview of High Availability Features...................................................................................... 1-24 Overview of Business Intelligence Features................................................................................ 1-25 Data Warehousing ................................................................................................................... 1-25 Extraction, Transformation, and Loading (ETL) ................................................................. 1-25 Materialized Views .................................................................................................................. 1-25 Bitmap Indexes in Data Warehousing .................................................................................. 1-26 Table Compression .................................................................................................................. 1-26 Parallel Execution .................................................................................................................... 1-26 Analytic SQL............................................................................................................................. 1-26 OLAP Capabilities ................................................................................................................... 1-26 Data Mining .............................................................................................................................. 1-27 Partitioning ............................................................................................................................... 1-27 Overview of Content Management Features .............................................................................. 1-27 XML in Oracle........................................................................................................................... 1-27 LOBs........................................................................................................................................... 1-27 Oracle Text ............................................................................................................................... 1-28iv
  5. 5. Oracle Ultra Search ................................................................................................................. 1-28 Oracle interMedia..................................................................................................................... 1-28 Oracle Spatial............................................................................................................................ 1-28 Overview of Security Features ...................................................................................................... 1-28 Security Mechanisms .............................................................................................................. 1-29 Overview of Data Integrity and Triggers .................................................................................... 1-29 Integrity Constraints................................................................................................................ 1-30 Keys ........................................................................................................................................... 1-30 Triggers ..................................................................................................................................... 1-30 Overview of Information Integration Features........................................................................... 1-31 Distributed SQL ...................................................................................................................... 1-31 Oracle Streams ......................................................................................................................... 1-31 Oracle Transparent Gateways and Generic Connectivity ................................................. 1-33 Oracle Database Application Development ................................................................................... 1-33 Overview of Oracle SQL ................................................................................................................ 1-33 SQL Statements ........................................................................................................................ 1-33 Overview of PL/SQL...................................................................................................................... 1-34 PL/SQL Program Units .......................................................................................................... 1-35 Overview of Java ............................................................................................................................. 1-35 Overview of Application Programming Languages (APIs) ..................................................... 1-35 Overview of Transactions .............................................................................................................. 1-36 Commit and Undo Transactions............................................................................................ 1-37 Savepoints ................................................................................................................................. 1-37 Overview of Datatypes................................................................................................................... 1-37 Overview of Globalization ............................................................................................................ 1-38Part II Oracle Database Architecture2 Data Blocks, Extents, and Segments Introduction to Data Blocks, Extents, and Segments ........................................................................ 2-1 Overview of Data Blocks ........................................................................................................................ 2-3 Data Block Format ............................................................................................................................. 2-3 Header (Common and Variable) .............................................................................................. 2-4 Table Directory ............................................................................................................................ 2-4 Row Directory ............................................................................................................................. 2-4 Overhead...................................................................................................................................... 2-4 Row Data...................................................................................................................................... 2-4 Free Space..................................................................................................................................... 2-4 Free Space Management.................................................................................................................... 2-4 Availability and Optimization of Free Space in a Data Block .............................................. 2-5 Row Chaining and Migrating .................................................................................................. 2-5 PCTFREE, PCTUSED, and Row Chaining .................................................................................... 2-6 The PCTFREE Parameter ........................................................................................................... 2-6 The PCTUSED Parameter .......................................................................................................... 2-7 Overview of Extents.............................................................................................................................. 2-10 When Extents Are Allocated ........................................................................................................ 2-10 v
  6. 6. Determine the Number and Size of Extents ............................................................................... 2-10 How Extents Are Allocated .......................................................................................................... 2-11 When Extents Are Deallocated .................................................................................................... 2-11 Extents in Nonclustered Tables ............................................................................................. 2-12 Extents in Clustered Tables .................................................................................................... 2-12 Extents in Materialized Views and Their Logs.................................................................... 2-12 Extents in Indexes .................................................................................................................... 2-13 Extents in Temporary Segments ............................................................................................ 2-13 Extents in Rollback Segments................................................................................................. 2-13 Overview of Segments ......................................................................................................................... 2-13 Introduction to Data Segments .................................................................................................... 2-13 Introduction to Index Segments ................................................................................................... 2-14 Introduction to Temporary Segments ......................................................................................... 2-14 Operations that Require Temporary Segments .................................................................. 2-14 Segments in Temporary Tables and Their Indexes ............................................................ 2-15 How Temporary Segments Are Allocated .......................................................................... 2-15 Introduction to Automatic Undo Management.......................................................................... 2-16 Undo Mode ............................................................................................................................... 2-16 Undo Quota .............................................................................................................................. 2-17 Automatic Undo Retention..................................................................................................... 2-17 External Views.......................................................................................................................... 2-173 Tablespaces, Datafiles, and Control Files Introduction to Tablespaces, Datafiles, and Control Files ............................................................... 3-1 Oracle-Managed Files ........................................................................................................................ 3-2 Allocate More Space for a Database ............................................................................................... 3-2 Overview of Tablespaces ........................................................................................................................ 3-4 Bigfile Tablespaces ............................................................................................................................. 3-5 Benefits of Bigfile Tablespaces .................................................................................................. 3-6 Considerations with Bigfile Tablespaces ................................................................................. 3-6 The SYSTEM Tablespace .................................................................................................................. 3-6 The Data Dictionary.................................................................................................................... 3-7 PL/SQL Program Units Description........................................................................................ 3-7 The SYSAUX Tablespace................................................................................................................... 3-7 Undo Tablespaces .............................................................................................................................. 3-7 Creation of Undo Tablespaces .................................................................................................. 3-8 Assignment of Undo Tablespaces ............................................................................................ 3-8 Default Temporary Tablespace ........................................................................................................ 3-8 How to Specify a Default Temporary Tablespace.................................................................. 3-8 Using Multiple Tablespaces.............................................................................................................. 3-9 Managing Space in Tablespaces ...................................................................................................... 3-9 Locally Managed Tablespaces ............................................................................................... 3-10 Segment Space Management in Locally Managed Tablespaces ...................................... 3-10 Dictionary Managed Tablespaces ......................................................................................... 3-11 Multiple Block Sizes........................................................................................................................ 3-11 Online and Offline Tablespaces .................................................................................................... 3-11 Bringing Tablespaces Offline ................................................................................................. 3-12vi
  7. 7. Use of Tablespaces for Special Procedures .......................................................................... 3-12 Read-Only Tablespaces ................................................................................................................. 3-13 Temporary Tablespaces for Sort Operations............................................................................... 3-13 Sort Segments .......................................................................................................................... 3-13 Creation of Temporary Tablespaces ..................................................................................... 3-14 Transport of Tablespaces Between Databases ........................................................................... 3-14 Tablespace Repository............................................................................................................. 3-14 How to Move or Copy a Tablespace to Another Database ............................................... 3-15 Overview of Datafiles .......................................................................................................................... 3-15 Datafile Contents ............................................................................................................................ 3-16 Size of Datafiles .............................................................................................................................. 3-16 Offline Datafiles .............................................................................................................................. 3-16 Temporary Datafiles ...................................................................................................................... 3-16 Overview of Control Files ................................................................................................................... 3-17 Control File Contents ..................................................................................................................... 3-17 Multiplexed Control Files ............................................................................................................. 3-184 Transaction Management Introduction to Transactions .................................................................................................................. 4-1 Statement Execution and Transaction Control ............................................................................. 4-3 Statement-Level Rollback ................................................................................................................. 4-3 Resumable Space Allocation............................................................................................................. 4-3 Overview of Transaction Management ................................................................................................ 4-4 Commit Transactions ........................................................................................................................ 4-4 Rollback of Transactions .................................................................................................................. 4-5 Savepoints In Transactions ............................................................................................................... 4-6 Transaction Naming .......................................................................................................................... 4-7 How Transactions Are Named ................................................................................................. 4-7 Commit Comment ...................................................................................................................... 4-7 The Two-Phase Commit Mechanism ............................................................................................. 4-8 Overview of Autonomous Transactions .............................................................................................. 4-8 Autonomous PL/SQL Blocks .......................................................................................................... 4-9 Transaction Control Statements in Autonomous Blocks ..................................................... 4-95 Schema Objects Introduction to Schema Objects ........................................................................................................... 5-1 Overview of Tables ................................................................................................................................. 5-3 How Table Data Is Stored ................................................................................................................ 5-4 Row Format and Size ................................................................................................................ 5-5 Rowids of Row Pieces ............................................................................................................... 5-6 Column Order ............................................................................................................................ 5-6 Table Compression ............................................................................................................................ 5-7 Using Table Compression.......................................................................................................... 5-7 Nulls Indicate Absence of Value...................................................................................................... 5-8 Default Values for Columns ............................................................................................................ 5-8 Default Value Insertion and Integrity Constraint Checking ............................................... 5-8 vii
  8. 8. Partitioned Tables .............................................................................................................................. 5-9 Nested Tables .................................................................................................................................. 5-10 Temporary Tables .......................................................................................................................... 5-10 Segment Allocation.................................................................................................................. 5-10 Parent and Child Transactions .............................................................................................. 5-11 External Tables ................................................................................................................................ 5-11 The Access Driver .................................................................................................................... 5-11 Data Loading with External Tables ....................................................................................... 5-12 Parallel Access to External Tables ......................................................................................... 5-12 Overview of Views................................................................................................................................ 5-13 How Views are Stored.................................................................................................................... 5-13 How Views Are Used .................................................................................................................... 5-14 Mechanics of Views ....................................................................................................................... 5-14 Globalization Support Parameters in Views........................................................................ 5-15 Use of Indexes Against Views................................................................................................ 5-15 Dependencies and Views .............................................................................................................. 5-15 Updatable Join Views .................................................................................................................... 5-16 Object Views .................................................................................................................................... 5-16 Inline Views .................................................................................................................................... 5-16 Overview of Materialized Views ....................................................................................................... 5-17 Define Constraints on Views ......................................................................................................... 5-17 Refresh Materialized Views .......................................................................................................... 5-18 Materialized View Logs ................................................................................................................ 5-18 Overview of Dimensions..................................................................................................................... 5-19 Overview of the Sequence Generator ............................................................................................... 5-19 Overview of Synonyms........................................................................................................................ 5-20 Overview of Indexes............................................................................................................................. 5-21 Unique and Nonunique Indexes .................................................................................................. 5-22 Composite Indexes.......................................................................................................................... 5-22 Indexes and Keys ........................................................................................................................... 5-23 Indexes and Nulls .......................................................................................................................... 5-23 Function-Based Indexes ................................................................................................................. 5-24 Uses of Function-Based Indexes ........................................................................................... 5-24 Optimization with Function-Based Indexes ....................................................................... 5-24 Dependencies of Function-Based Indexes ........................................................................... 5-25 How Indexes Are Stored ............................................................................................................... 5-26 Format of Index Blocks............................................................................................................ 5-26 The Internal Structure of Indexes .......................................................................................... 5-26 Index Properties ....................................................................................................................... 5-27 Advantages of B-tree Structure.............................................................................................. 5-28 Index Unique Scan .......................................................................................................................... 5-28 Index Range Scan ............................................................................................................................ 5-28 Key Compression ........................................................................................................................... 5-28 Prefix and Suffix Entries ........................................................................................................ 5-28 Performance and Storage Considerations ........................................................................... 5-29 Uses of Key Compression ...................................................................................................... 5-29 Reverse Key Indexes ...................................................................................................................... 5-30viii
  9. 9. Bitmap Indexes ............................................................................................................................... 5-30 Benefits for Data Warehousing Applications ..................................................................... 5-30 Cardinality ................................................................................................................................ 5-31 Bitmap Index Example ............................................................................................................ 5-32 Bitmap Indexes and Nulls ..................................................................................................... 5-33 Bitmap Indexes on Partitioned Tables .................................................................................. 5-33 Bitmap Join Indexes ........................................................................................................................ 5-33 Overview of Index-Organized Tables ............................................................................................... 5-34 Benefits of Index-Organized Tables ............................................................................................ 5-35 Index-Organized Tables with Row Overflow Area ................................................................... 5-35 Secondary Indexes on Index-Organized Tables ......................................................................... 5-36 Bitmap Indexes on Index-Organized Tables ............................................................................... 5-36 Mapping Table ......................................................................................................................... 5-36 Partitioned Index-Organized Tables ............................................................................................ 5-37 B-tree Indexes on UROWID Columns for Heap- and Index-Organized Tables .................... 5-37 Index-Organized Table Applications ........................................................................................... 5-37 Overview of Application Domain Indexes ...................................................................................... 5-37 Overview of Clusters ............................................................................................................................ 5-38 Overview of Hash Clusters ................................................................................................................. 5-406 Dependencies Among Schema Objects Introduction to Dependency Issues...................................................................................................... 6-1 Resolution of Schema Object Dependencies...................................................................................... 6-3 Compilation of Views and PL/SQL Program Units .................................................................... 6-4 Views and Base Tables ............................................................................................................... 6-4 Program Units and Referenced Objects................................................................................... 6-5 Data Warehousing Considerations .......................................................................................... 6-5 Session State and Referenced Packages ................................................................................... 6-5 Security Authorizations ............................................................................................................. 6-6 Object Name Resolution......................................................................................................................... 6-6 Shared SQL Dependency Management............................................................................................... 6-6 Local and Remote Dependency Management .................................................................................... 6-7 Management of Local Dependencies .............................................................................................. 6-7 Management of Remote Dependencies .......................................................................................... 6-7 Dependencies Among Local and Remote Database Procedures ......................................... 6-7 Dependencies Among Other Remote Schema Objects ......................................................... 6-9 Dependencies of Applications ................................................................................................. 6-97 The Data Dictionary Introduction to the Data Dictionary .................................................................................................... 7-1 Structure of the Data Dictionary ..................................................................................................... 7-2 Base Tables ................................................................................................................................... 7-2 User-Accessible Views ............................................................................................................... 7-2 SYS, Owner of the Data Dictionary ................................................................................................ 7-2 How the Data Dictionary Is Used ........................................................................................................ 7-2 How Oracle Uses the Data Dictionary ........................................................................................... 7-2 ix
  10. 10. Public Synonyms for Data Dictionary Views ......................................................................... 7-3 Cache the Data Dictionary for Fast Access.............................................................................. 7-3 Other Programs and the Data Dictionary ............................................................................... 7-3 How to Use the Data Dictionary ..................................................................................................... 7-3 Views with the Prefix USER ...................................................................................................... 7-4 Views with the Prefix ALL ........................................................................................................ 7-4 Views with the Prefix DBA........................................................................................................ 7-4 The DUAL Table ......................................................................................................................... 7-4 Dynamic Performance Tables ............................................................................................................... 7-5 Database Object Metadata...................................................................................................................... 7-58 Memory Architecture Introduction to Oracle Memory Structures ........................................................................................ 8-1 Overview of the System Global Area................................................................................................... 8-2 The SGA_MAX_SIZE Initialization Parameter.............................................................................. 8-3 Automatic Shared Memory Management ...................................................................................... 8-4 The SGA_TARGET Initialization Parameter .......................................................................... 8-5 Automatically Managed SGA Components ........................................................................... 8-5 Manually Managed SGA Components.................................................................................... 8-6 Persistence of Automatically Tuned Values ........................................................................... 8-6 Adding Granules and Tracking Component Size ......................................................................... 8-6 Database Buffer Cache....................................................................................................................... 8-7 Organization of the Database Buffer Cache ........................................................................... 8-7 The LRU Algorithm and Full Table Scans .............................................................................. 8-8 Size of the Database Buffer Cache ............................................................................................ 8-8 Multiple Buffer Pools ................................................................................................................. 8-9 Redo Log Buffer .............................................................................................................................. 8-10 Shared Pool ..................................................................................................................................... 8-10 Library Cache ........................................................................................................................... 8-10 Shared SQL Areas and Private SQL Areas........................................................................... 8-10 PL/SQL Program Units and the Shared Pool...................................................................... 8-11 Dictionary Cache...................................................................................................................... 8-11 Allocation and Reuse of Memory in the Shared Pool......................................................... 8-11 Large Pool......................................................................................................................................... 8-13 Java Pool ........................................................................................................................................... 8-13 Streams Pool..................................................................................................................................... 8-13 Control of the SGA’s Use of Memory........................................................................................... 8-14 Other SGA Initialization Parameters............................................................................................ 8-14 Physical Memory .................................................................................................................... 8-14 SGA Starting Address ............................................................................................................ 8-14 Extended Buffer Cache Mechanism ..................................................................................... 8-14 Overview of the Program Global Areas............................................................................................ 8-14 Content of the PGA ........................................................................................................................ 8-15 Private SQL Area...................................................................................................................... 8-15 Session Memory ....................................................................................................................... 8-16 SQL Work Areas.............................................................................................................................. 8-16 PGA Memory Management for Dedicated Mode ...................................................................... 8-16x
  11. 11. Dedicated and Shared Servers............................................................................................................ 8-18 Software Code Areas ........................................................................................................................... 8-189 Process Architecture Introduction to Processes ....................................................................................................................... 9-1 Multiple-Process Oracle Systems .................................................................................................... 9-1 Types of Processes ............................................................................................................................. 9-2 Overview of User Processes ................................................................................................................... 9-3 Connections and Sessions ................................................................................................................ 9-3 Overview of Oracle Processes................................................................................................................ 9-3 Server Processes ................................................................................................................................. 9-3 Background Processes ....................................................................................................................... 9-4 Database Writer Process (DBWn) ............................................................................................ 9-6 Log Writer Process (LGWR) ..................................................................................................... 9-6 Checkpoint Process (CKPT) ..................................................................................................... 9-8 System Monitor Process (SMON) ............................................................................................ 9-8 Process Monitor Process (PMON) ........................................................................................... 9-8 Recoverer Process (RECO) ........................................................................................................ 9-9 Job Queue Processes ................................................................................................................... 9-9 Archiver Processes (ARCn) ................................................................................................... 9-10 Queue Monitor Processes (QMNn) ...................................................................................... 9-10 Other Background Processes.................................................................................................. 9-10 Trace Files and the Alert Log ........................................................................................................ 9-11 Shared Server Architecture ................................................................................................................. 9-11 Dispatcher Request and Response Queues ................................................................................ 9-12 Dispatcher Processes (Dnnn).................................................................................................. 9-14 Shared Server Processes (Snnn) ............................................................................................. 9-14 Restricted Operations of the Shared Server ............................................................................... 9-15 Dedicated Server Configuration ....................................................................................................... 9-15 The Program Interface ......................................................................................................................... 9-17 Program Interface Structure ......................................................................................................... 9-17 Program Interface Drivers ............................................................................................................ 9-17 Communications Software for the Operating System .............................................................. 9-1810 Application Architecture Introduction to Client/Server Architecture ...................................................................................... 10-1 Overview of Multitier Architecture .................................................................................................. 10-3 Clients ............................................................................................................................................... 10-4 Application Servers......................................................................................................................... 10-4 Database Servers ............................................................................................................................. 10-4 Overview of Oracle Net Services ....................................................................................................... 10-5 How Oracle Net Services Works................................................................................................... 10-5 The Listener ..................................................................................................................................... 10-6 Service Information Registration ........................................................................................... 10-6 xi
  12. 12. 11 Oracle Utilities Introduction to Oracle Utilities ......................................................................................................... 11-1 Overview of Data Pump Export and Import .................................................................................... 11-2 Data Pump Export........................................................................................................................... 11-2 Data Pump Import .......................................................................................................................... 11-2 Overview of the Data Pump API........................................................................................................ 11-2 Overview of the Metadata API ........................................................................................................... 11-2 Overview of SQL*Loader .................................................................................................................... 11-3 Overview of External Tables ............................................................................................................... 11-3 Overview of LogMiner......................................................................................................................... 11-4 Overview of DBVERIFY Utility ......................................................................................................... 11-4 Overview of DBNEWID Utility ......................................................................................................... 11-512 Database and Instance Startup and Shutdown Introduction to an Oracle Instance ................................................................................................... 12-1 The Instance and the Database ..................................................................................................... 12-2 Connection with Administrator Privileges ................................................................................ 12-2 Initialization Parameter Files and Server Parameter Files ........................................................ 12-3 How Parameter Values Are Changed................................................................................... 12-3 Overview of Instance and Database Startup .................................................................................. 12-4 How an Instance Is Started ............................................................................................................ 12-4 Restricted Mode of Instance Startup ..................................................................................... 12-4 Forced Startup in Abnormal Situations ................................................................................ 12-4 How a Database Is Mounted ......................................................................................................... 12-4 How a Database Is Mounted with Real Application Clusters .......................................... 12-5 How a Standby Database Is Mounted .................................................................................. 12-5 How a Clone Database Is Mounted....................................................................................... 12-5 What Happens When You Open a Database .............................................................................. 12-6 Instance Recovery .................................................................................................................... 12-6 Undo Space Acquisition and Management.......................................................................... 12-6 Resolution of In-Doubt Distributed Transaction................................................................. 12-6 Open a Database in Read-Only Mode ................................................................................. 12-6 Overview of Database and Instance Shutdown .............................................................................. 12-7 Close a Database ............................................................................................................................. 12-7 Close the Database by Terminating the Instance ................................................................ 12-7 Unmount a Database ..................................................................................................................... 12-8 Shut Down an Instance .................................................................................................................. 12-8 Abnormal Instance Shutdown ............................................................................................... 12-8Part III Oracle Database Features13 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-2 How Oracle Manages Data Concurrency and Consistency .......................................................... 13-3xii
  13. 13. Multiversion Concurrency Control ............................................................................................. 13-3 Statement-Level Read Consistency ............................................................................................. 13-4 Transaction-Level Read Consistency .......................................................................................... 13-4 Read Consistency with Real Application Clusters..................................................................... 13-4 Oracle Isolation Levels .................................................................................................................. 13-5 Set the Isolation Level ............................................................................................................. 13-5 Read Committed Isolation...................................................................................................... 13-5 Serializable Isolation................................................................................................................ 13-6 Comparison of Read Committed and Serializable Isolation ................................................... 13-7 Transaction Set Consistency ................................................................................................... 13-7 Row-Level Locking .................................................................................................................. 13-8 Referential Integrity................................................................................................................. 13-8 Distributed Transactions......................................................................................................... 13-9 Choice of Isolation Level ............................................................................................................... 13-9 Read Committed Isolation...................................................................................................... 13-9 Serializable Isolation.............................................................................................................. 13-10 Quiesce Database ................................................................................................................... 13-11 How Oracle Locks Data...................................................................................................................... 13-12 Transactions and Data Concurrency ......................................................................................... 13-12 Modes of Locking................................................................................................................... 13-13 Lock Duration......................................................................................................................... 13-13 Data Lock Conversion Versus Lock Escalation ................................................................. 13-13 Deadlocks ...................................................................................................................................... 13-14 Deadlock Detection................................................................................................................ 13-14 Avoid Deadlocks.................................................................................................................... 13-15 Types of Locks .............................................................................................................................. 13-15 DML Locks .................................................................................................................................... 13-15 Row Locks (TX) ...................................................................................................................... 13-16 Table Locks (TM) ................................................................................................................... 13-16 DML Locks Automatically Acquired for DML Statements ............................................. 13-19 DDL Locks...................................................................................................................................... 13-21 Exclusive DDL Locks............................................................................................................. 13-21 Share DDL Locks.................................................................................................................... 13-22 Breakable Parse Locks ........................................................................................................... 13-22 Duration of DDL Locks ......................................................................................................... 13-22 DDL Locks and Clusters ....................................................................................................... 13-22 Latches and Internal Locks ......................................................................................................... 13-22 Latches ..................................................................................................................................... 13-22 Internal Locks ......................................................................................................................... 13-23 Explicit (Manual) Data Locking ................................................................................................. 13-23 Oracle Lock Management Services............................................................................................. 13-24 Overview of Oracle Flashback Query ............................................................................................. 13-24 Flashback Query Benefits............................................................................................................. 13-25 Some Uses of Flashback Query ................................................................................................... 13-2614 Manageability Installing Oracle and Getting Started ............................................................................................... 14-1 xiii
  14. 14. Simplified Database Creation........................................................................................................ 14-2 Instant Client.................................................................................................................................... 14-2 Automated Upgrades ..................................................................................................................... 14-2 Basic Initialization Parameters ...................................................................................................... 14-2 Data Loading, Transfer, and Archiving ....................................................................................... 14-3 Intelligent Infrastructure ..................................................................................................................... 14-3 Automatic Workload Repository.................................................................................................. 14-3 Automatic Maintenance Tasks ...................................................................................................... 14-4 Server-Generated Alerts................................................................................................................. 14-4 Advisor Framework........................................................................................................................ 14-4 Performance Diagnostic and Troubleshooting................................................................................ 14-5 Application and SQL Tuning .............................................................................................................. 14-6 Memory Management .......................................................................................................................... 14-7 Space Management ............................................................................................................................... 14-9 Automatic Undo Management ..................................................................................................... 14-9 Oracle-Managed Files ................................................................................................................... 14-10 Free Space Management............................................................................................................... 14-10 Proactive Space Management...................................................................................................... 14-10 Intelligent Capacity Planning...................................................................................................... 14-10 Space Reclamation ........................................................................................................................ 14-11 Storage Management .......................................................................................................................... 14-12 Backup and Recovery ......................................................................................................................... 14-12 Recovery Manager ........................................................................................................................ 14-13 Mean Time to Recovery................................................................................................................ 14-14 Self Service Error Correction ....................................................................................................... 14-14 Configuration Management.............................................................................................................. 14-14 Workload Management ...................................................................................................................... 14-15 Overview of the Database Resource Manager.......................................................................... 14-15 Database Resource Manager Concepts............................................................................... 14-16 Overview of Services .................................................................................................................... 14-17 Workload Management with Services................................................................................ 14-17 High Availability with Services ........................................................................................... 14-18 Automatic Storage Management ...................................................................................................... 14-19 Basic Automatic Storage Management Concepts .................................................................... 14-20 Disk Groups ............................................................................................................................ 14-20 Automatic Storage Management Files ................................................................................ 14-20 Automatic Storage Management Templates...................................................................... 14-21 Automatic Storage Management Disks .............................................................................. 14-21 Failure Groups........................................................................................................................ 14-22 Automatic Storage Management Instances........................................................................ 14-22 Benefits of Using Automatic Storage Management ................................................................. 14-23 Oracle Scheduler ................................................................................................................................. 14-24 What Can the Scheduler Do?....................................................................................................... 14-24 Schedule Job Execution ......................................................................................................... 14-25 Time-based scheduling ......................................................................................................... 14-25 Event-Based Scheduling........................................................................................................ 14-25 Define Multi-Step Jobs .......................................................................................................... 14-25xiv
  15. 15. Schedule Job Processes that Model Business Requirements ........................................... 14-25 Manage and Monitor Jobs .................................................................................................... 14-25 Execute and Manage Jobs in a Clustered Environment ................................................... 14-2615 Backup and Recovery Introduction to Backup ........................................................................................................................ 15-1 Consistent and Inconsistent Backups........................................................................................... 15-2 Overview of Consistent Backups........................................................................................... 15-2 Overview of Inconsistent Backups ........................................................................................ 15-3 Whole Database and Partial Database Backups ......................................................................... 15-3 Whole Database Backups........................................................................................................ 15-4 Tablespace Backups ................................................................................................................. 15-4 Datafile Backups....................................................................................................................... 15-4 RMAN and User-Managed Backups............................................................................................ 15-5 RMAN with Online Backups ................................................................................................. 15-5 Control File Backups ............................................................................................................... 15-5 Archived Redo Log Backups.................................................................................................. 15-6 Introduction to Recovery ..................................................................................................................... 15-6 Overview of Media Recovery........................................................................................................ 15-8 Complete Recovery.................................................................................................................. 15-8 Incomplete Recovery ............................................................................................................... 15-8 Datafile Media Recovery....................................................................................................... 15-10 Block Media Recovery........................................................................................................... 15-11 Overview of RMAN and User-Managed Restore and Recovery ........................................... 15-11 RMAN Restore and Recovery .............................................................................................. 15-11 User-Managed Restore and Recovery................................................................................. 15-11 Recovery Using Oracle Flashback Technology......................................................................... 15-12 Overview of Oracle Flashback Database ............................................................................ 15-12 Overview of Oracle Flashback Table .................................................................................. 15-13 Other Types of Oracle Recovery ................................................................................................. 15-14 Overview of Redo Application ............................................................................................ 15-14 Overview of Instance and Crash Recovery ........................................................................ 15-15 Deciding Which Recovery Technique to Use................................................................................. 15-16 When to Use Media Recovery ..................................................................................................... 15-16 When to Use Oracle Flashback.................................................................................................... 15-17 When to Use CREATE TABLE AS SELECT Recovery............................................................. 15-17 When to Use Import/Export Utilities Recovery....................................................................... 15-18 When to Use Tablespace Point-in-Time Recovery ................................................................... 15-18 Flash Recovery Area............................................................................................................................ 15-18 Flash Recovery Area Disk Limit ................................................................................................. 15-1916 Business Intelligence Introduction to Data Warehousing and Business Intelligence..................................................... 16-1 Characteristics of Data Warehousing........................................................................................... 16-1 Subject Oriented ....................................................................................................................... 16-2 Integrated .................................................................................................................................. 16-2 xv
  16. 16. Nonvolatile ............................................................................................................................... 16-2 Time Variant ............................................................................................................................. 16-2 Differences Between Data Warehouse and OLTP Systems ...................................................... 16-2 Workload................................................................................................................................... 16-2 Data Modifications................................................................................................................... 16-2 Schema Design ......................................................................................................................... 16-3 Typical Operations................................................................................................................... 16-3 Historical Data.......................................................................................................................... 16-3 Data Warehouse Architecture ....................................................................................................... 16-3 Data Warehouse Architecture (Basic) ................................................................................... 16-3 Data Warehouse Architecture (with a Staging Area) ......................................................... 16-4 Data Warehouse Architecture (with a Staging Area and Data Marts)............................. 16-5 Overview of Extraction, Transformation, and Loading (ETL) ...................................................... 16-6 Transportable Tablespaces............................................................................................................. 16-7 Table Functions................................................................................................................................ 16-7 External Tables ................................................................................................................................ 16-8 Table Compression ......................................................................................................................... 16-8 Change Data Capture ..................................................................................................................... 16-9 Overview of Materialized Views for Data Warehouses................................................................. 16-9 Overview of Bitmap Indexes in Data Warehousing ..................................................................... 16-10 Overview of Parallel Execution ........................................................................................................ 16-11 How Parallel Execution Works ................................................................................................... 16-11 Overview of Analytic SQL ................................................................................................................ 16-12 SQL for Aggregation..................................................................................................................... 16-13 SQL for Analysis............................................................................................................................ 16-13 SQL for Modeling.......................................................................................................................... 16-14 Overview of OLAP Capabilities....................................................................................................... 16-14 Benefits of OLAP and RDBMS Integration ............................................................................... 16-14 Scalability ................................................................................................................................ 16-15 Availability.............................................................................................................................. 16-15 Manageability ......................................................................................................................... 16-15 Backup and Recovery ............................................................................................................ 16-15 Security .................................................................................................................................... 16-16 Overview of Data Mining.................................................................................................................. 16-1617 High Availability Introduction to High Availability ...................................................................................................... 17-1 Overview of Unplanned Downtime.................................................................................................. 17-1 Oracle Solutions to System Failures ............................................................................................. 17-1 Overview of Fast-Start Fault Recovery ................................................................................ 17-2 Overview of Real Application Clusters ................................................................................ 17-2 Oracle Solutions to Data Failures.................................................................................................. 17-2 Overview of Backup and Recovery Features for High Availability................................. 17-2 Overview of Partitioning ....................................................................................................... 17-3 Overview of Transparent Application Failover .................................................................. 17-4 Oracle Solutions to Disasters ......................................................................................................... 17-5 Overview of Oracle Data Guard ............................................................................................ 17-5xvi

×