Home Page Icon
Home Page
Table of Contents for
About the Technical Reviewers
Close
About the Technical Reviewers
by Thomas Kyte
Expert Oracle Database Architecture: Oracle Database 9
Copyright
Foreword
Foreword from the First Edition
About the Author
About the Technical Reviewers
Acknowledgments
Introduction
What This Book Is About
Who Should Read This Book
How This Book Is Structured
Chapter 1: Developing Successful Oracle Applications
Chapter 2: Architecture Overview
Chapter 3: Files
Chapter 4: Memory Structures
Chapter 5: Oracle Processes
Chapter 6: Locking and Latching
Chapter 7: Concurrency and Multi-versioning
Chapter 8: Transactions
Chapter 9: Redo and Undo
Chapter 10: Database Tables
Chapter 11: Indexes
Chapter 12: Datatypes
Chapter 13: Partitioning
Chapter 14: Parallel Execution
Chapter 15: Data Loading and Unloading
Chapter 16: Data Encryption
Source Code and Updates
Errata
Setting Up Your Environment
Setting up the SCOTT/TIGER Schema
Executing the Script
Creating the Schema without the Script
Setting Your Environment
Setting up Autotrace in SQL*Plus
Initial Setup
Controlling the Report
Setting up Statspack
Custom Scripts
Runstats
Mystat
Show_Space
Big_Table
Coding Conventions
1. Developing Successful Oracle Applications
1.1. My Approach
1.2. The Black Box Approach
1.3. How (and How Not) to Develop Database Applications
1.3.1. Understanding Oracle Architecture
1.3.1.1. Use a Single Connection in Oracle
1.3.1.2. Use Bind Variables
1.3.2. Understanding Concurrency Control
1.3.2.1. Implementing Locking
1.3.2.2. Preventing Lost Updates
1.3.3. Multi-versioning
1.3.3.1. Flashback
1.3.3.2. Read Consistency and Non-Blocking Reads
1.3.4. Database Independence?
1.3.4.1. The Impact of Standards
1.3.4.2. Make Sure You Can Adapt
1.3.4.3. Layered Programming
1.3.4.4. Features and Functions
1.3.4.5. Knowing What's Out There
1.3.4.6. Solving Problems Simply
1.3.4.7. Openness
1.3.5. How Do I Make It Run Faster?
1.3.6. The DBA-Developer Relationship
1.4. Summary
2. Architecture Overview
2.1. Defining Database and Instance
2.1.1. The SGA and Background Processes
2.2. Connecting to Oracle
2.2.1. Dedicated Server
2.2.2. Shared Server
2.2.3. Mechanics of Connecting over TCP/IP
2.3. Summary
3. Files
3.1. Parameter Files
3.1.1. What Are Parameters?
3.1.2. Legacy init.ora Parameter Files
3.2. Server Parameter Files (SPFILEs)
3.2.1. Converting to SPFILEs
3.2.1.1. Setting Values in SPFILEs
3.2.1.2. Unsetting Values in SPFILEs
3.2.1.3. Creating PFILEs from SPFILEs
3.2.1.4. Fixing Corrupted SPFILEs
3.2.1.5. Parameter File Wrap-up
3.3. Trace Files
3.3.1. Requested Trace Files
3.3.1.1. File Locations
3.3.1.2. Naming Convention
3.3.1.3. Tagging Trace Files
3.3.2. Trace Files Generated in Response to Internal Errors
3.3.3. Trace File Wrap-up
3.4. Alert File
3.5. Data Files
3.5.1. A Brief Review of File System Mechanisms
3.5.2. The Storage Hierarchy in an Oracle Database
3.5.2.1. Segments
3.5.2.2. Extents
3.5.2.3. Blocks
3.5.2.4. Tablespaces
3.5.2.5. Storage Hierarchy Summary
3.5.3. Dictionary-Managed and Locally-Managed Tablespaces
3.6. Temp Files
3.7. Control Files
3.8. Redo Log Files
3.8.1. Online Redo Log
3.8.2. Archived Redo Log
3.9. Password Files
3.10. Change Tracking File
3.11. Flashback Logs
3.11.1. Flashback Database
3.11.2. Flash Recovery Area
3.12. DMP Files (EXP/IMP Files)
3.13. Data Pump Files
3.14. Flat Files
3.15. Summary
4. Memory Structures
4.1. The Process Global Area and User Global Area
4.1.1. Manual PGA Memory Management
4.1.2. Automatic PGA Memory Management
4.1.2.1. Determining How the Memory Is Allocated
4.1.2.2. Using PGA_AGGREGATE_TARGET to Control Memory Allocation
4.1.3. Choosing Between Manual and Auto Memory Management
4.1.4. PGA and UGA Wrap-up
4.2. The System Global Area
4.2.1. Fixed SGA
4.2.2. Redo Buffer
4.2.3. Block Buffer Cache
4.2.3.1. Managing Blocks in the Buffer Cache
4.2.3.2. Multiple Block Sizes
4.2.4. Shared Pool
4.2.5. Large Pool
4.2.6. Java Pool
4.2.7. Streams Pool
4.2.8. Automatic SGA Memory Management
4.2.9. Automatic Memory Management
4.3. Summary
5. Oracle Processes
5.1. Server Processes
5.1.1. Dedicated Server Connections
5.1.2. Shared Server Connections
5.1.3. Database Resident Connection Pooling (DRCP)
5.1.4. Connections vs. Sessions
5.1.5. Dedicated Server vs. Shared Server vs. DRCP
5.1.5.1. When to Use Dedicated Server
5.1.5.2. When to Use Shared Server
5.1.5.3. Potential Benefits of Shared Server
5.1.5.3.1. Reduces the Number of Operating System Processes/Threads
5.1.5.3.2. Artificially Limits the Degree of Concurrency
5.1.5.3.3. Reduces the Memory Needed on the System
5.1.5.4. DRCP
5.1.6. Dedicated/Shared Server Wrap-up
5.2. Background Processes
5.2.1. Focused Background Processes
5.2.1.1. PMON: The Process Monitor
5.2.1.2. SMON: The System Monitor
5.2.1.3. RECO: Distributed Database Recovery
5.2.1.4. CKPT: Checkpoint Process
5.2.1.5. DBWn: Database Block Writer
5.2.1.6. LGWR: Log Writer
5.2.1.7. ARCn: Archive Process
5.2.1.8. DIAG: Diagnosability Process
5.2.1.9. FBDA: Flashback Data Archiver Process
5.2.1.10. DBRM: Database ResourceManager Process
5.2.1.11. GEN0: General Task Execution Process
5.2.1.12. Remaining Common Focused Processes
5.2.2. Utility Background Processes
5.2.2.1. CJQ0 and Jnnn Processes: Job Queues
5.2.2.2. QMNC and Qnnn: Advanced Queues
5.2.2.3. EMNC: Event Monitor Processes
5.2.2.4. MMAN: Memory Manager
5.2.2.5. MMON, MMNL, and Mnnn: Manageability Monitors
5.2.2.6. CTWR: Change Tracking Processes
5.2.2.7. RVWR: Recovery Writer
5.2.2.8. DMnn/DWnn: Data Pump Master/Worker Processes
5.2.2.9. Remaining Utility Background Processes
5.3. Slave Processes
5.3.1. I/O Slaves
5.3.2. Pnnn: Parallel Query Execution Servers
5.4. Summary
6. Locking and Latching
6.1. What Are Locks?
6.2. Locking Issues
6.2.1. Lost Updates
6.2.2. Pessimistic Locking
6.2.3. Optimistic Locking
6.2.3.1. Optimistic Locking Using a Version Column
6.2.3.2. Optimistic Locking Using a Checksum
6.2.4. Optimistic or Pessimistic Locking?
6.2.5. Blocking
6.2.5.1. Blocked Inserts
6.2.5.2. Blocked Merges, Updates, and Deletes
6.2.6. Deadlocks
6.2.7. Lock Escalation
6.3. Lock Types
6.3.1. DML Locks
6.3.1.1. TX (Transaction) Locks
6.3.1.2. TM (DML Enqueue) Locks
6.3.2. DDL Locks
6.3.3. Latches
6.3.3.1. Latch "Spinning"
6.3.3.2. Measuring the Cost of Latching a Shared Resource
6.3.3.2.1. Setting Up for the Test
6.3.3.2.2. Without Bind Variables
6.3.3.2.3. With Bind Variables
6.3.3.2.4. Performance/Scalability Comparison
6.3.4. Mutexes
6.3.5. Manual Locking and User-Defined Locks
6.3.5.1. Manual Locking
6.3.5.2. Creating Your Own Locks
6.4. Summary
7. Concurrency and Multi-versioning
7.1. What Are Concurrency Controls?
7.2. Transaction Isolation Levels
7.2.1. READ UNCOMMITTED
7.2.2. READ COMMITTED
7.2.3. REPEATABLE READ
7.2.3.1. Getting a Consistent Answer
7.2.3.2. Lost Updates: Another Portability Issue
7.2.4. SERIALIZABLE
7.2.5. READ ONLY
7.3. Implications of Multi-version Read Consistency
7.3.1. A Common Data Warehousing Technique That Fails
7.3.2. An Explanation for Higher Than Expected I/O on Hot Tables
7.4. Write Consistency
7.4.1. Consistent Reads and Current Reads
7.4.2. Seeing a Restart
7.4.3. Why Is a Restart Important to Us?
7.5. Summary
8. Transactions
8.1. Transaction Control Statements
8.2. Atomicity
8.2.1. Statement-Level Atomicity
8.2.2. Procedure-Level Atomicity
8.2.3. Transaction-Level Atomicity
8.2.4. DDL and Atomicity
8.3. Durability
8.3.1. WRITE Extensions to COMMIT
8.3.2. COMMITS in a Non-Distributed PL/SQL Block
8.4. Integrity Constraints and Transactions
8.4.1. IMMEDIATE Constraints
8.4.2. DEFERRABLE Constraints and Cascading Updates
8.5. Bad Transaction Habits
8.5.1. Committing in a Loop
8.5.1.1. Performance Implications
8.5.1.2. Snapshot Too Old Error
8.5.1.3. Restartable Processes Require Complex Logic
8.5.2. Using Autocommit
8.6. Distributed Transactions
8.7. Autonomous Transactions
8.7.1. How Autonomous Transactions Work
8.7.2. When to Use Autonomous Transactions
8.8. Summary
9. Redo and Undo
9.1. What Is Redo?
9.2. What Is Undo?
9.3. How Redo and Undo Work Together
9.3.1. Example INSERT-UPDATE-DELETE Scenario
9.3.1.1. The INSERT
9.3.1.1.1. Hypothetical Scenario: The System Crashes Right Now
9.3.1.1.2. Hypothetical Scenario: The Buffer Cache Fills Up Right Now
9.3.1.2. The UPDATE
9.3.1.2.1. Hypothetical Scenario: The System Crashes Right Now
9.3.1.2.2. Hypothetical Scenario: The Application Rolls Back the Transaction
9.3.1.3. The DELETE
9.3.1.4. The COMMIT
9.4. Commit and Rollback Processing
9.4.1. What Does a COMMIT Do?
9.4.2. What Does a ROLLBACK Do?
9.5. Investigating Redo
9.5.1. Measuring Redo
9.5.2. Can I Turn Off Redo Log Generation?
9.5.2.1. Setting NOLOGGING in SQL
9.5.2.2. Setting NOLOGGING on an Index
9.5.2.3. NOLOGGING Wrap-up
9.5.3. Why Can't I Allocate a New Log?
9.5.4. Block Cleanout
9.5.5. Log Contention
9.5.6. Temporary Tables and Redo/Undo
9.6. Investigating Undo
9.6.1. What Generates the Most and Least Undo?
9.6.2. ORA-01555: snapshot too old Error
9.6.2.1. Undo Segments Are in Fact Too Small
9.6.2.2. Delayed Block Cleanout
9.7. Summary
10. Database Tables
10.1. Types of Tables
10.2. Terminology
10.2.1. Segment
10.2.2. Segment Space Management
10.2.3. High-water Mark
10.2.4. FREELISTS
10.2.5. PCTFREE and PCTUSED
10.2.5.1. Row Migration
10.2.5.2. Setting PCTFREE and PCTUSED Values
10.2.6. LOGGING and NOLOGGING
10.2.7. INITRANS and MAXTRANS
10.3. Heap Organized Tables
10.4. Index Organized Tables
10.4.1. Index Organized Tables Wrap-up
10.5. Index Clustered Tables
10.5.1. Index Clustered Tables Wrap-up
10.6. Hash Clustered Tables
10.6.1. Hash Clustered Tables Wrap-up
10.7. Sorted Hash Clustered Tables
10.8. Nested Tables
10.8.1. Nested Tables Syntax
10.8.2. Nested Table Storage
10.8.3. Nested Tables Wrap-up
10.9. Temporary Tables
10.9.1. Temporary Tables Wrap-up
10.10. Object Tables
10.10.1. Object Tables Wrap-up
10.11. Summary
11. Indexes
11.1. An Overview of Oracle Indexes
11.2. B*Tree Indexes
11.2.1. Index Key Compression
11.2.2. Reverse Key Indexes
11.2.3. Descending Indexes
11.2.4. When Should You Use a B*Tree Index?
11.2.4.1. Physical Organization
11.2.4.2. The Clustering Factor
11.2.5. B*Trees Wrap-up
11.3. Bitmap Indexes
11.3.1. When Should You Use a Bitmap Index?
11.3.2. Bitmap Join Indexes
11.3.3. Bitmap Indexes Wrap-up
11.4. Function-Based Indexes
11.4.1. Important Implementation Details
11.4.2. A Simple Function-Based Index Example
11.4.3. Indexing Only Some of the Rows
11.4.4. Implementing Selective Uniqueness
11.4.5. Caveat Regarding ORA-01743
11.4.6. Function-Based Indexes Wrap-up
11.5. Application Domain Indexes
11.6. Frequently Asked Questions and Myths About Indexes
11.6.1. Do Indexes Work on Views?
11.6.2. Do Nulls and Indexes Work Together?
11.6.3. Should Foreign Keys Be Indexed?
11.6.4. Why Isn't My Index Getting Used?
11.6.4.1. Case 1
11.6.4.2. Case 2
11.6.4.3. Case 3
11.6.4.4. Case 4
11.6.4.5. Case 5
11.6.4.6. Case 6
11.6.4.7. Index Case Summary
11.6.5. Myth: Space Is Never Reused in an Index
11.6.6. Myth: Most Discriminating Elements Should Be First
11.7. Summary
12. Datatypes
12.1. An Overview of Oracle Datatypes
12.2. Character and Binary String Types
12.2.1. NLS Overview
12.2.2. Character Strings
12.2.2.1. Character String Syntax
12.2.2.2. Bytes or Characters
12.2.2.3. The "N" Variant
12.3. Binary Strings: RAW Types
12.4. Number Types
12.4.1. NUMBER Type Syntax and Usage
12.4.2. BINARY_FLOAT/BINARY_DOUBLE Type Syntax and Usage
12.4.3. Non-native Number Types
12.4.4. Performance Considerations
12.5. Long Types
12.5.1. Restrictions on LONG and LONG RAW Types
12.5.2. Coping with Legacy LONG Types
12.6. Dates, Timestamps, and Interval Types
12.6.1. Formats
12.6.2. DATE Type
12.6.2.1. Adding or Subtracting Time from a DATE
12.6.2.2. Getting the Difference Between Two DATEs
12.6.3. TIMESTAMP Type
12.6.3.1. TIMESTAMP
12.6.3.2. Adding or Subtracting Time from a TIMESTAMP
12.6.3.3. Getting the Difference Between Two TIMESTAMPs
12.6.3.4. TIMESTAMP WITH TIME ZONE Type
12.6.3.5. TIMESTAMP WITH LOCAL TIME ZONE Type
12.6.4. INTERVAL Type
12.6.4.1. INTERVAL YEAR TO MONTH
12.6.4.2. INTERVAL DAY TO SECOND
12.7. LOB Types
12.7.1. Internal LOBs
12.7.1.1. LOB Tablespace
12.7.1.2. IN ROW Clause
12.7.1.3. CHUNK Clause
12.7.1.4. RETENTION Clause
12.7.1.5. CACHE Clause
12.7.1.6. LOB STORAGE Clause
12.7.2. BFILEs
12.8. ROWID/UROWID Types
12.9. Summary
13. Partitioning
13.1. Partitioning Overview
13.1.1. Increased Availability
13.1.2. Reduced Administrative Burden
13.1.3. Enhanced Statement Performance
13.1.3.1. Parallel DML
13.1.3.2. Query Performance
13.1.3.2.1. OLTP Systems
13.1.3.2.2. Data Warehouse Systems
13.2. Table Partitioning Schemes
13.2.1. Range Partitioning
13.2.2. Hash Partitioning
13.2.2.1. How Hash Partitioning Works
13.2.2.2. Hash Partition Using Powers of Two
13.2.3. List Partitioning
13.2.4. Interval Partitioning
13.2.5. Reference Partitioning
13.2.6. Composite Partitioning
13.2.7. Row Movement
13.2.8. Table Partitioning Schemes Wrap-up
13.3. Partitioning Indexes
13.3.1. Local Indexes vs. Global Indexes
13.3.2. Local Indexes
13.3.2.1. Partition Elimination Behavior
13.3.2.2. Local Indexes and Unique Constraints
13.3.3. Global Indexes
13.3.3.1. Data Warehousing and Global Indexes
13.3.3.2. Sliding Windows and Indexes
13.3.3.3. "Live" Global Index Maintenance
13.3.3.4. OLTP and Global Indexes
13.4. Partitioning and Performance, Revisited
13.5. Auditing and Segment Space Compression
13.6. Summary
14. Parallel Execution
14.1. When to Use Parallel Execution
14.1.1. A Parallel Processing Analogy
14.1.1.1. One-Page Summary
14.1.1.2. Ten-Chapter Report
14.2. Oracle Exadata
14.3. Parallel Query
14.4. Parallel DML
14.5. Parallel DDL
14.5.1. Parallel DDL and Data Loading Using External Tables
14.5.2. Parallel DDL and Extent Trimming
14.5.2.1. Extent Trimming and Dictionary-Managed Tablespaces
14.5.2.2. Extent Trimming and Locally-Managed Tablespaces
14.5.2.3. Setting Up for Locally-Managed Tablespaces
14.5.2.4. Extent Trimming with UNIFORM vs. AUTOALLOCATE Locally-Managed Tablespaces
14.6. Parallel Recovery
14.7. Procedural Parallelism
14.7.1. Parallel Pipelined Functions
14.7.2. Do-It-Yourself Parallelism
14.7.3. Old School Do-It-Yourself Parallelism
14.8. Summary
15. Data Loading and Unloading
15.1. SQL*Loader
15.1.1. Loading Data with SQLLDR FAQs
15.1.1.1. Why do I receive "exceeds maximum length" in my log file?
15.1.1.2. How Do I Load Delimited Data?
15.1.1.3. How Do I Load Fixed Format Data?
15.1.1.4. How Do I Load Dates?
15.1.1.5. How Do I Load Data Using Functions?
15.1.1.6. How Do I Load Data with Embedded Newlines?
15.1.1.6.1. Use a Character Other Than a Newline
15.1.1.6.2. Use the FIX Attribute
15.1.1.6.3. Use the VAR Attribute
15.1.1.6.4. Use the STR Attribute
15.1.1.6.5. Embedded Newlines Wrap-up
15.1.1.7. How Do I Load LOBs?
15.1.1.7.1. Loading a LOB via PL/SQL
15.1.1.7.2. Loading LOB Data via SQLLDR
15.1.1.8. How Do I Call SQLLDR from a Stored Procedure?
15.1.2. SQLLDR Caveats
15.1.2.1. TRUNCATE Appears to Work Differently
15.1.2.2. SQLLDR Defaults to CHAR(255)
15.1.2.3. Command Line Overrides Control File
15.1.3. SQLLDR Summary
15.2. External Tables
15.2.1. Setting Up External Tables
15.2.2. Dealing with Errors
15.2.3. Using an External Table to Load Different Files
15.2.4. Multiuser Issues
15.2.5. External Tables Summary
15.3. Flat File Unload
15.4. Data Pump Unload
15.5. Summary
16. Data Encryption
16.1. Types of Encryption
16.1.1. Data in Motion
16.1.2. Data at Rest
16.1.3. Manual Application Encryption
16.1.4. The Oracle Wallet
16.1.4.1. Understanding the Wallet
16.1.4.2. Setting up the Oracle Wallet
16.1.5. Transparent Column Level Encryption
16.1.6. Transparent Tablespace Encryption
16.2. What Encryption Is Not About
16.3. Implementing Manual Application Encryption
16.3.1. Reasons to Avoid the Manual Approach
16.3.2. Performance Implications of the Manual Approach
16.3.3. When to Use the Manual Approach
16.4. Implementing Column Level Encryption
16.4.1. How to Use Column Encryption
16.4.2. Data Storage with Column Encryption
16.4.2.1. Increased Storage with Column Encryption
16.4.2.2. Storage in the SGA
16.4.3. Measuring the Performance Impact of Column Encryption
16.4.4. Influences on the Magnitude
16.4.4.1. Understanding What You Measure
16.4.4.2. Impact of Encryption
16.4.4.3. Cost of Data Retrieval
16.4.4.4. Statistics on Encrypted Columns
16.4.5. Limitations of Column Encryption
16.5. Implementing Tablespace Encryption
16.5.1. How to Use Tablespace Encryption
16.5.2. Data Storage with Tablespace Encryption
16.5.2.1. Storage on Disk
16.5.2.2. Storage in the SGA
16.5.3. Measuring the Performance Impact of Tablespace Encryption
16.6. Deciding on an Encryption Technique
16.7. Summary
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
About the Author
Next
Next Chapter
Acknowledgments
About the Technical Reviewers
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset