Oracle Database DBA Handbook - WordPress

3y ago
42 Views
6 Downloads
9.22 MB
698 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Milena Petrie
Transcription

Oracle Database11g DBA Handbook

About the AuthorsBob Bryla is an Oracle 9i and 10g Certified Professional with more than 20 years of experience indatabase design, database application development, training, and Oracle database administration.He is the primary Internet database designer and an Oracle DBA at Lands’ End in Dodgeville,Wisconsin.In his spare time, he is a technical editor for a number of Oracle Press and Apress books, inaddition to authoring several certification study guides for Oracle 10g and Oracle 11g. He hasalso been known to watch science fiction movies and read science fiction novels in his spare time.Kevin Loney, Director of Data Management for a major financial institution, is an internationallyrecognized expert in the design, development, administration, and tuning of Oracle databases.An Oracle developer and DBA since 1987, he has implemented large-scale transaction processingsystems and data warehouses.He is the author of numerous technical articles and the lead author or coauthor of suchbest-selling books as Oracle: The Complete Reference. He regularly presents at Oracle userconferences in North America and Europe, and in 2002 was named Consultant of the Yearby ORACLE Magazine.About the Technical EditorScott Gossett is a Technical Director for Oracle Corporation’s Advanced Technology Solutionsorganization specializing in RAC, performance tuning and high availability databases. Prior tobecoming a technical director, Scott was a Senior Principal Instructor for Oracle Education forover twelve years, primarily teaching Oracle Internals, performance tuning, RAC and databaseadministration classes. In addition, Scott is one of the architects and primary authors of the OracleCertified Masters exam.

Oracle Database11g DBA HandbookBob BrylaKevin LoneyNew York Chicago San FranciscoLisbon London Madrid Mexico City MilanNew Delhi San Juan Seoul Singapore SydneyToronto

Copyright 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Manufactured in the United States of America.Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributedin any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher.0-07-159579-1The material in this eBook also appears in the print version of this title: 0-07-149663-7.All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of atrademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention ofinfringement of the trademark. Where such designations appear in this book, they have been printed with initial caps.McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporatetraining programs. For more information, please contact George Hoare, Special Sales, at george hoare@mcgraw-hill.com or (212)904-4069.TERMS OF USEThis is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve all rights in and tothe work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to storeand retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivativeworks based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill’sprior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictlyprohibited. Your right to use the work may be terminated if you fail to comply with these terms.THE WORK IS PROVIDED “AS IS.” McGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEES ORWARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINEDFROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIAHYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDINGBUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULARPURPOSE. McGraw-Hill and its licensors do not warrant or guarantee that the functions contained in the work will meet yourrequirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill nor its licensors shall be liable to youor anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom.McGraw-Hill has no responsibility for the content of any information accessed through the work. Under no circumstances shallMcGraw-Hill and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages thatresult from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. Thislimitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort orotherwise.DOI: 10.1036/0071496637

ProfessionalWant to learn more?We hope you enjoy thisMcGraw-Hill eBook! Ifyou’d like more information about this book,its author, or related books and websites,please click here.

To the gang at home: I couldn’t have done it without you! And the pizzas.—B.B.

This page intentionally left blank

Contents at a GlancePART IDatabase Architecture1Getting Started with the Oracle Architecture.32Upgrading to Oracle Database 11g.493Planning and Managing Tablespaces.614Physical Database Layouts and Storage Management.75PART IIDatabase Management5Developing and Implementing Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1236Monitoring Space Usage7Managing Transactions with Undo Tablespaces8Database Tuning9Database Security and Auditing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163. . . . . . . . . . . . . . . . . . . . . . . . . . 207. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277PART IIIHigh Availability10Real Application Clusters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34911Backup and Recovery Options12Using Recovery Manager (RMAN)13Oracle Data Guard14Miscellaneous High Availability Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495vii

viiiOracle Database 11g DBA HandbookPART IVNetworked Oracle15Oracle Net.16Managing Large Databases17Managing Distributed Databases.Appendix: Installation and ConfigurationIndex511543599.635.653

For more information about this title, click hereContentsAcknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xixxxiPART IDatabase Architecture1Getting Started with the Oracle Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .An Overview of Databases and Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Instances.Oracle Logical Storage Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Tablespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Blocks.Extents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Oracle Logical Database Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Users and Schemas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Synonyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .PL/SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .External File Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Database Links and Remote Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Oracle Physical Storage Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Datafiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Redo Log Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Control Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Archived Log Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Initialization Parameter Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ix3445667778815171921212222222324242526262727

xOracle Database 11g DBA HandbookAlert and Trace Log Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Backup Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Oracle Managed Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Password Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Multiplexing Database Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Automatic Storage Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Manual Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Oracle Memory Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .System Global Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Program Global Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Software Code Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Background Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Backup/Recovery Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Export/Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Offline Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Online Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .RMAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Security Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Privileges and Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Auditing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Fine-grained Auditing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Virtual Private Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Label Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Real Application Clusters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Oracle Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Oracle Enterprise Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Oracle Initialization Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Basic Initialization Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Advanced Initialization Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2424343472Upgrading to Oracle Database 11g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Choosing an Upgrade Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Before Upgrading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using the Database Upgrade Assistant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Performing a Manual Direct Upgrade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using Export and Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Export and Import Versions to Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Performing the Upgrade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using the Data-Copying Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .After Upgrading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .495152535457575758593Planning and Managing Tablespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Tablespace Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Tablespace Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Optimal Flexible Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Oracle Installation Tablespaces.SYSTEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .SYSAUX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61626268727272

Contents4TEMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .UNDOTBS1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .USERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .EXAMPLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Segment Segregation.7273737373Physical Database Layouts and Storage Management . . . . . . . . . . . . . . . . . . . . . . . . .Traditional Disk Space Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Resizing Tablespaces and Datafiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Moving Datafiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Moving Online Redo Log Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Moving Control Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Automatic Storage Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ASM Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Creating an ASM Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ASM Instance Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ASM Dynamic Performance Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ASM Filename Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ASM File Types and Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Administering ASM Disk Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .757676929496989899101103103105107PART IIDatabase Management5Developing and Implementing Applications.Tuning by Design: Best Practices.Do As Little As Possible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Do It As Simply As Possible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Tell the Database What It Needs to Know . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Maximize the Throughput in the Environment . . . . . . . . . . . . . . . . . . . . . . . . .Divide and Conquer Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Test Correctly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Standard Deliverables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Resource Management and Stored Outlines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Implementing the Database Resource Manager . . . . . . . . . . . . . . . . . . . . . . . .Implementing Stored Outlines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Sizing Database Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using Temporary Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Supporting Tables Based on Abstract Datatypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using Object Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Security for Abstract Datatypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Indexing Abstract Datatype Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Quiescing and Suspending the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Supporting Iterative Development.Iterative Column Definitions . . . . .

Bob Bryla is an Oracle 9i and 10g Certified Professional with more than 20 years of experience in database design, database application development, training, and Oracle database administration. He is the primary Internet database designer and an Oracle DBA at Lands’ End in Dodgeville, Wisconsin.

Related Documents:

viii Related Documentation The platform-specific documentation for Oracle Database 10g products includes the following manuals: Oracle Database - Oracle Database Release Notes for Linux Itanium - Oracle Database Installation Guide for Linux Itanium - Oracle Database Quick Installation Guide for Linux Itanium - Oracle Database Oracle Clusterware and Oracle Real Application Clusters

2 Installing Oracle Database and Creating a Database 2.1 Overview of Installing Oracle Database Software and Creating a Database 2-1 2.1.1 Checking Oracle Database Installation Prerequisites 2-2 2.1.2 Deciding on Oracle Database Installation Choices 2-3 2.1.2.1 Install Option for Oracle Database 2-3 2.1.2.2 Installation Class for Oracle .

Oracle e-Commerce Gateway, Oracle Business Intelligence System, Oracle Financial Analyzer, Oracle Reports, Oracle Strategic Enterprise Management, Oracle Financials, Oracle Internet Procurement, Oracle Supply Chain, Oracle Call Center, Oracle e-Commerce, Oracle Integration Products & Technologies, Oracle Marketing, Oracle Service,

Toad for Oracle Base Edition Toad for Oracle Professional Edition Toad for Oracle Xpert Edition Toad DB Admin Module (add-on) Toad Development Suite for Oracle Toad DBA Suite for Oracle Toad DBA Suite for Oracle - RAC Edition Toad DBA Suite for Oracle - Exadata Edition Convert embedded SQL to other programming languages (Delphi, C, C ,

SQL DBA Training Course Plan Training Module Dur SQL DBA Plan A SQL DBA Plan B SQL DBA Plan C Module 1 Core SQL DBA [HA-DR, AlwaysOn, Errors, Upgrades] 6 W Module 2 Azure SQL DBA [Migrations, HA-DR, PowerShell, Linux] 3 W X Module 3 Power BI Report Design, Cloud & Server Admin 4 W X X

Oracle Database Net Services Administrator's Guide SQL*Plus User's Guide and Reference Oracle Database Heterogeneous Connectivity User's Guide Oracle Database 2 Day DBA Oracle Database Security Guide Many of the examples in this book use the sample schemas of the seed database, which is installed by default when you install Oracle.

Oracle is a registered trademark and Designer/2000, Developer/2000, Oracle7, Oracle8, Oracle Application Object Library, Oracle Applications, Oracle Alert, Oracle Financials, Oracle Workflow, SQL*Forms, SQL*Plus, SQL*Report, Oracle Data Browser, Oracle Forms, Oracle General Ledger, Oracle Human Resources, Oracle Manufacturing, Oracle Reports,

This, too, is still basic to conventional literary criticism and is also open to seriou objection. De Wette in 1805 assigned Deuteronomy to the time of Josiah, such that pentateuchal matter considered dependent on Deuteronomy would be still later than it; 160 years later this is still commonly held, despite opposition. In the first half of the 19th century rival theses arose alongside the .