Oracle Database 11g Ebook free dowwnload
THE EXPERT’S VOICE ® IN ORACLE
Companion eBook
All major features of
Oracle Database 11g Release 1
tested and explained
Oracle
Database 11g
New Features for DBAs and Developers
Learn the powerful new features in Oracle Database 11g
and advance to the cutting-edge of Oracle database
administration and development.
Sam R. Alapati and Charles Kim
www.it-ebooks.info
www.it-ebooks.info
Oracle Database 11g
New Features for DBAs
and Developers
■■■
Sam R. Alapati and Charles Kim
www.it-ebooks.info
Oracle Database 11g: New Features for DBAs and Developers
Copyright © 2007 by Sam R. Alapati and Charles Kim
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-59059-910-5
ISBN-10 (pbk): 1-59059-910-1
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Lead Editor: Jonathan Gennick
Technical Reviewer: Robert Blok
Editorial Board: Steve Anglin, Ewan Buckingham, Tony Campbell, Gary Cornell, Jonathan Gennick,
Jason Gilmore, Kevin Goff, Jonathan Hassell, Matthew Moodie, Joseph Ottinger, Jeffrey Pepper,
Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh
Project Manager: Sofia Marchant
Copy Edit Manager: Nicole Flores
Copy Editor: Kim Wimpsett
Associate Production Director: Kari Brooks-Copony
Production Editor: Kelly Winquist
Compositor: Susan Glinert
Proofreader: April Eddy
Indexer: Broccoli Information Management
Cover Designer: Kurt Krames
Manufacturing Director: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail [email protected], or
visit http://www.springeronline.com.
For information on translations, please contact Apress directly at 2855 Telegraph Avenue, Suite 600,
Berkeley, CA 94705. Phone 510-549-5930, fax 510-549-5939, e-mail [email protected], or visit http://
www.apress.com.
The information in this book is distributed on an “as is” basis, without warranty. Although every precaution
has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to
any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly
by the information contained in this work.
www.it-ebooks.info
To Jim Gray (Microsoft Technical Fellow), who is deeply missed by the database world,
which remembers him with fondness and respect for both his professional brilliance and his
warm personal qualities. Jim Gray is responsible for several fundamental database technologies,
especially in online transaction processing. Jim Gray is still missing after embarking on a
solo one-day boating trip from San Francisco on January 28, 2007, to immerse his mother’s
ashes at sea. In 1997 Jim Gray received the A.M. Turing Award (which is considered by some
to be the Nobel Prize for computer science) for his “seminal contributions to database and
transaction processing research and technical leadership in system implementation.” Jim Gray
is the author of Transaction Processing: Concepts and Techniques, which has been the
classic reference in the field for the last several years. Much of what we do in online transaction
processing today flows directly from Jim Gray’s seminal contributions, and all of us
who work with relational databases owe an immense debt to him.
—Sam R. Alapati
I dedicate the completed endeavor of this book to my parents, Wan Kyu and Chong Sik Kim,
who made incredible sacrifices for my sisters and me. I thank you for my upbringing, education,
work ethic, and any and all accomplishments. Thank you for exemplifying what it means to
be a follower of Christ. As a parent myself now, I know that you are truly good and Godly parents.
—Charles Kim
www.it-ebooks.info
www.it-ebooks.info
Contents at a Glance
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
■CHAPTER 1
Installing, Upgrading, and Managing Change . . . . . . . . . . . . . . . . . . . 1
■CHAPTER 2
Database Diagnosability and Failure Repair . . . . . . . . . . . . . . . . . . . 57
■CHAPTER 3
Database Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
■CHAPTER 4
Performance Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
■CHAPTER 5
Database Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
■CHAPTER 6
Backup and Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
■CHAPTER 7
Data Pump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
■CHAPTER 8
Oracle Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
■CHAPTER 9
Storage Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
■CHAPTER 10
Data Guard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
■CHAPTER 11
Application Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
■CHAPTER 12
Data Warehousing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
■INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
v
www.it-ebooks.info
www.it-ebooks.info
Contents
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
■CHAPTER 1
Installing, Upgrading, and Managing Change . . . . . . . . . . . . . 1
New Features in Server Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Changes in the Optimal Flexible Architecture . . . . . . . . . . . . . . . . . . . 2
Changes in the Install Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
New Oracle Database 11g Components . . . . . . . . . . . . . . . . . . . . . . . 4
Role and Privilege Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Installing Oracle Database 11g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
New Features in Database Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
New Initialization Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
DBCA Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
New Oracle Background Processes . . . . . . . . . . . . . . . . . . . . . . . . . . 16
New Oracle-Supplied PL/SQL Packages . . . . . . . . . . . . . . . . . . . . . . 17
Upgrading to Oracle Database 11g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Upgrading and the Compatibility Factor . . . . . . . . . . . . . . . . . . . . . . . 18
Upgrade Path to Oracle 11g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Upgrading with the DBUA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Performance Testing the Upgrade . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Downgrading After an Upgrade to 11g . . . . . . . . . . . . . . . . . . . . . . . . 25
Rolling Upgrade Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Oracle Clusterware Upgrade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Real Application Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Database Replay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
The SQL Performance Analyzer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Database Software Patching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
New Features in Database Control for Patching . . . . . . . . . . . . . . . . 53
Emergency Hot Patching (Online Database Patching) . . . . . . . . . . . 55
Database Change Management Pack . . . . . . . . . . . . . . . . . . . . . . . . 56
Software and Database Cloning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
vii
www.it-ebooks.info
viii
■C O N T E N T S
■CHAPTER 2
Database Diagnosability and Failure Repair
. . . . . . . . . . . . . 57
The Fault Diagnosability Infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Problems and Incidents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Incident Packaging Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Structure and Location of the ADR . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Investigating and Resolving Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Using the Command-Line Tool adrci . . . . . . . . . . . . . . . . . . . . . . . . . 63
The Support Workbench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Database Health Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Checks, Failures, and Repairs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Types of Health Monitor Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Manual Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Data Recovery Advisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Managing the Data Recovery Advisor Through RMAN . . . . . . . . . . . 89
SQL Test Case Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Improvements in Handling Data Corruption . . . . . . . . . . . . . . . . . . . . . . . . 96
■CHAPTER 3
Database Administration
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Database Automation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Automatic Memory Management . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Automated Database Maintenance Tasks . . . . . . . . . . . . . . . . . . . . 105
Flashback-Related New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Total Recall and the Flashback Data Archive . . . . . . . . . . . . . . . . . 111
Flashback Transaction Backout . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Database Administration New Features . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Virtual Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
New Data Partitioning Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Allowing DDL Locks to Wait for DML Locks . . . . . . . . . . . . . . . . . . . 128
Explicit Locking of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Invisible Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Read-Only Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Temporary Tablespace Management . . . . . . . . . . . . . . . . . . . . . . . . 133
Creating an Initialization Parameter File from Memory . . . . . . . . . 136
Restore Point Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Database Resident Connection Pooling . . . . . . . . . . . . . . . . . . . . . . 139
Comparing and Converging Database Objects . . . . . . . . . . . . . . . . 143
www.it-ebooks.info
■C O N T E N T S
SQL*Plus New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
SQL*Plus Error Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Default Settings in the SQL*Plus Executable . . . . . . . . . . . . . . . . . . 149
Enhanced SQL*Plus BLOB Support . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Online Application Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Support for New Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Enhanced Online Index Creation and Rebuild . . . . . . . . . . . . . . . . . 150
Enhanced Default Column Value Functionality . . . . . . . . . . . . . . . . 151
Online Reorganization of Materialized Views . . . . . . . . . . . . . . . . . . 152
Minimal Invalidation of Dependent Objects . . . . . . . . . . . . . . . . . . . 152
Oracle Advanced Table Compression Option . . . . . . . . . . . . . . . . . . . . . . 153
How the New Compression Feature Works . . . . . . . . . . . . . . . . . . . 154
Storage and Performance Gains . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Implementing OLTP Table Compression . . . . . . . . . . . . . . . . . . . . . 154
Compressing Unstructured Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Enterprise Manager New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
The Availability Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
The Server Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
New Related Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
LogMiner Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Database Diagnostic Pack and Tuning Pack . . . . . . . . . . . . . . . . . . 160
Oracle Scheduler New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Lightweight Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Remote External Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Scheduler Support for Data Guard . . . . . . . . . . . . . . . . . . . . . . . . . . 165
■CHAPTER 4
Performance Management
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
SQL and PL/SQL Performance Enhancements . . . . . . . . . . . . . . . . . . . . 168
Automatic “Native” PL/SQL Compilation . . . . . . . . . . . . . . . . . . . . . 168
Faster DML Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Adaptive Cursor Sharing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
New Result Caching Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Using the Server Result Cache to Enhance Performance . . . . . . . . 175
Managing the Query Result Cache . . . . . . . . . . . . . . . . . . . . . . . . . . 185
PL/SQL Function Result Cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Intra Unit Inlining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
www.it-ebooks.info
ix
x
■C O N T E N T S
Automatic SQL Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Automation of SQL Tuning in Oracle Database 11g . . . . . . . . . . . . 191
SQL Access Advisor Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . 194
Optimizer and Statistics Collection Enhancements . . . . . . . . . . . . . . . . . 197
Multicolumn Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Expression Statistics for Functions and Expressions . . . . . . . . . . . 201
Changing Statistics Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Keeping Statistics Pending vs. Publishing
Statistics Immediately . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
SQL Plan Management (SPM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
ADDM Enhancements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
AWR Baselines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Baseline Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Adaptive Baseline Metric Thresholds . . . . . . . . . . . . . . . . . . . . . . . . 221
Performance-Related Changes in Database Control . . . . . . . . . . . . . . . . 222
Customized Performance Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Average Active Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
ADDM Performance Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
■CHAPTER 5
Database Security
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Enterprise Database Security Concerns . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Stronger Password Hash Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 226
Security Out of the Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Delayed Failed Logins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Case-Sensitive Passwords. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Basic Compliance with Industry Security Recommendations . . . . 230
Upgrade Implications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Password Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Case-Sensitive Password Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Change Default User Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Database Links and Case Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . 233
Password Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Tablespace Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Creating the Oracle Wallet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Wallet Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Encrypted Tablespace Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Encrypting a Tablespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
www.it-ebooks.info
■C O N T E N T S
Enterprise Manager Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Transparent Data Encryption with Enterprise Manager
Database Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Tablespace Encryption with Database Console . . . . . . . . . . . . . . . . 245
Policy Trend Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Additional Security Management Integration in
Database Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
UTL_ Package Network Access Management . . . . . . . . . . . . . . . . . . . . . 248
Fine-Grained Access Control for UTL_* Network Packages . . . . . 249
sysasm Privilege for Automatic Storage Management . . . . . . . . . . 258
LOB Encryption Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
Data Pump Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
RMAN Virtual Private Catalog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
RMAN Backup Shredding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
TDE with LogMiner Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
TDE with Data Guard SQL Apply . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Oracle Audit Vault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
TDE with Hardware Security Module Integration . . . . . . . . . . . . . . 259
Oracle Advanced Security Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Kerberos Cross-Realm Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
sysdba Strong Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Oracle Call Interface Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Set the Level of Information Captured for Bad Packets . . . . . . . . . 262
Delay or Drop Database Connections . . . . . . . . . . . . . . . . . . . . . . . . 262
Configure Maximum Number of Server Connection Attempts . . . . 263
Control the Display of Database Release Information. . . . . . . . . . . 263
Set Up the Banner and Auditing for Unauthorized Access . . . . . . . 264
■CHAPTER 6
Backup and Recovery
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Enhanced Block Media Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Preconditions for Using the recover … block Command . . . . . . . . 266
Using the recover … block Command . . . . . . . . . . . . . . . . . . . . . . . 267
RMAN Management Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Scripting with RMAN Substitution Variables . . . . . . . . . . . . . . . . . . 270
New RMAN Configuration Parameters . . . . . . . . . . . . . . . . . . . . . . . 273
Backing Up Large Files in Sections . . . . . . . . . . . . . . . . . . . . . . . . . 274
Creating Archival (Long-Term) Backups . . . . . . . . . . . . . . . . . . . . . 276
The New Validate Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Configuring an Archived Redo Log Deletion Policy . . . . . . . . . . . . . 285
Archived Redo Log Failover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
www.it-ebooks.info
xi
xii
■C O N T E N T S
Backup Shredding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Optimized Backing Up of Undo Data . . . . . . . . . . . . . . . . . . . . . . . . . 288
Active (Network-Based) Database Duplication . . . . . . . . . . . . . . . . . . . . 288
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Necessary Spfile Modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Performing Active Duplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
How Network-Enabled Duplication Works . . . . . . . . . . . . . . . . . . . . 297
Recovery Catalog Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Merging Recovery Catalogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Moving a Recovery Catalog to Another Database . . . . . . . . . . . . . . 302
Virtual Private Catalogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Enhanced RMAN Integration with Data Guard . . . . . . . . . . . . . . . . . . . . . 307
Configuring RMAN Without a Database Connection . . . . . . . . . . . . 308
Restoring a Backup Controlfile to a Standby Controlfile . . . . . . . . . 309
Resynchronizing the Recovery Catalog . . . . . . . . . . . . . . . . . . . . . . 310
Backup File Accessibility Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Block Change Tracking Support in Standby Databases . . . . . . . . . 311
■CHAPTER 7
Data Pump
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
API Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Compression Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Specifying Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Choosing an Encryption Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Reusing a Dump File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Remapping Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Remapping a Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
Export and Import of Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Ignoring Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
External Tables Based on Data Pump . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Stored Procedure to Generate External Table Using a
Data Pump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
■CHAPTER 8
Oracle Streams
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Synchronous Capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
Restrictions on Synchronous Capture . . . . . . . . . . . . . . . . . . . . . . . 338
Configuring Synchronous Capture . . . . . . . . . . . . . . . . . . . . . . . . . . 339
DBA Views for Synchronous Capture . . . . . . . . . . . . . . . . . . . . . . . . 341
www.it-ebooks.info
■C O N T E N T S
Combined Capture and Apply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
Requirements for Combined Capture and Apply . . . . . . . . . . . . . . . 342
Combined Capture and Apply Validation . . . . . . . . . . . . . . . . . . . . . 343
Performance Advisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Streams Advisor Admin Package . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Streams Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Streams Topology Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
DBMS_COMPARISON for “Compare and Repair” . . . . . . . . . . . . . . . . . . 348
DBMS_COMPARISON Requirements . . . . . . . . . . . . . . . . . . . . . . . . 348
Supported Database Object Types . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Comparison Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Rechecking a Prior Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
Converging Shared Database Objects (Repair) . . . . . . . . . . . . . . . . 352
Splitting and Merging of a Destination . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
Splitting a Stream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
Merging the Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
Merge Streams Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Usability Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Message Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Automated Alerts for Clients and Thresholds . . . . . . . . . . . . . . . . . 356
Identifying Newly Supported Tables View . . . . . . . . . . . . . . . . . . . . 357
Identifying Minimum Required Checkpoint SCN . . . . . . . . . . . . . . . 357
Background Process Name Changes . . . . . . . . . . . . . . . . . . . . . . . . 357
Support for XMLType Values Stored As CLOBs . . . . . . . . . . . . . . . . 358
Support for Transparent Data Encryption. . . . . . . . . . . . . . . . . . . . . 358
Support for Oracle Scheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
■CHAPTER 9
Storage Management
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Automated Storage Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Misconceptions of ASM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
RMAN and ASM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
sysasm Privilege and osasm Group . . . . . . . . . . . . . . . . . . . . . . . . . 363
Fast Rebalance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
ASM Upgrade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Upgrading Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Upgrading Using DBUA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Rolling Upgrades . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
www.it-ebooks.info
xiii
xiv
■C O N T E N T S
ASM Preferred Reads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
Preferred Read Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
Monitoring Preferred Reads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
ASM Restricted Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Diskgroup Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Allocation Unit (AU) Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
RDBMS and ASM Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Fast Mirror Resync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
asmcmd Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
ls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
lsdg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
lsct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
lsdsk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
cp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
Metadata Backup and Restore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Backup Diskgroup Using md_backup . . . . . . . . . . . . . . . . . . . . . . . 400
Restore Diskgroup Using md_restore. . . . . . . . . . . . . . . . . . . . . . . . 401
Metadata Backup and Restore Demonstration . . . . . . . . . . . . . . . . 402
Additional md_restore Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Bad Block Recovery with ASMCMD . . . . . . . . . . . . . . . . . . . . . . . . . 409
Oracle Direct NFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Set Up Direct NFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Validate Direct NFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Disable Direct NFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Network Interface Card Bonding . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Direct NFS Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
■CHAPTER 10 Data Guard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Active Physical Standby Database Duplication . . . . . . . . . . . . . . . . . . . . 416
Real-Time Query Standby . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Start the Real-Time Query Standby . . . . . . . . . . . . . . . . . . . . . . . . . 419
Validate the Real-Time Query Standby Database . . . . . . . . . . . . . . 419
Design the Real-Time Query Database . . . . . . . . . . . . . . . . . . . . . . 421
Snapshot Standby . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Convert to Snapshot Standby . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
Convert Back to Physical Standby . . . . . . . . . . . . . . . . . . . . . . . . . . 425
Using the Physical Standby for Rolling Upgrades . . . . . . . . . . . . . . . . . . 426
Prepare the Primary Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
Convert to Logical: Keep Your Identity . . . . . . . . . . . . . . . . . . . . . . . 427
www.it-ebooks.info
■C O N T E N T S
Improvements in Redo Transport . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
Block Change Tracking Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
RMAN Understands Data Guard Configurations . . . . . . . . . . . . . . . 429
Improved Integration with RMAN . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
Compressed Redo Traffic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
Usage of Histograms for the NET_TIMEOUT Attributes . . . . . . . . . 430
Fast-Start Failover for Maximum Performance Mode. . . . . . . . . . . 432
Logical Standby: SQL Apply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
Support for Transparent Data Encryption (TDE) . . . . . . . . . . . . . . . 433
Dynamically Set the Data Guard SQL Apply Parameters . . . . . . . . 434
Support for VPD and FGA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
DBMS_SCHEDULER Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
Logical Standby Archivelog Storage . . . . . . . . . . . . . . . . . . . . . . . . . 436
SQL Apply Event Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
Data Guard Broker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
Data Guard Broker Command-Line Interface . . . . . . . . . . . . . . . . . 438
Customize Fast-Start Failover Events . . . . . . . . . . . . . . . . . . . . . . . . 440
Initiate Fast-Start Failover from Applications . . . . . . . . . . . . . . . . . 441
New Data Guard Manager Properties . . . . . . . . . . . . . . . . . . . . . . . . 442
Detect Lost-Write Conditions Using a Physical Standby . . . . . . . . 443
Support of Heterogeneous OS Data Guard Configuration. . . . . . . . 443
Oracle Database 11g Data Guard Over Storage
Vendor Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
■CHAPTER 11
Application Development
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
New PL/SQL Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
CONTINUE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
Sequences Without Dual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
Native Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
SIMPLE_INTEGER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
Regular Expression Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . 449
Named and Mixed Arguments in SQL Statement PL/SQL
Function Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
Subprogram Inlining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
Generalized Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
Cross-Session PL/SQL Function Result Cache . . . . . . . . . . . . . . . . 458
Bulk In-Bind Table of Records in FORALL . . . . . . . . . . . . . . . . . . . . 463
Dynamic SQL Symmetry and New Functionality . . . . . . . . . . . . . . . 465
www.it-ebooks.info
xv
xvi
■C O N T E N T S
New Trigger Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
Trigger Ordering: The FOLLOWS Clause . . . . . . . . . . . . . . . . . . . . . 469
Creating Triggers As ENABLED or DISABLED . . . . . . . . . . . . . . . . . 469
Compound Triggers Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
XML DB Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
Repository Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
Support Content Repository API for Java: JSR-170 . . . . . . . . . . . . 475
ACL Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
New XMLType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
XMLIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Native Web Services for Oracle XML DB . . . . . . . . . . . . . . . . . . . . . 493
XQuery Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
XML Developer’s Kit (XDK) Improvements . . . . . . . . . . . . . . . . . . . . 502
Application Express (APEX) Enhancements . . . . . . . . . . . . . . . . . . . . . . . 505
APEX Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
APEX Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
PHP Support Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
Java Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
Just-in-Time (JIT) Compiler and Native Compilation . . . . . . . . . . . 508
JAR Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
Improvements to the loadjava Tool . . . . . . . . . . . . . . . . . . . . . . . . . . 510
Improvements to the dropjava Tool . . . . . . . . . . . . . . . . . . . . . . . . . 510
Improvements to the ojvmjava Tool . . . . . . . . . . . . . . . . . . . . . . . . . 511
The ojvmtc Tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
■CHAPTER 12 Data Warehousing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
Next-Generation LOBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
SecureFiles Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
BasicFiles vs. SecureFiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
LOB Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
Deduplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
DBMS_LOB.SETOPTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
db_securefile Initialization Parameter . . . . . . . . . . . . . . . . . . . . . . . 525
Migrate from BasicFiles to SecureFiles . . . . . . . . . . . . . . . . . . . . . . 526
LOB Prefetch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
www.it-ebooks.info
■C O N T E N T S
Data Warehousing New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
Partition Change Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
Materialized View Refresh Performance Improvements. . . . . . . . . 529
Materialized View QUERY REWRITE Enhancements . . . . . . . . . . . . 530
Pivot Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
Unpivot Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
Partition Advisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
Reference Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
Interval Partitioning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
Extended Composite Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
Virtual Column-Based Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . 556
System Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
Enhanced Partition Pruning Capabilities . . . . . . . . . . . . . . . . . . . . . 561
Oracle Multimedia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
Enhanced DICOM Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
ORDDICOM Object Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
Image Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
Support for SecureFiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
Additional Multimedia Enhancements . . . . . . . . . . . . . . . . . . . . . . . 563
■INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
www.it-ebooks.info
xvii
www.it-ebooks.info
About the Authors
■SAM ALAPATI is an Oracle DBA for the Boy Scouts of America, working at
their national office in Los Colinas, Texas. Prior to this, Sam worked at
Sabre, Oracle Corporation, and NBC. Sam has previously published
Expert Oracle9i Database Administration, Expert Oracle Database 10g
Administration, and Oracle Database 11g RMAN Recipes, as well as two
OCP certification books for Oracle Press. Sam has been working with
relational databases since 1985, starting with the Ingres database. Sam
holds the OCP certification for Oracle DBAs as well as the HP-UX System
Administrator certification.
■CHARLES KIM, director of database technologies at Novara Solutions, is
an Oracle Certified DBA, Red Hat Certified Technician, and Microsoft
Certified Professional. He has more than 17 years of IT experience and
has worked with Oracle since 1991. Prior to this, Charles served at Fidelity
National Information Services as the chief Oracle database engineering
counsel and also worked at GMAC Mortgage, i2 Technologies, and Oracle
Corporation. Charles also serves as a technical editor for Oracle Press.
Charles has presented advanced topics for IOUG and Oracle OpenWorld
on such topics as RAC/ASM and 7×24 high availability considerations using Oracle Advanced
Replication, Hot Standby, and Quest Shareplex. Charles manages the DBAExpert.com web site
and provides technical solutions to Oracle DBAs and developers.
Charles is the author of the Maximum Availability Architecture case study at Oracle’s web
site (http://www.oracle.com/technology/deploy/availability/htdocs/FNF_CaseStudy.html).
xix
www.it-ebooks.info
www.it-ebooks.info
Acknowledgments
F
irst and foremost, I’d like to acknowledge my gratitude for Charles Kim, my coauthor. It’s a
privilege to write a book with a consummate Oracle professional such as Charles. Charles has
made writing this book a great pleasure, and he worked hard to meet our short deadlines, this
being a “new features” book, whose contents always seem to be in a flux.
No Oracle-based book, let alone a “new features” book, can be conjured from thin air. I
want to acknowledge the wonderful efforts of the Oracle Beta folks, who made the Oracle Database 11g Beta release available to me by extending an invitation to be part of their beta testing
team. I benefited immensely by the high-quality e-studies and other technical studies made
available by Oracle Corporation to the beta participants, as well as from the access to the beta
software itself. I want to acknowledge in particular Lynn Snyder and Debbie Migliore, as well as
Sheila Cepero, all from Oracle Corporation, for all their help over the last year while I was testing
this exciting new offering from Oracle Corporation.
Jonathan Gennick, the editor, has as usual left his powerful mark on the book. I can’t think
of any part of this book that didn’t benefit from Jonathan’s conscientious and superb editing at
both the technical as well the editorial level. Robert Blok, the technical editor, helped by pointing
out several aspects that needed clarification. I owe thanks to the professional competence that
the project manager, Sofia Marchant, brought to bear on the book. Sofia’s kindness and cool
efficiency over the past few months while managing a book under short deadlines is what helped
Charles and I finish this book on time. Kim Wimpsett, the copy editor, did a superb job, going
to great lengths to nail down numerous issues regarding style, terminology, consistency, and
accuracy (although I think I’ve imposed a considerable burden on her by adding more new
features in each iteration of the review process!). Kelly Winquist, the production editor, admirably
managed the stupendously difficult task of getting this book out in time without compromising
quality. April Eddy, the proofreader, did a brilliant job, without which my less than perfect
typing skills would have been fully evident to the world. April has not only caught several insidious typos but also zoomed in on several tricky usage situations, always pointing out the correct
approach. I’m grateful for the efforts of Sofia, Kim, Kelly, and April as well as the entire production
group for going way beyond any call of duty and cheerfully moving the book along under the
stress of looming deadlines. It’s customary for the author to thank the editorial and production
folks, I suppose, but I simply can’t imagine this book being ready in time and in good shape
without the supreme effort and dedication shown by the previously mentioned people.
My managers, Dave Campbell and David Jeffries, have been supportive of my endeavors,
and I’m grateful for their encouragement over the years. My colleagues—Rob Page, Lance Parkes,
Stan Galbraith, Dan Nelson, Dabir Haidar, Sabrina Kirkpatrick, and Carla Wallace—have also
been helpful to me at work, and I appreciate their help and friendship. I also want to acknowledge
my friends at work, Debra Kendrew, Myra Riggs, and especially Leticia Salazar; Leticia has been
very helpful during the past few months in helping take care of a lot of my affairs at work.
xxi
www.it-ebooks.info
xxii
■A C K N O W L E D G M E N T S
Nothing I do in my personal and professional lives would be possible without the constant
support and encouragement of my family. I’d like to express my gratitude for the love, affection, and sacrifice of my parents, Appa Rao and Swarna Kumari; my brothers, Hari Hara Prasad
and Siva Sankara Prasad; and my sisters-in law, Aruna and Vanaja. At home, the love and
support of my wife, Valerie, sustains me. Valerie’s support and immense sacrifices have been
crucial to the writing of this, as well as all my other books. Writing this book has meant time
away from my children, Nina, Nicholas, and Shannon, and I can only promise that I’ll make it up to
them soon!
—Sam R. Alapati
Most important, I want to thank my dear wife, Melissa, and our three boys, Isaiah, Jeremiah,
and Noah, for their unceasing support during the project and sacrificing precious family time.
Without their prayers and encouragement, I could not have completed this project.
On a professional note, I would like to thank Leisa Pitner (http://leisapitner.com) for
surrendering nights to rush edits and revisions of the chapters on last-minute notice. Leisa Pitner
has served in several key roles in information technology ranging from business process engineer to director of internal applications for a 1 billon dollar software company. She has successfully
facilitated the transformation of process and culture across multiple industries, leveraging her
system’s design and business process engineering background.
I would like to thank David Sweet, director of development practice at Novara Solutions,
for contributing the PL/SQL and Java portions to Chapter 11. David has been working with
Oracle since 1987 and, in my opinion, is one of the most elite developers in the industry.
I would like to extend an appreciation to Nitin Vengurlekar, member of the technical staff
at Oracle and author of the Automated Storage Administration book. We shared a few battle
scars of the book-authoring process. His review of Chapter 9 provided great insight and enhanced
the overall quality of the chapter.
I can’t forget the folks on Oracle’s High Availability product development team, especially
Joe Meeks and Larry Carpenter, for reviewing Chapter 10 and encouraging me to go forward.
Thank you for the valuable input and recommendations.
My sincere gratitude goes to Debbie Migliore, director of Server Technologies
Companion eBook
All major features of
Oracle Database 11g Release 1
tested and explained
Oracle
Database 11g
New Features for DBAs and Developers
Learn the powerful new features in Oracle Database 11g
and advance to the cutting-edge of Oracle database
administration and development.
Sam R. Alapati and Charles Kim
www.it-ebooks.info
www.it-ebooks.info
Oracle Database 11g
New Features for DBAs
and Developers
■■■
Sam R. Alapati and Charles Kim
www.it-ebooks.info
Oracle Database 11g: New Features for DBAs and Developers
Copyright © 2007 by Sam R. Alapati and Charles Kim
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-59059-910-5
ISBN-10 (pbk): 1-59059-910-1
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Lead Editor: Jonathan Gennick
Technical Reviewer: Robert Blok
Editorial Board: Steve Anglin, Ewan Buckingham, Tony Campbell, Gary Cornell, Jonathan Gennick,
Jason Gilmore, Kevin Goff, Jonathan Hassell, Matthew Moodie, Joseph Ottinger, Jeffrey Pepper,
Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh
Project Manager: Sofia Marchant
Copy Edit Manager: Nicole Flores
Copy Editor: Kim Wimpsett
Associate Production Director: Kari Brooks-Copony
Production Editor: Kelly Winquist
Compositor: Susan Glinert
Proofreader: April Eddy
Indexer: Broccoli Information Management
Cover Designer: Kurt Krames
Manufacturing Director: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail [email protected], or
visit http://www.springeronline.com.
For information on translations, please contact Apress directly at 2855 Telegraph Avenue, Suite 600,
Berkeley, CA 94705. Phone 510-549-5930, fax 510-549-5939, e-mail [email protected], or visit http://
www.apress.com.
The information in this book is distributed on an “as is” basis, without warranty. Although every precaution
has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to
any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly
by the information contained in this work.
www.it-ebooks.info
To Jim Gray (Microsoft Technical Fellow), who is deeply missed by the database world,
which remembers him with fondness and respect for both his professional brilliance and his
warm personal qualities. Jim Gray is responsible for several fundamental database technologies,
especially in online transaction processing. Jim Gray is still missing after embarking on a
solo one-day boating trip from San Francisco on January 28, 2007, to immerse his mother’s
ashes at sea. In 1997 Jim Gray received the A.M. Turing Award (which is considered by some
to be the Nobel Prize for computer science) for his “seminal contributions to database and
transaction processing research and technical leadership in system implementation.” Jim Gray
is the author of Transaction Processing: Concepts and Techniques, which has been the
classic reference in the field for the last several years. Much of what we do in online transaction
processing today flows directly from Jim Gray’s seminal contributions, and all of us
who work with relational databases owe an immense debt to him.
—Sam R. Alapati
I dedicate the completed endeavor of this book to my parents, Wan Kyu and Chong Sik Kim,
who made incredible sacrifices for my sisters and me. I thank you for my upbringing, education,
work ethic, and any and all accomplishments. Thank you for exemplifying what it means to
be a follower of Christ. As a parent myself now, I know that you are truly good and Godly parents.
—Charles Kim
www.it-ebooks.info
www.it-ebooks.info
Contents at a Glance
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
■CHAPTER 1
Installing, Upgrading, and Managing Change . . . . . . . . . . . . . . . . . . . 1
■CHAPTER 2
Database Diagnosability and Failure Repair . . . . . . . . . . . . . . . . . . . 57
■CHAPTER 3
Database Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
■CHAPTER 4
Performance Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
■CHAPTER 5
Database Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
■CHAPTER 6
Backup and Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
■CHAPTER 7
Data Pump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
■CHAPTER 8
Oracle Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
■CHAPTER 9
Storage Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
■CHAPTER 10
Data Guard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
■CHAPTER 11
Application Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
■CHAPTER 12
Data Warehousing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
■INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
v
www.it-ebooks.info
www.it-ebooks.info
Contents
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
■CHAPTER 1
Installing, Upgrading, and Managing Change . . . . . . . . . . . . . 1
New Features in Server Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Changes in the Optimal Flexible Architecture . . . . . . . . . . . . . . . . . . . 2
Changes in the Install Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
New Oracle Database 11g Components . . . . . . . . . . . . . . . . . . . . . . . 4
Role and Privilege Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Installing Oracle Database 11g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
New Features in Database Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
New Initialization Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
DBCA Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
New Oracle Background Processes . . . . . . . . . . . . . . . . . . . . . . . . . . 16
New Oracle-Supplied PL/SQL Packages . . . . . . . . . . . . . . . . . . . . . . 17
Upgrading to Oracle Database 11g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Upgrading and the Compatibility Factor . . . . . . . . . . . . . . . . . . . . . . . 18
Upgrade Path to Oracle 11g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Upgrading with the DBUA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Performance Testing the Upgrade . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Downgrading After an Upgrade to 11g . . . . . . . . . . . . . . . . . . . . . . . . 25
Rolling Upgrade Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Oracle Clusterware Upgrade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Real Application Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Database Replay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
The SQL Performance Analyzer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Database Software Patching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
New Features in Database Control for Patching . . . . . . . . . . . . . . . . 53
Emergency Hot Patching (Online Database Patching) . . . . . . . . . . . 55
Database Change Management Pack . . . . . . . . . . . . . . . . . . . . . . . . 56
Software and Database Cloning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
vii
www.it-ebooks.info
viii
■C O N T E N T S
■CHAPTER 2
Database Diagnosability and Failure Repair
. . . . . . . . . . . . . 57
The Fault Diagnosability Infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Problems and Incidents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Incident Packaging Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Structure and Location of the ADR . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Investigating and Resolving Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Using the Command-Line Tool adrci . . . . . . . . . . . . . . . . . . . . . . . . . 63
The Support Workbench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Database Health Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Checks, Failures, and Repairs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Types of Health Monitor Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Manual Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Data Recovery Advisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Managing the Data Recovery Advisor Through RMAN . . . . . . . . . . . 89
SQL Test Case Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Improvements in Handling Data Corruption . . . . . . . . . . . . . . . . . . . . . . . . 96
■CHAPTER 3
Database Administration
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Database Automation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Automatic Memory Management . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Automated Database Maintenance Tasks . . . . . . . . . . . . . . . . . . . . 105
Flashback-Related New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Total Recall and the Flashback Data Archive . . . . . . . . . . . . . . . . . 111
Flashback Transaction Backout . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Database Administration New Features . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Virtual Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
New Data Partitioning Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Allowing DDL Locks to Wait for DML Locks . . . . . . . . . . . . . . . . . . . 128
Explicit Locking of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Invisible Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Read-Only Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Temporary Tablespace Management . . . . . . . . . . . . . . . . . . . . . . . . 133
Creating an Initialization Parameter File from Memory . . . . . . . . . 136
Restore Point Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Database Resident Connection Pooling . . . . . . . . . . . . . . . . . . . . . . 139
Comparing and Converging Database Objects . . . . . . . . . . . . . . . . 143
www.it-ebooks.info
■C O N T E N T S
SQL*Plus New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
SQL*Plus Error Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Default Settings in the SQL*Plus Executable . . . . . . . . . . . . . . . . . . 149
Enhanced SQL*Plus BLOB Support . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Online Application Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Support for New Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Enhanced Online Index Creation and Rebuild . . . . . . . . . . . . . . . . . 150
Enhanced Default Column Value Functionality . . . . . . . . . . . . . . . . 151
Online Reorganization of Materialized Views . . . . . . . . . . . . . . . . . . 152
Minimal Invalidation of Dependent Objects . . . . . . . . . . . . . . . . . . . 152
Oracle Advanced Table Compression Option . . . . . . . . . . . . . . . . . . . . . . 153
How the New Compression Feature Works . . . . . . . . . . . . . . . . . . . 154
Storage and Performance Gains . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Implementing OLTP Table Compression . . . . . . . . . . . . . . . . . . . . . 154
Compressing Unstructured Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Enterprise Manager New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
The Availability Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
The Server Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
New Related Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
LogMiner Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Database Diagnostic Pack and Tuning Pack . . . . . . . . . . . . . . . . . . 160
Oracle Scheduler New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Lightweight Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Remote External Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Scheduler Support for Data Guard . . . . . . . . . . . . . . . . . . . . . . . . . . 165
■CHAPTER 4
Performance Management
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
SQL and PL/SQL Performance Enhancements . . . . . . . . . . . . . . . . . . . . 168
Automatic “Native” PL/SQL Compilation . . . . . . . . . . . . . . . . . . . . . 168
Faster DML Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Adaptive Cursor Sharing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
New Result Caching Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Using the Server Result Cache to Enhance Performance . . . . . . . . 175
Managing the Query Result Cache . . . . . . . . . . . . . . . . . . . . . . . . . . 185
PL/SQL Function Result Cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Intra Unit Inlining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
www.it-ebooks.info
ix
x
■C O N T E N T S
Automatic SQL Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Automation of SQL Tuning in Oracle Database 11g . . . . . . . . . . . . 191
SQL Access Advisor Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . 194
Optimizer and Statistics Collection Enhancements . . . . . . . . . . . . . . . . . 197
Multicolumn Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Expression Statistics for Functions and Expressions . . . . . . . . . . . 201
Changing Statistics Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Keeping Statistics Pending vs. Publishing
Statistics Immediately . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
SQL Plan Management (SPM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
ADDM Enhancements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
AWR Baselines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Baseline Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Adaptive Baseline Metric Thresholds . . . . . . . . . . . . . . . . . . . . . . . . 221
Performance-Related Changes in Database Control . . . . . . . . . . . . . . . . 222
Customized Performance Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Average Active Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
ADDM Performance Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
■CHAPTER 5
Database Security
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Enterprise Database Security Concerns . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Stronger Password Hash Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 226
Security Out of the Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Delayed Failed Logins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Case-Sensitive Passwords. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Basic Compliance with Industry Security Recommendations . . . . 230
Upgrade Implications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Password Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Case-Sensitive Password Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Change Default User Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Database Links and Case Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . 233
Password Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Tablespace Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Creating the Oracle Wallet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Wallet Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Encrypted Tablespace Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Encrypting a Tablespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
www.it-ebooks.info
■C O N T E N T S
Enterprise Manager Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Transparent Data Encryption with Enterprise Manager
Database Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Tablespace Encryption with Database Console . . . . . . . . . . . . . . . . 245
Policy Trend Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Additional Security Management Integration in
Database Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
UTL_ Package Network Access Management . . . . . . . . . . . . . . . . . . . . . 248
Fine-Grained Access Control for UTL_* Network Packages . . . . . 249
sysasm Privilege for Automatic Storage Management . . . . . . . . . . 258
LOB Encryption Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
Data Pump Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
RMAN Virtual Private Catalog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
RMAN Backup Shredding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
TDE with LogMiner Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
TDE with Data Guard SQL Apply . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Oracle Audit Vault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
TDE with Hardware Security Module Integration . . . . . . . . . . . . . . 259
Oracle Advanced Security Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Kerberos Cross-Realm Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
sysdba Strong Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Oracle Call Interface Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Set the Level of Information Captured for Bad Packets . . . . . . . . . 262
Delay or Drop Database Connections . . . . . . . . . . . . . . . . . . . . . . . . 262
Configure Maximum Number of Server Connection Attempts . . . . 263
Control the Display of Database Release Information. . . . . . . . . . . 263
Set Up the Banner and Auditing for Unauthorized Access . . . . . . . 264
■CHAPTER 6
Backup and Recovery
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Enhanced Block Media Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Preconditions for Using the recover … block Command . . . . . . . . 266
Using the recover … block Command . . . . . . . . . . . . . . . . . . . . . . . 267
RMAN Management Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Scripting with RMAN Substitution Variables . . . . . . . . . . . . . . . . . . 270
New RMAN Configuration Parameters . . . . . . . . . . . . . . . . . . . . . . . 273
Backing Up Large Files in Sections . . . . . . . . . . . . . . . . . . . . . . . . . 274
Creating Archival (Long-Term) Backups . . . . . . . . . . . . . . . . . . . . . 276
The New Validate Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Configuring an Archived Redo Log Deletion Policy . . . . . . . . . . . . . 285
Archived Redo Log Failover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
www.it-ebooks.info
xi
xii
■C O N T E N T S
Backup Shredding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Optimized Backing Up of Undo Data . . . . . . . . . . . . . . . . . . . . . . . . . 288
Active (Network-Based) Database Duplication . . . . . . . . . . . . . . . . . . . . 288
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Necessary Spfile Modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Performing Active Duplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
How Network-Enabled Duplication Works . . . . . . . . . . . . . . . . . . . . 297
Recovery Catalog Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Merging Recovery Catalogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Moving a Recovery Catalog to Another Database . . . . . . . . . . . . . . 302
Virtual Private Catalogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Enhanced RMAN Integration with Data Guard . . . . . . . . . . . . . . . . . . . . . 307
Configuring RMAN Without a Database Connection . . . . . . . . . . . . 308
Restoring a Backup Controlfile to a Standby Controlfile . . . . . . . . . 309
Resynchronizing the Recovery Catalog . . . . . . . . . . . . . . . . . . . . . . 310
Backup File Accessibility Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Block Change Tracking Support in Standby Databases . . . . . . . . . 311
■CHAPTER 7
Data Pump
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
API Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Compression Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Specifying Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Choosing an Encryption Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Reusing a Dump File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Remapping Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Remapping a Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
Export and Import of Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Ignoring Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
External Tables Based on Data Pump . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Stored Procedure to Generate External Table Using a
Data Pump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
■CHAPTER 8
Oracle Streams
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Synchronous Capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
Restrictions on Synchronous Capture . . . . . . . . . . . . . . . . . . . . . . . 338
Configuring Synchronous Capture . . . . . . . . . . . . . . . . . . . . . . . . . . 339
DBA Views for Synchronous Capture . . . . . . . . . . . . . . . . . . . . . . . . 341
www.it-ebooks.info
■C O N T E N T S
Combined Capture and Apply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
Requirements for Combined Capture and Apply . . . . . . . . . . . . . . . 342
Combined Capture and Apply Validation . . . . . . . . . . . . . . . . . . . . . 343
Performance Advisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Streams Advisor Admin Package . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Streams Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Streams Topology Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
DBMS_COMPARISON for “Compare and Repair” . . . . . . . . . . . . . . . . . . 348
DBMS_COMPARISON Requirements . . . . . . . . . . . . . . . . . . . . . . . . 348
Supported Database Object Types . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Comparison Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Rechecking a Prior Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
Converging Shared Database Objects (Repair) . . . . . . . . . . . . . . . . 352
Splitting and Merging of a Destination . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
Splitting a Stream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
Merging the Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
Merge Streams Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Usability Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Message Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Automated Alerts for Clients and Thresholds . . . . . . . . . . . . . . . . . 356
Identifying Newly Supported Tables View . . . . . . . . . . . . . . . . . . . . 357
Identifying Minimum Required Checkpoint SCN . . . . . . . . . . . . . . . 357
Background Process Name Changes . . . . . . . . . . . . . . . . . . . . . . . . 357
Support for XMLType Values Stored As CLOBs . . . . . . . . . . . . . . . . 358
Support for Transparent Data Encryption. . . . . . . . . . . . . . . . . . . . . 358
Support for Oracle Scheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
■CHAPTER 9
Storage Management
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Automated Storage Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Misconceptions of ASM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
RMAN and ASM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
sysasm Privilege and osasm Group . . . . . . . . . . . . . . . . . . . . . . . . . 363
Fast Rebalance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
ASM Upgrade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Upgrading Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Upgrading Using DBUA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Rolling Upgrades . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
www.it-ebooks.info
xiii
xiv
■C O N T E N T S
ASM Preferred Reads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
Preferred Read Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
Monitoring Preferred Reads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
ASM Restricted Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Diskgroup Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Allocation Unit (AU) Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
RDBMS and ASM Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Fast Mirror Resync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
asmcmd Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
ls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
lsdg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
lsct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
lsdsk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
cp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
Metadata Backup and Restore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Backup Diskgroup Using md_backup . . . . . . . . . . . . . . . . . . . . . . . 400
Restore Diskgroup Using md_restore. . . . . . . . . . . . . . . . . . . . . . . . 401
Metadata Backup and Restore Demonstration . . . . . . . . . . . . . . . . 402
Additional md_restore Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Bad Block Recovery with ASMCMD . . . . . . . . . . . . . . . . . . . . . . . . . 409
Oracle Direct NFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Set Up Direct NFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Validate Direct NFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Disable Direct NFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Network Interface Card Bonding . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Direct NFS Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
■CHAPTER 10 Data Guard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Active Physical Standby Database Duplication . . . . . . . . . . . . . . . . . . . . 416
Real-Time Query Standby . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Start the Real-Time Query Standby . . . . . . . . . . . . . . . . . . . . . . . . . 419
Validate the Real-Time Query Standby Database . . . . . . . . . . . . . . 419
Design the Real-Time Query Database . . . . . . . . . . . . . . . . . . . . . . 421
Snapshot Standby . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Convert to Snapshot Standby . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
Convert Back to Physical Standby . . . . . . . . . . . . . . . . . . . . . . . . . . 425
Using the Physical Standby for Rolling Upgrades . . . . . . . . . . . . . . . . . . 426
Prepare the Primary Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
Convert to Logical: Keep Your Identity . . . . . . . . . . . . . . . . . . . . . . . 427
www.it-ebooks.info
■C O N T E N T S
Improvements in Redo Transport . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
Block Change Tracking Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
RMAN Understands Data Guard Configurations . . . . . . . . . . . . . . . 429
Improved Integration with RMAN . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
Compressed Redo Traffic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
Usage of Histograms for the NET_TIMEOUT Attributes . . . . . . . . . 430
Fast-Start Failover for Maximum Performance Mode. . . . . . . . . . . 432
Logical Standby: SQL Apply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
Support for Transparent Data Encryption (TDE) . . . . . . . . . . . . . . . 433
Dynamically Set the Data Guard SQL Apply Parameters . . . . . . . . 434
Support for VPD and FGA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
DBMS_SCHEDULER Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
Logical Standby Archivelog Storage . . . . . . . . . . . . . . . . . . . . . . . . . 436
SQL Apply Event Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
Data Guard Broker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
Data Guard Broker Command-Line Interface . . . . . . . . . . . . . . . . . 438
Customize Fast-Start Failover Events . . . . . . . . . . . . . . . . . . . . . . . . 440
Initiate Fast-Start Failover from Applications . . . . . . . . . . . . . . . . . 441
New Data Guard Manager Properties . . . . . . . . . . . . . . . . . . . . . . . . 442
Detect Lost-Write Conditions Using a Physical Standby . . . . . . . . 443
Support of Heterogeneous OS Data Guard Configuration. . . . . . . . 443
Oracle Database 11g Data Guard Over Storage
Vendor Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
■CHAPTER 11
Application Development
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
New PL/SQL Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
CONTINUE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
Sequences Without Dual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
Native Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
SIMPLE_INTEGER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
Regular Expression Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . 449
Named and Mixed Arguments in SQL Statement PL/SQL
Function Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
Subprogram Inlining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
Generalized Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
Cross-Session PL/SQL Function Result Cache . . . . . . . . . . . . . . . . 458
Bulk In-Bind Table of Records in FORALL . . . . . . . . . . . . . . . . . . . . 463
Dynamic SQL Symmetry and New Functionality . . . . . . . . . . . . . . . 465
www.it-ebooks.info
xv
xvi
■C O N T E N T S
New Trigger Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
Trigger Ordering: The FOLLOWS Clause . . . . . . . . . . . . . . . . . . . . . 469
Creating Triggers As ENABLED or DISABLED . . . . . . . . . . . . . . . . . 469
Compound Triggers Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
XML DB Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
Repository Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
Support Content Repository API for Java: JSR-170 . . . . . . . . . . . . 475
ACL Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
New XMLType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
XMLIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Native Web Services for Oracle XML DB . . . . . . . . . . . . . . . . . . . . . 493
XQuery Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
XML Developer’s Kit (XDK) Improvements . . . . . . . . . . . . . . . . . . . . 502
Application Express (APEX) Enhancements . . . . . . . . . . . . . . . . . . . . . . . 505
APEX Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
APEX Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
PHP Support Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
Java Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
Just-in-Time (JIT) Compiler and Native Compilation . . . . . . . . . . . 508
JAR Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
Improvements to the loadjava Tool . . . . . . . . . . . . . . . . . . . . . . . . . . 510
Improvements to the dropjava Tool . . . . . . . . . . . . . . . . . . . . . . . . . 510
Improvements to the ojvmjava Tool . . . . . . . . . . . . . . . . . . . . . . . . . 511
The ojvmtc Tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
■CHAPTER 12 Data Warehousing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
Next-Generation LOBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
SecureFiles Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
BasicFiles vs. SecureFiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
LOB Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
Deduplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
DBMS_LOB.SETOPTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
db_securefile Initialization Parameter . . . . . . . . . . . . . . . . . . . . . . . 525
Migrate from BasicFiles to SecureFiles . . . . . . . . . . . . . . . . . . . . . . 526
LOB Prefetch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
www.it-ebooks.info
■C O N T E N T S
Data Warehousing New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
Partition Change Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
Materialized View Refresh Performance Improvements. . . . . . . . . 529
Materialized View QUERY REWRITE Enhancements . . . . . . . . . . . . 530
Pivot Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
Unpivot Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
Partition Advisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
Reference Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
Interval Partitioning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
Extended Composite Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
Virtual Column-Based Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . 556
System Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
Enhanced Partition Pruning Capabilities . . . . . . . . . . . . . . . . . . . . . 561
Oracle Multimedia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
Enhanced DICOM Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
ORDDICOM Object Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
Image Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
Support for SecureFiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
Additional Multimedia Enhancements . . . . . . . . . . . . . . . . . . . . . . . 563
■INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
www.it-ebooks.info
xvii
www.it-ebooks.info
About the Authors
■SAM ALAPATI is an Oracle DBA for the Boy Scouts of America, working at
their national office in Los Colinas, Texas. Prior to this, Sam worked at
Sabre, Oracle Corporation, and NBC. Sam has previously published
Expert Oracle9i Database Administration, Expert Oracle Database 10g
Administration, and Oracle Database 11g RMAN Recipes, as well as two
OCP certification books for Oracle Press. Sam has been working with
relational databases since 1985, starting with the Ingres database. Sam
holds the OCP certification for Oracle DBAs as well as the HP-UX System
Administrator certification.
■CHARLES KIM, director of database technologies at Novara Solutions, is
an Oracle Certified DBA, Red Hat Certified Technician, and Microsoft
Certified Professional. He has more than 17 years of IT experience and
has worked with Oracle since 1991. Prior to this, Charles served at Fidelity
National Information Services as the chief Oracle database engineering
counsel and also worked at GMAC Mortgage, i2 Technologies, and Oracle
Corporation. Charles also serves as a technical editor for Oracle Press.
Charles has presented advanced topics for IOUG and Oracle OpenWorld
on such topics as RAC/ASM and 7×24 high availability considerations using Oracle Advanced
Replication, Hot Standby, and Quest Shareplex. Charles manages the DBAExpert.com web site
and provides technical solutions to Oracle DBAs and developers.
Charles is the author of the Maximum Availability Architecture case study at Oracle’s web
site (http://www.oracle.com/technology/deploy/availability/htdocs/FNF_CaseStudy.html).
xix
www.it-ebooks.info
www.it-ebooks.info
Acknowledgments
F
irst and foremost, I’d like to acknowledge my gratitude for Charles Kim, my coauthor. It’s a
privilege to write a book with a consummate Oracle professional such as Charles. Charles has
made writing this book a great pleasure, and he worked hard to meet our short deadlines, this
being a “new features” book, whose contents always seem to be in a flux.
No Oracle-based book, let alone a “new features” book, can be conjured from thin air. I
want to acknowledge the wonderful efforts of the Oracle Beta folks, who made the Oracle Database 11g Beta release available to me by extending an invitation to be part of their beta testing
team. I benefited immensely by the high-quality e-studies and other technical studies made
available by Oracle Corporation to the beta participants, as well as from the access to the beta
software itself. I want to acknowledge in particular Lynn Snyder and Debbie Migliore, as well as
Sheila Cepero, all from Oracle Corporation, for all their help over the last year while I was testing
this exciting new offering from Oracle Corporation.
Jonathan Gennick, the editor, has as usual left his powerful mark on the book. I can’t think
of any part of this book that didn’t benefit from Jonathan’s conscientious and superb editing at
both the technical as well the editorial level. Robert Blok, the technical editor, helped by pointing
out several aspects that needed clarification. I owe thanks to the professional competence that
the project manager, Sofia Marchant, brought to bear on the book. Sofia’s kindness and cool
efficiency over the past few months while managing a book under short deadlines is what helped
Charles and I finish this book on time. Kim Wimpsett, the copy editor, did a superb job, going
to great lengths to nail down numerous issues regarding style, terminology, consistency, and
accuracy (although I think I’ve imposed a considerable burden on her by adding more new
features in each iteration of the review process!). Kelly Winquist, the production editor, admirably
managed the stupendously difficult task of getting this book out in time without compromising
quality. April Eddy, the proofreader, did a brilliant job, without which my less than perfect
typing skills would have been fully evident to the world. April has not only caught several insidious typos but also zoomed in on several tricky usage situations, always pointing out the correct
approach. I’m grateful for the efforts of Sofia, Kim, Kelly, and April as well as the entire production
group for going way beyond any call of duty and cheerfully moving the book along under the
stress of looming deadlines. It’s customary for the author to thank the editorial and production
folks, I suppose, but I simply can’t imagine this book being ready in time and in good shape
without the supreme effort and dedication shown by the previously mentioned people.
My managers, Dave Campbell and David Jeffries, have been supportive of my endeavors,
and I’m grateful for their encouragement over the years. My colleagues—Rob Page, Lance Parkes,
Stan Galbraith, Dan Nelson, Dabir Haidar, Sabrina Kirkpatrick, and Carla Wallace—have also
been helpful to me at work, and I appreciate their help and friendship. I also want to acknowledge
my friends at work, Debra Kendrew, Myra Riggs, and especially Leticia Salazar; Leticia has been
very helpful during the past few months in helping take care of a lot of my affairs at work.
xxi
www.it-ebooks.info
xxii
■A C K N O W L E D G M E N T S
Nothing I do in my personal and professional lives would be possible without the constant
support and encouragement of my family. I’d like to express my gratitude for the love, affection, and sacrifice of my parents, Appa Rao and Swarna Kumari; my brothers, Hari Hara Prasad
and Siva Sankara Prasad; and my sisters-in law, Aruna and Vanaja. At home, the love and
support of my wife, Valerie, sustains me. Valerie’s support and immense sacrifices have been
crucial to the writing of this, as well as all my other books. Writing this book has meant time
away from my children, Nina, Nicholas, and Shannon, and I can only promise that I’ll make it up to
them soon!
—Sam R. Alapati
Most important, I want to thank my dear wife, Melissa, and our three boys, Isaiah, Jeremiah,
and Noah, for their unceasing support during the project and sacrificing precious family time.
Without their prayers and encouragement, I could not have completed this project.
On a professional note, I would like to thank Leisa Pitner (http://leisapitner.com) for
surrendering nights to rush edits and revisions of the chapters on last-minute notice. Leisa Pitner
has served in several key roles in information technology ranging from business process engineer to director of internal applications for a 1 billon dollar software company. She has successfully
facilitated the transformation of process and culture across multiple industries, leveraging her
system’s design and business process engineering background.
I would like to thank David Sweet, director of development practice at Novara Solutions,
for contributing the PL/SQL and Java portions to Chapter 11. David has been working with
Oracle since 1987 and, in my opinion, is one of the most elite developers in the industry.
I would like to extend an appreciation to Nitin Vengurlekar, member of the technical staff
at Oracle and author of the Automated Storage Administration book. We shared a few battle
scars of the book-authoring process. His review of Chapter 9 provided great insight and enhanced
the overall quality of the chapter.
I can’t forget the folks on Oracle’s High Availability product development team, especially
Joe Meeks and Larry Carpenter, for reviewing Chapter 10 and encouraging me to go forward.
Thank you for the valuable input and recommendations.
My sincere gratitude goes to Debbie Migliore, director of Server Technologies