13
Contents at a Glance PART I Getting Started 1 Introduction to Databases and Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 Install and Start Using Oracle Database 10g Express Edition . . . . . . . . . . . . 13 PART II Fundamentals of Application Development 3 Access Database Data with SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 4 Code Database Access Programs with PL/SQL . . . . . . . . . . . . . . . . . . . . . . . 93 5 Build a Basic Relational Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 6 Build an Application with Oracle Application Express . . . . . . . . . . . . . . . . . . 207 PART III Database Administration 7 Secure Database Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 8 Manage Database Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 9 Protect Your Oracle XE Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371 10 Tune Application and Database Instance Performance . . . . . . . . . . . . . . . . 455 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503 vii

Contents at a Glance - mhp · PDF filePART II Fundamentals of Application Development 3 Access Database Data with SQL ... Oracle Database 10g

  • Upload
    lamdat

  • View
    216

  • Download
    3

Embed Size (px)

Citation preview

Contents at a Glance

PART IGetting Started

1 Introduction to Databases and Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Install and Start Using Oracle Database 10g Express Edition . . . . . . . . . . . . 13

PART IIFundamentals of Application Development

3 Access Database Data with SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

4 Code Database Access Programs with PL/SQL . . . . . . . . . . . . . . . . . . . . . . . 93

5 Build a Basic Relational Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

6 Build an Application with Oracle Application Express . . . . . . . . . . . . . . . . . . 207

PART IIIDatabase Administration

7 Secure Database Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287

8 Manage Database Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331

9 Protect Your Oracle XE Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371

10 Tune Application and Database Instance Performance . . . . . . . . . . . . . . . . 455

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503

Oracle-Regular / Hands-On Oracle Database 10g Express Edition for Linux / Steve Bobrowski / 226327-X / Front Matter

vii

FM.indd 7 6/29/06 9:48:31 AM

Contents

FOREWORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiACKNOWLEDGMENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiiiINTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv

PART IGetting Started

1 Introduction to Databases and Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Information Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Database Management Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Database Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Oracle Database 10g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Oracle Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Databases and Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9SQL and Data Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Database Users and Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10SQL*Plus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Oracle Application Express . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2 Install and Start Using Oracle Database 10g Express Edition . . . . . . . . . . . 13Installation Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Database Server System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

EXERCISE 2.1: Check System Requirements . . . . . . . . . . . . . . 17Oracle Database 10g Express Edition Software . . . . . . . . . . . . . . . . . . . . . . . 18Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

EXERCISE 2.2: Confirm Administrative Access with sudo . . . . 19EXERCISE 2.3: Install Oracle XE Step-by-Step . . . . . . . . . . . . . 19

Oracle-Regular / Hands-On Oracle Database 10g Express Edition for Linux / Steve Bobrowski / 226327-X / Front Matter

ix

FM.indd 9 6/29/06 9:48:31 AM

x Hands-On Oracle Database 10g Express Edition for Linux

Oracle-Regular / Hands-On Oracle Database 10g Express Edition for Linux / Steve Bobrowski / 226327-X / Front Matter

Contents xi

Post-Installation Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22EXERCISE 2.4: Accessing the Documentation . . . . . . . . . . . . . 22EXERCISE 2.5: Registering for the Discussion Forum . . . . . . . . 24EXERCISE 2.6: Accessing the Support Forum . . . . . . . . . . . . . 25

Basic Oracle XE Skills . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26Oracle Startup and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

EXERCISE 2.7: Check the Status of Oracle XE . . . . . . . . . . . . . 27EXERCISE 2.8: Start Oracle Manually . . . . . . . . . . . . . . . . . . . 28EXERCISE 2.9: Stop Oracle Manually . . . . . . . . . . . . . . . . . . . 29EXERCISE 2.10: Using Shell Scripts to Manage Oracle

Availability on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29EXERCISE 2.11: Automate Oracle Startup . . . . . . . . . . . . . . . . 31

Database Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31EXERCISE 2.12: Connect to Oracle with SQL*Plus . . . . . . . . . 33EXERCISE 2.13: Disconnect from Oracle and Exit SQL*Plus . . 35EXERCISE 2.14: Launch the Database Home Page . . . . . . . . . 35

Troubleshooting Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Confirm Existence of Oracle XE Software and Database . . . . . . . . . . 38Check Oracle-Related Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38Permit Network Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Web Browser Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

Oracle Database 10g Express Edition Updates . . . . . . . . . . . . . . . . . . . . . . . 41Using This Book’s Support Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

PART IIFundamentals of Application Development

3 Access Database Data with SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47Chapter Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48What Is SQL? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

Types of SQL Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48Application Portability and the ANSI/ISO SQL Standard . . . . . . . . . . 49Ad Hoc SQL Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

Retrieving Data with Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50The Structure of a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51Building Basic Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

EXERCISE 3.1: Retrieving All Columns and Rows . . . . . . . . . . 52EXERCISE 3.2: Retrieving Specific Columns . . . . . . . . . . . . . . 52EXERCISE 3.3: Using the SQL*Plus DESCRIBE Command . . . . 53EXERCISE 3.4: Specifying an Alias for a Column . . . . . . . . . . . 54

Building Expressions in a Query’s SELECT Clause . . . . . . . . . . . . . . . 54EXERCISE 3.5: Building SELECT Clause Expressions

with the Concatenation String Operator . . . . . . . . . . . . . . . 55

FM.indd 10 6/29/06 9:48:32 AM

x Hands-On Oracle Database 10g Express Edition for Linux Contents xi

Oracle-Regular / Hands-On Oracle Database 10g Express Edition for Linux / Steve Bobrowski / 226327-X / Front Matter

EXERCISE 3.6: Building SELECT Clause Expressions with Arithmetic Operators . . . . . . . . . . . . . . . . . . . . . . . . . 55

EXERCISE 3.7: Building SELECT Clause Expressions with SQL Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

EXERCISE 3.8: Working with Nulls in SELECT Clause Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

EXERCISE 3.9: Implementing Conditional Logic in SELECT Clause Expressions . . . . . . . . . . . . . . . . . . . . . . 59

Retrieving Specific Rows from Tables . . . . . . . . . . . . . . . . . . . . . . . . 61EXERCISE 3.10: Building WHERE Clause Conditions

with Relational Operators . . . . . . . . . . . . . . . . . . . . . . . . . 61EXERCISE 3.11: Building WHERE Clause

Conditions with Subqueries . . . . . . . . . . . . . . . . . . . . . . . . 66EXERCISE 3.12: Building Composite WHERE

Clause Conditions with Logical Operators . . . . . . . . . . . . . 68Grouping and Sorting Data Within a Query’s Result Set . . . . . . . . . . 69

EXERCISE 3.13: Grouping Records in a Query’s Result Set . . . 69EXERCISE 3.14: Rolling Up Groups into Supergroups . . . . . . . 70EXERCISE 3.15: Ordering Records in a Query’s Result Set . . . 73

Joining Data in Related Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74EXERCISE 3.16: Building an Inner Join of Two Tables . . . . . . . 75EXERCISE 3.17: Building an Outer Join of Two Tables . . . . . . 76

Inserting, Updating, and Deleting Rows in Tables . . . . . . . . . . . . . . . . . . . . 78EXERCISE 3.18: Inserting New Rows into a Table . . . . . . . . . . 78EXERCISE 3.19: Updating Rows in a Table . . . . . . . . . . . . . . . 79EXERCISE 3.20: Deleting Rows from a Table . . . . . . . . . . . . . 79

Committing and Rolling Back Transactions . . . . . . . . . . . . . . . . . . . . . . . . . 79EXERCISE 3.21: Committing and Rolling Back Transactions . . . 79

Transaction Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80Units of Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80Read-Write Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82Read-Only Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

Building SQL with Oracle Application Express . . . . . . . . . . . . . . . . . . . . . . . 82Introducing Oracle Application Express’s Query Builder . . . . . . . . . . 83

Exercise 3.22: Using Query Builder . . . . . . . . . . . . . . . . . . . . 83Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

4 Code Database Access Programs with PL/SQL . . . . . . . . . . . . . . . . . . . . . . 93Chapter Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94What Is PL/SQL? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94PL/SQL Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

Program Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96The Program Body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96Exception Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96Program Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

FM.indd 11 6/29/06 9:48:32 AM

xii Hands-On Oracle Database 10g Express Edition for Linux

Oracle-Regular / Hands-On Oracle Database 10g Express Edition for Linux / Steve Bobrowski / 226327-X / Front Matter

Contents xiii

The Fundamentals of PL/SQL Coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97Working with Program Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

EXERCISE 4.1: Declaring Variables and Constants with Basic Datatypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

EXERCISE 4.2: Assigning Values to Variables . . . . . . . . . . . . . 102Controlling Program Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

EXERCISE 4.3: Using PL/SQL Loops . . . . . . . . . . . . . . . . . . . . 104EXERCISE 4.4: Using the PL/SQL Command

IF ... ELSIF ... ELSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105Interacting with Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

EXERCISE 4.5: Manipulating Table Data with DML Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

EXERCISE 4.6: Assigning a Value to a Variable with a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

Declaring and Using Subprograms: Procedures and Functions . . . . . 109EXERCISE 4.7: Declaring and Using a Procedure . . . . . . . . . . 109EXERCISE 4.8: Declaring and Using a Function . . . . . . . . . . . 110

Working with Record Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112EXERCISE 4.9: Declaring and Using Record Types . . . . . . . . . 112

Using the %TYPE and %ROWTYPE Attributes . . . . . . . . . . . . . . . . . . 114EXERCISE 4.10: Using the %TYPE Attribute . . . . . . . . . . . . . . 114EXERCISE 4.11: Using the %ROWTYPE Attribute . . . . . . . . . . 115

Working with Cursors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116EXERCISE 4.12: Declaring and Using a Cursor . . . . . . . . . . . . 117EXERCISE 4.13: Manipulating a Cursor’s Current Row . . . . . . 119

Working with Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121EXERCISE 4.14: Declaring and Initializing a Nested Table . . . 121EXERCISE 4.15: Using Collection Methods

with a Nested Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122Handling Program Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

EXERCISE 4.16: Handling Predefined Exceptions . . . . . . . . . . 126EXERCISE 4.17: Declaring and Handling

User-Defined Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . 128Types of PL/SQL Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

Anonymous PL/SQL Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129Stored Procedures and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

EXERCISE 4.18: Creating and Using Stored Procedures . . . . . . 129EXERCISE 4.19: Creating and Using Stored Functions . . . . . . . 131

Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132EXERCISE 4.20: Declaring and Using a Package . . . . . . . . . . . 132

Database Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137EXERCISE 4.21: Creating and Using Database Triggers . . . . . . 138

Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140

FM.indd 12 6/29/06 9:48:33 AM

xii Hands-On Oracle Database 10g Express Edition for Linux Contents xiii

Oracle-Regular / Hands-On Oracle Database 10g Express Edition for Linux / Steve Bobrowski / 226327-X / Front Matter

5 Build a Basic Relational Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141Chapter Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142Schemas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142

Schemas, an Entirely Logical Concept . . . . . . . . . . . . . . . . . . . . . . . . 143The Correlation of Schemas and Database User Accounts . . . . . . . . . 144

Database Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144Columns and Datatypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145Data Integrity and Integrity Constraints . . . . . . . . . . . . . . . . . . . . . . . 149Creating Tables and Integrity Constraints . . . . . . . . . . . . . . . . . . . . . . 152

EXERCISE 5.1: Start the Object Browser . . . . . . . . . . . . . . . . . 153EXERCISE 5.2: Create the PARTS Table . . . . . . . . . . . . . . . . . . 154EXERCISE 5.3: Create the CUSTOMERS Table . . . . . . . . . . . . 158EXERCISE 5.4: Modify a Column’s Datatype . . . . . . . . . . . . . . 160EXERCISE 5.5: Add a Primary Key to a Table . . . . . . . . . . . . . 161EXERCISE 5.6: Add a Composite Unique Key to a Table . . . . . 162EXERCISE 5.7: Add a Not Null Constraint to a Table . . . . . . . 162EXERCISE 5.8: Create the SALESREPS Table . . . . . . . . . . . . . . 163EXERCISE 5.9: Create the ORDERS Table . . . . . . . . . . . . . . . . 164EXERCISE 5.10: Create the ITEMS Table . . . . . . . . . . . . . . . . . 167EXERCISE 5.11: Add a Column and Referential

Integrity Constraint to a Table . . . . . . . . . . . . . . . . . . . . . . 170EXERCISE 5.12: Test Integrity Constraints . . . . . . . . . . . . . . . . 173

Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178Creating Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178

EXERCISE 5.13: Create and Use a Read-Only View . . . . . . . . 179EXERCISE 5.14: Create an Updateable View . . . . . . . . . . . . . . 180EXERCISE 5.15: Create an Updateable Join View . . . . . . . . . . 182EXERCISE 5.16: Create an INSTEAD OF Trigger for a View . . 184

Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186Creating and Using Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187

EXERCISE 5.17: Create a Sequence . . . . . . . . . . . . . . . . . . . . . 187EXERCISE 5.18: Use and Reuse a Sequence Number . . . . . . . 188

Synonyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189Private and Public Synonyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189Creating Synonyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190

EXERCISE 5.19: Create a Private Synonym . . . . . . . . . . . . . . . 190EXERCISE 5.20: Using a Synonym . . . . . . . . . . . . . . . . . . . . . 190

Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191Normal (B*) Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192Using Normal Indexes Appropriately . . . . . . . . . . . . . . . . . . . . . . . . 192Creating Normal Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193

EXERCISE 5.21: Create a Normal Index . . . . . . . . . . . . . . . . . 193

FM.indd 13 6/29/06 9:48:33 AM

xiv Hands-On Oracle Database 10g Express Edition for Linux

Oracle-Regular / Hands-On Oracle Database 10g Express Edition for Linux / Steve Bobrowski / 226327-X / Front Matter

The Data Dictionary: A Unique Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . 195Categories of Data Dictionary Views . . . . . . . . . . . . . . . . . . . . . . . . . 195

EXERCISE 5.22: Query the Data Dictionary . . . . . . . . . . . . . . 196Exploring Other Object Browser Features . . . . . . . . . . . . . . . . . . . . . . . . . . 200

EXERCISE 5.23: Reveal Object Dependencies . . . . . . . . . . . . 200EXERCISE 5.24: Gather Object Statistics . . . . . . . . . . . . . . . . . 203EXERCISE 5.25: Generate Object DML . . . . . . . . . . . . . . . . . . 204

Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

6 Build an Application with Oracle Application Express . . . . . . . . . . . . . . . . . 207Chapter Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208Introducing the Application Development Lifecycle . . . . . . . . . . . . . . . . . . . 209

Analyzing Processes and Defining Requirements . . . . . . . . . . . . . . . 210Designing the Application to Meet the Requirements . . . . . . . . . . . . 211Implementing the Application Using the Design . . . . . . . . . . . . . . . . 211Testing That the Application Meets the Requirements . . . . . . . . . . . . 212Deploying the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212Maintaining the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213

Software Modeling and the Unified Modeling Language . . . . . . . . . . . . . . . 213Use Case Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214Class Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215

Building the Application Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217EXERCISE 6.1: Upload and Run a SQL Script . . . . . . . . . . . . . 217EXERCISE 6.2: Set User Interface Defaults . . . . . . . . . . . . . . . 219

Loading Schema Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223Loading Data Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

EXERCISE 6.3: Manually Enter Data . . . . . . . . . . . . . . . . . . . . 223EXERCISE 6.4: Create Triggers to Generate Primary Keys . . . . 224

Loading Spreadsheet and Text File Data . . . . . . . . . . . . . . . . . . . . . . 227EXERCISE 6.5: Load Data from a Text File . . . . . . . . . . . . . . . 227

Loading XML Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229EXERCISE 6.6: Load Data from an XML File . . . . . . . . . . . . . . 229

Creating the SysMgmt Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230EXERCISE 6.7: Create the SysMgmt Application

with the Create Application Wizard . . . . . . . . . . . . . . . . . . 231Running and Testing the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236

EXERCISE 6.8: Run and Test the SysMgmt Application . . . . . . 236EXERCISE 6.9: Navigate Application Report Pages . . . . . . . . . 237EXERCISE 6.10: Understand Oracle

Application Express URLs . . . . . . . . . . . . . . . . . . . . . . . . . 238EXERCISE 6.11: Browse and Review Application Pages . . . . . 238

Refining the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240EXERCISE 6.12: Create Lists of Values (LOVs) for Forms . . . . . 240EXERCISE 6.13: Add LOVs to Forms . . . . . . . . . . . . . . . . . . . . 241

Oracle-Regular / Hands-On Oracle Database 10g Express Edition for Linux / Steve Bobrowski / 226327-X / Front Matter

Contents xv

FM.indd 14 6/29/06 9:48:34 AM

xiv Hands-On Oracle Database 10g Express Edition for Linux

Oracle-Regular / Hands-On Oracle Database 10g Express Edition for Linux / Steve Bobrowski / 226327-X / Front Matter

EXERCISE 6.14: Modify a Report’s Query and Make New Columns Searchable . . . . . . . . . . . . . . . . . . . . 244

Maintaining the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248EXERCISE 6.15: Create a New Table . . . . . . . . . . . . . . . . . . . . 250EXERCISE 6.16: Set UI Defaults for the New Table . . . . . . . . . 253EXERCISE 6.17: Create a New Trigger . . . . . . . . . . . . . . . . . . 254EXERCISE 6.18: Add Rows to the

DATABASE_SERVICE_REQUESTS Table . . . . . . . . . . . . . . 255EXERCISE 6.19: Add New Application Pages . . . . . . . . . . . . . 256EXERCISE 6.20: Add a Navigation Menu . . . . . . . . . . . . . . . . 259EXERCISE 6.21: Copy Breadcrumbs to the New

Report and Form Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . 261EXERCISE 6.22: Add Search and Display Controls to

the New Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264EXERCISE 6.23: Add an Analysis Page to the Application . . . . 273

Deploying the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278EXERCISE 6.24: Modify Application Attributes

for Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278EXERCISE 6.25: Deploy the Application on

Another Computer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279Managing Application Access and Application Users . . . . . . . . . . . . . . . . . . 281

EXERCISE 6.26: Create an Application Express User . . . . . . . . 282Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282

PART IIIDatabase Administration

7 Secure Database Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287Chapter Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288User Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289

Oracle Database Users and Oracle Application Express Users . . . . . 289Default Database User Accounts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289Database User Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290

EXERCISE 7.1: Display Information About Database Users . . . 292EXERCISE 7.2: Create a Database User . . . . . . . . . . . . . . . . . . 293EXERCISE 7.3: Test the New Database User Account . . . . . . . 296EXERCISE 7.4: Modify Your Own Password . . . . . . . . . . . . . . 297EXERCISE 7.5: Alter or Drop a Database User . . . . . . . . . . . . 298

Privilege Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299Types of Database Privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299Granting and Revoking Privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . 301

EXERCISE 7.6: Grant System Privileges to a User . . . . . . . . . . 301EXERCISE 7.7: Revoke System Privileges from a User . . . . . . . 303

Contents xv

FM.indd 15 6/29/06 9:48:34 AM

xvi Hands-On Oracle Database 10g Express Edition for Linux

Oracle-Regular / Hands-On Oracle Database 10g Express Edition for Linux / Steve Bobrowski / 226327-X / Front Matter

Contents xvii

EXERCISE 7.8: Grant Object Privileges to a User . . . . . . . . . . 304EXERCISE 7.9: Revoke Object Privileges from a User . . . . . . . 309

Privilege Management with Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . 309EXERCISE 7.10: Create a Role . . . . . . . . . . . . . . . . . . . . . . . . . 312EXERCISE 7.11: Grant System Privileges and Roles to a Role . . . 313EXERCISE 7.12: Grant Object Privileges to a Role . . . . . . . . . 313EXERCISE 7.13: Grant a Role to a User . . . . . . . . . . . . . . . . . . 314EXERCISE 7.14: Set a User’s Default Role . . . . . . . . . . . . . . . . 315EXERCISE 7.15: Enable and Disable a Role . . . . . . . . . . . . . . . 316

Resource Limitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318Tablespace Quotas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318

EXERCISE 7.16: Providing Specific Tablespace Quotas for a User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318

Resource Limit Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319Managing Resource Limit Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . 320

EXERCISE 7.17: Enable Resource Limitation . . . . . . . . . . . . . . 320EXERCISE 7.18: Create a Profile . . . . . . . . . . . . . . . . . . . . . . . 321EXERCISE 7.19: Alter Profile Settings . . . . . . . . . . . . . . . . . . . 322EXERCISE 7.20: Manually Force a User’s

Password to Expire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323EXERCISE 7.21: Use Password Complexity Checking . . . . . . . 324EXERCISE 7.22: Set a User’s Profile . . . . . . . . . . . . . . . . . . . . 325EXERCISE 7.23: Experiment with Password

Management Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325EXERCISE 7.24: Alter the Default Database Profile . . . . . . . . . 326

Displaying Security Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327EXERCISE 7.25: Display Information About Users . . . . . . . . . . 327EXERCISE 7.26: Display Information About Roles . . . . . . . . . . 327EXERCISE 7.27: Display Information About

Tablespace Quotas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328EXERCISE 7.28: Display Information About Profiles . . . . . . . . 328

Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

8 Manage Database Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331Chapter Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332Logical vs. Physical Storage Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332Tablespaces and Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334

Permanent, Temporary, and Undo Tablespaces . . . . . . . . . . . . . . . . 335The SYSTEM Tablespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335The SYSAUX Tablespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336Other Tablespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336Online and Offline Tablespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338Read-Only and Read-Write Tablespaces . . . . . . . . . . . . . . . . . . . . . . 338A Tablespace’s Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339Use of Data File Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340

FM.indd 16 6/29/06 9:48:35 AM

xvi Hands-On Oracle Database 10g Express Edition for Linux Contents xvii

Oracle-Regular / Hands-On Oracle Database 10g Express Edition for Linux / Steve Bobrowski / 226327-X / Front Matter

Data File Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340Online and Offline Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341Creating and Managing Permanent Tablespaces and Data Files . . . . 341

EXERCISE 8.1: Display Database Storage Utilization . . . . . . . 341EXERCISE 8.2: Display Tablespace Information . . . . . . . . . . . 342EXERCISE 8.3: Display Data File Information . . . . . . . . . . . . . 343EXERCISE 8.4: Create a Permanent Tablespace . . . . . . . . . . . . 344EXERCISE 8.5: Modify the Storage Properties

of a Data File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346EXERCISE 8.6: Control Tablespace Availability . . . . . . . . . . . . 346

Segments, Extents, and Data Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349Types of Segments in an Oracle Database . . . . . . . . . . . . . . . . . . . . . 349Data Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350Managing Storage for Tables and Indexes . . . . . . . . . . . . . . . . . . . . . 352

EXERCISE 8.7: Display the Data Block Size Information . . . . . 352EXERCISE 8.8: Display the Segments in a Schema . . . . . . . . . 353EXERCISE 8.9: Compact (Shrink) Segments Wasting Space . . . 354EXERCISE 8.10: Create a Table in a Specific Tablespace . . . . . 357EXERCISE 8.11: Reserve Space for Updates to

Existing Table Rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357EXERCISE 8.12: Manage Space for LOBs . . . . . . . . . . . . . . . . 359EXERCISE 8.13: Perform Miscellaneous Space

Management Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361Undo Tablespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364

Undo Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365Undo Segments Are Multipurpose . . . . . . . . . . . . . . . . . . . . . . . . . . . 365Managing Undo Tablespaces and Retention Times . . . . . . . . . . . . . . 365

EXERCISE 8.14: Display and Modify Automatic Undo Management Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 366

Temporary Segments, Tablespaces, and Groups . . . . . . . . . . . . . . . . . . . . . . 367Managing Temporary Tablespaces . . . . . . . . . . . . . . . . . . . . . . . . . . 368

EXERCISE 8.15: Reveal a Database’s Default Temporary Tablespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368

EXERCISE 8.16: Display Information About Temporary Tablespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 368

EXERCISE 8.17: Display Information About Temp Files . . . . . 368Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369

9 Protect Your Oracle XE Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371About This Chapter’s Practice Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372An Overview of Database Problems and Solutions . . . . . . . . . . . . . . . . . . . . 373

Instance Crashes and Crash Recovery . . . . . . . . . . . . . . . . . . . . . . . . 373Media (Physical) Failures, Backups, and Recovery Manager . . . . . . . 375Logical Errors and Oracle Flashback . . . . . . . . . . . . . . . . . . . . . . . . . 376Devising a Database Protection Policy . . . . . . . . . . . . . . . . . . . . . . . 378

FM.indd 17 6/29/06 9:48:35 AM

xviii Hands-On Oracle Database 10g Express Edition for Linux

Oracle-Regular / Hands-On Oracle Database 10g Express Edition for Linux / Steve Bobrowski / 226327-X / Front Matter Oracle-Regular / Hands-On Oracle Database 10g Express Edition for Linux / Steve Bobrowski / 226327-X / Front Matter

Oracle Database Backup and Recovery Overview . . . . . . . . . . . . . . . . . . . . 379The Flash Recovery Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379The Transaction Redo Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381The Database Control File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385Database Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386Recovery Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388

Configuring Oracle XE Database Protection . . . . . . . . . . . . . . . . . . . . . . . . . 394EXERCISE 9.1: Display Information About the

Flash Recovery Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394EXERCISE 9.2: Display Information About the Control File . . . 396EXERCISE 9.3: Display Information About the Redo Log . . . . . 396EXERCISE 9.4: Create a Cold Database Backup . . . . . . . . . . . 398EXERCISE 9.5: Establish a Privileged

Administrator Session with SQL*Plus . . . . . . . . . . . . . . . . . 404EXERCISE 9.6: Move the Flash Recovery Area and

Online Redo Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405EXERCISE 9.7: Enable Media Recovery . . . . . . . . . . . . . . . . . . 406EXERCISE 9.8: Create a Hot Database Backup . . . . . . . . . . . . 408EXERCISE 9.9: Confirm Successful Log Archiving . . . . . . . . . . 412EXERCISE 9.10: Create Log Groups with Multiple Members . . . 413EXERCISE 9.11: Mirror the Database Control File . . . . . . . . . . 416

Backing Up Databases with Recovery Manager . . . . . . . . . . . . . . . . . . . . . . 418EXERCISE 9.12: Start Recovery Manager . . . . . . . . . . . . . . . . . 418EXERCISE 9.13: Connect to the Target Database . . . . . . . . . . . 419EXERCISE 9.14: Display and Configure Persistent

Recovery Manager Settings . . . . . . . . . . . . . . . . . . . . . . . . 419EXERCISE 9.15: Back Up a Database . . . . . . . . . . . . . . . . . . . 422EXERCISE 9.16: Back Up an Individual Tablespace . . . . . . . . 423EXERCISE 9.17: Back Up Archived Log Files . . . . . . . . . . . . . 424EXERCISE 9.18: List Information About Backup Sets . . . . . . . . 426EXERCISE 9.19: Report Important Status Information

for a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428EXERCISE 9.20: Delete Obsolete Backup Sets . . . . . . . . . . . . . 430EXERCISE 9.21: Understand Flash Recovery

Area Space Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431EXERCISE 9.22: Build a New Backup Script . . . . . . . . . . . . . . 432

Additional Database Backup Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436Backups of Other Database-Related Files . . . . . . . . . . . . . . . . . . . . . 436Logical Database Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436

More Database Recovery Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437Complete Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438Incomplete Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439What About Damage to Log Groups and the Control File? . . . . . . . . 440

Contents xix

FM.indd 18 6/29/06 9:48:36 AM

xviii Hands-On Oracle Database 10g Express Edition for Linux

Oracle-Regular / Hands-On Oracle Database 10g Express Edition for Linux / Steve Bobrowski / 226327-X / Front Matter

Recovering Databases from Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440EXERCISE 9.23: Simulate a System Crash

and Perform Crash Recovery . . . . . . . . . . . . . . . . . . . . . . . 441EXERCISE 9.24: Simulate a Lost Data File and

a Database Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443Using Oracle Flashback Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448

EXERCISE 9.25: Restore a Dropped Table Using Oracle Flashback Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . 448

EXERCISE 9.26: Restore Lost Data Using Oracle Flashback Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449

Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454

10 Tune Application and Database Instance Performance . . . . . . . . . . . . . . . . 455Chapter Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456Oracle Tuning Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456

Measures of Oracle Database Application Performance . . . . . . . . . . 457Realistic and Unrealistic Performance Goals . . . . . . . . . . . . . . . . . . . 457Tunable Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458Tuning Methodologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459The Cost of Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461

Tuning Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462Commonly Referenced Tuning Statistics . . . . . . . . . . . . . . . . . . . . . . 462Instance Efficiency Ratios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464The V$ Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465Statspack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465

Application Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466Complex SQL Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467Data Access Methods and Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . 468Data Concurrency and Locking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468Application-Tuning Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470

EXERCISE 10.1: Install Statspack . . . . . . . . . . . . . . . . . . . . . . . 471EXERCISE 10.2: Take a Default Snapshot . . . . . . . . . . . . . . . . 473EXERCISE 10.3: Simulate and Investigate the Problem . . . . . . 474EXERCISE 10.4: Take Another Default Snapshot . . . . . . . . . . . 478EXERCISE 10.5: Review Statspack Snapshots . . . . . . . . . . . . . 478EXERCISE 10.6: Create a Statspack Report . . . . . . . . . . . . . . . 478EXERCISE 10.7: Analyze a Statspack Report . . . . . . . . . . . . . . 481EXERCISE 10.8: Create Indexes for Filter

Predicate Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483EXERCISE 10.9: Explain the New Results . . . . . . . . . . . . . . . . 484EXERCISE 10.10: Discover and Display Unindexed

Foreign Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485EXERCISE 10.11: Explain the New Execution Plan . . . . . . . . . 487

Contents xix

FM.indd 19 6/29/06 9:48:36 AM

xx Hands-On Oracle Database 10g Express Edition for Linux

Oracle-Regular / Hands-On Oracle Database 10g Express Edition for Linux / Steve Bobrowski / 226327-X / Front Matter

EXERCISE 10.12: Gather New Statistics . . . . . . . . . . . . . . . . . 488EXERCISE 10.13: Analyze Other

Application-Related Statistics . . . . . . . . . . . . . . . . . . . . . . . 489Database Instance Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492

The System Global Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492Program Global Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494Database Instance Tuning Exercises . . . . . . . . . . . . . . . . . . . . . . . . . 495

EXERCISE 10.14: Display Current Overall Memory Utilization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495

EXERCISE 10.15: Display Information About the SGA . . . . . . 495EXERCISE 10.16: Modify the Size of the SGA . . . . . . . . . . . . . 498EXERCISE 10.17: Display Information About

PGA Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499EXERCISE 10.18: Modify the Allowable PGA Memory . . . . . . 500

Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503

xxi

FM.indd 20 6/29/06 9:48:36 AM