intTypePromotion=1
ADSENSE

Oracle Database 11g: A Beginner’s Guide

Chia sẻ: Phung Tuyet | Ngày: | Loại File: PDF | Số trang:433

237
lượt xem
30
download
 
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

.Oracle Database 11g: A Beginner’s Guide Ian Abramson Michael Abbey Michael J. Corey Michelle Malcher New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney TorontoDatabase Fundamentals,

Chủ đề:
Lưu

Nội dung Text: Oracle Database 11g: A Beginner’s Guide

  1. Oracle Database 11g : A Beginner’s Guide Ian Abramson Michael Abbey Michael J. Corey Michelle Malcher New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney Toronto
  2. Copyright © 2009 by The McGraw-Hill Companies, Inc. All rights reserved. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval sys- tem, without the prior written permission of the publisher. ISBN: 978-0-07-160460-4 MHID: 0-07-160460-X The material in this eBook also appears in the print version of this title: ISBN: 978-0-07-160459-8, MHID: 0-07-160459-6. All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trade- mark. 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 corporate training programs. To contact a representative please e-mail us at bulksales@mcgraw-hill.com. Information has been obtained by Publisher from sources believed to be reliable. However, because of the possibility of human or mechan- ical error by our sources, Publisher, or others, Publisher does not guarantee to the accuracy, adequacy, or completeness of any information included in this work and is not responsible for any errors or omissions or the results obtained from the use of such information. Oracle Corporation does not make any representations or warranties as to the accuracy, adequacy, or completeness of any information con- tained in this Work, and is not responsible for any errors or omissions. TERMS OF USE This is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, dis- tribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill’s prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. 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 OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUD- ING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WAR- RANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill nor its licensors shall be liable to you or 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 shall McGraw-Hill and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the pos- sibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise.
  3. This book is dedicated to all those who have helped us learn and become better professionals. We share this with all of you.
  4. About the Authors Ian Abramson is the current president for the Independent Oracle Users Group (IOUG). Based in Toronto, Canada, he is an experienced industry and technical consultant, providing expert guidance in implementing solutions for clients in telecommunications, CRM, utilities, and other industries. His focus includes the Oracle product set, as well as other leading technologies and their use in optimizing data warehouse design and deployment. He is also a regular speaker at various technology conferences, including COLLABORATE, Oracle OpenWorld, and other local and regional events. Michael Abbey is a recognized authority on database administration, installation, development, application migration, performance tuning, and implementation. Working with Ian Abramson and Michael Corey, he has coauthored works in the Oracle Press series for over 14 years. Active in the international Oracle user community, Abbey is a frequent presenter at COLLABORATE, Oracle OpenWorld, and regional user group meetings. Michael J. Corey is the founder and CEO of Ntirety—The Database Administration Experts. Michael’s roots go back to Oracle version 3.0. Michael is a past president of the Independent Oracle Users group (www.ioug.org) and the original Oracle Press author. Michael is a frequent speaker at business and technology events and has presented all over the world. Check out Michael’s blog at http://michaelcorey.ntirety.com. Michelle Malcher is a Senior Database Administrator with over ten years’ experience in database development, design, and administration. She has expertise in performance tuning, security, data modeling, and database architecture of very large database environments. She is a contributing author for the IOUG Best Practices Tip Booklet. Michelle is enthusiastically involved with the Independent Oracle User Group and is director of Special Interest Groups. She enjoys presenting and sharing ideas about Oracle Database topics at technology conferences and user group meetings. She can be reached at michelle_malcher@ioug.org. About the Reviewers Carl Dudley has worked closely with Oracle for a number of years and presents regularly at international conferences on Oracle database technology. He is currently a consultant database administrator and has research interests in database performance, disaster planning, and security. Carl is a director of the UK Oracle User Group, received Oracle Magazine’s Editors’ Choice Award for Database Administrator of the Year in 2003 for services to the Oracle community, and achieved Oracle ACE status in 2007. Ted Falcon, based in Toronto, Canada, is CEO of BDR Business Data Reporting Inc. He has ten years’ experience in business intelligence reporting systems, specializing in the Cognos suite of tools.
  5. Contents ACKNOWLEDGMENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv 1 Database Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Critical Skill 1.1 Define a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Critical Skill 1.2 Learn the Oracle Database 11g Architecture . . . . . . . 4 The Control Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 The Online Redo Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 The System Tablespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 The Sysaux Tablespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Default Temporary Tablespace . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Undo Tablespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 The Server Parameter File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Background Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Project 1-1 Review the Oracle Database 11g Architecture . . . . . . . . . 9 The Database Administrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Critical Skill 1.3 Learn the Basic Oracle Database 11g Data Types . . . 11 varchar2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 timestamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 clob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 blob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Critical Skill 1.4 Work with Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Tables Related to part_master . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Critical Skill 1.5 Work with Stored Programmed Objects . . . . . . . . . . . 16 Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 v
  6. vi Oracle Database 11g : A Beginner’s Guide Critical Skill 1.6 Become Familiar with Other Important Items in Oracle Database 11g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Tablespace Quotas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Synonyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Default User Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Critical Skill 1.7 Work with Object and System Privileges . . . . . . . . . . 25 Select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Insert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Delete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 System Privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Critical Skill 1.8 Introduce Yourself to the Grid . . . . . . . . . . . . . . . . . . 27 Critical Skill 1.9 Tie It All Together . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Chapter 1 Mastery Check. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2 Installing Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Critical Skill 2.1 Research and Plan the Installation . . . . . . . . . . . . . . . 36 Define System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Linux Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Critical Skill 2.2 Set Up the Operating System . . . . . . . . . . . . . . . . . . . 42 Project 2-1 Configure Kernel Parameters . . . . . . . . . . . . . . . . . . . . . . 44 Critical Skill 2.3 Get Familiar with Linux . . . . . . . . . . . . . . . . . . . . . . . 47 Critical Skill 2.4 Choose Components to Install . . . . . . . . . . . . . . . . . . 48 Critical Skill 2.5 Install the Oracle Software . . . . . . . . . . . . . . . . . . . . . 49 Database Configuration Assistant . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Verify the Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Chapter 2 Mastery Check. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 3 Connecting to Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Critical Skill 3.1 Use Oracle Net Services . . . . . . . . . . . . . . . . . . . . . . 66 Network Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Optimize Network Bandwidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Maintain Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Define a Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Critical Skill 3.2 Learn the Difference Between Dedicated and Shared Server Architectures . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Dedicated Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Shared Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Set Dispatchers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Views to Monitor the Shared Server . . . . . . . . . . . . . . . . . . . . . . . . 76 Critical Skill 3.3 Define Connections . . . . . . . . . . . . . . . . . . . . . . . . . . 77
  7. vii Contents A Connect Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Define a Connect Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 The Oracle Connection Manager . . . . . . . . . . . . . . . . . . . . . . . . . . 78 Session Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Firewall Access Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Critical Skill 3.4 Use the Oracle Net Listener . . . . . . . . . . . . . . . . . . . . 80 Password Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Multiple Listeners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Connection Pooling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Critical Skill 3.5 Learn Naming Methods . . . . . . . . . . . . . . . . . . . . . . . 83 Directory Naming Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Directory Information Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Distinguished Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 How to Find the Directory Naming Information . . . . . . . . . . . . . . 85 Net Service Alias Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 The Local Naming Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 The Easy Naming Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 The External Naming Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Which Naming Method to Use . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Critical Skill 3.6 Use Oracle Configuration Files . . . . . . . . . . . . . . . . . 87 Critical Skill 3.7 Use Administration Tools . . . . . . . . . . . . . . . . . . . . . . 89 The Oracle Enterprise Manager/Grid Control . . . . . . . . . . . . . . . . . 89 The Oracle Net Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 The OEM Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 The OEM Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 The Oracle Net Configuration Assistant . . . . . . . . . . . . . . . . . . . . . 91 The Oracle Internet Directory Configuration Assistant . . . . . . . . . . 92 Command-Line Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 The Oracle Advanced Security Option . . . . . . . . . . . . . . . . . . . . . 94 Dispatchers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Project 3-1 Test a Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Critical Skill 3.8 Use Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Critical Skill 3.9 Network in a Multi-tiered Environment . . . . . . . . . . . 98 Critical Skill 3.10 Install the Oracle 11g Client Software . . . . . . . . . . . 99 Chapter 3 Mastery Check. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 4 SQL: Structured Query Language . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 Critical Skill 4.1 Learn the SQL Statement Components . . . . . . . . . . . . 106 DDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 DML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Critical Skill 4.2 Use Basic Insert and Select Statements . . . . . . . . . . . . 108 Insert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Critical Skill 4.3 Use Simple Where Clauses . . . . . . . . . . . . . . . . . . . . 111 A Where Clause with and/or . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
  8. viii Oracle Database 11g : A Beginner’s Guide The Where Clause with NOT . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 The Where Clause with a Range Search . . . . . . . . . . . . . . . . . . . . 115 The Where Clause with a Search List . . . . . . . . . . . . . . . . . . . . . . . 116 The Where Clause with a Pattern Search . . . . . . . . . . . . . . . . . . . . 116 The Where Clause: Common Operators . . . . . . . . . . . . . . . . . . . . 117 Critical Skill 4.4 Use Basic Update and Delete Statements . . . . . . . . . . 118 Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Delete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 Critical Skill 4.5 Order Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 Critical Skill 4.6 Employ Functions: String, Numeric, Aggregate (No Grouping) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 String Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Numeric Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Aggregate Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Critical Skill 4.7 Use Dates and Data Functions (Formatting and Chronological) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Date Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Special Formats with the Date Data Type . . . . . . . . . . . . . . . . . . . 127 Nested Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 Critical Skill 4.8 Employ Joins (ANSI vs. Oracle): Inner, Outer, Self . . . 129 Inner Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 Outer Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Project 4-1 Join Data Using Inner and Outer Joins . . . . . . . . . . . . . . . 134 Project 4-2 Join Data Using ANSI SQL Joins . . . . . . . . . . . . . . . . . . . 137 Self-Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Critical Skill 4.9 Learn the Group By and Having Clauses . . . . . . . . . . 140 Group By . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 Having . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Project 4-3 Group Data in Your Select Statements . . . . . . . . . . . . . . . 141 Critical Skill 4.10 Learn Subqueries: Simple and Correlated Comparison with Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 Simple Subquery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 Correlated Subqueries with Joins . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Critical Skill 4.11 Use Set Operators: Union, Intersect, Minus . . . . . . . 147 Union . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 Union All . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 Intersect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 Minus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 Project 4-4 Use the Union Function in Your SQL . . . . . . . . . . . . . . . . 149 Critical Skill 4.12 Use Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 Critical Skill 4.13 Learn Sequences: Just Simple Stuff . . . . . . . . . . . . . . 152 Critical Skill 4.14 Employ Constraints: Linkage to Entity Models, Types, Deferred, Enforced, Gathering Exceptions . . . . . . . . . . . . . . . . . . . . 153 Linkage to Entity Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
  9. ix Contents Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 Deferred . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 Critical Skill 4.15 Format Your Output with SQL*Plus . . . . . . . . . . . . . 156 Page and Line Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 Page Titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 Page Footers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 Formatting Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 Project 4-5 Format Your SQL Output . . . . . . . . . . . . . . . . . . . . . . . . . 157 Writing SQL*Plus Output to a File . . . . . . . . . . . . . . . . . . . . . . . . . 160 Chapter 4 Mastery Check. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 5 PL/SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 Critical Skill 5.1 Define PL/SQL and Learn Why We Use It . . . . . . . . . 164 Critical Skill 5.2 Describe the Basic PL/SQL Program Structure . . . . . . 166 Critical Skill 5.3 Define PL/SQL Data Types . . . . . . . . . . . . . . . . . . . . . 168 Valid Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 Arithmetic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 The varchar2 Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 The Number Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 The Date Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 The Boolean Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 Critical Skill 5.4 Write PL/SQL Programs in SQL*Plus . . . . . . . . . . . . . 174 Project 5-1 Create a PL/SQL Program . . . . . . . . . . . . . . . . . . . . . . . . . 176 SQL in Your PL/SQL Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 PL/SQL Cursors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 The Cursor FOR Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 Critical Skill 5.5 Handle Error Conditions in PL/SQL . . . . . . . . . . . . . . 181 Error Handling Using Oracle-Supplied Variables . . . . . . . . . . . . . . 185 Critical Skill 5.6 Include Conditions in Your Programs . . . . . . . . . . . . . 187 Program Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 Project 5-2 Use Conditions and Loops in PL/SQL . . . . . . . . . . . . . . . . 195 Critical Skill 5.7 Create Stored Procedures—How and Why . . . . . . . . . 196 Critical Skill 5.8 Create and Use Functions . . . . . . . . . . . . . . . . . . . . . 201 Project 5-3 Create and Use a Function . . . . . . . . . . . . . . . . . . . . . . . . 201 Critical Skill 5.9 Call PL/SQL Programs . . . . . . . . . . . . . . . . . . . . . . . . 203 Chapter 5 Mastery Check. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 6 The Database Administrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 Critical Skill 6.1 Learn What a DBA Does . . . . . . . . . . . . . . . . . . . . . . 208 Critical Skill 6.2 Perform Day-to-Day Operations . . . . . . . . . . . . . . . . . 209 Architecture and Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 Capacity Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 Backup and Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 Performance and Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
  10. x Oracle Database 11g : A Beginner’s Guide Managing Database Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 Storage Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 Change Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 Schedule Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 Network Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 Critical Skill 6.3 Understand the Oracle Database 11g Infrastructure . . 212 Schemas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 Storage Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 Critical Skill 6.4 Operate Modes of an Oracle Database 11g . . . . . . . . 216 Modes of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 Database and Instance Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . 217 Critical Skill 6.5 Get Started with Oracle Enterprise Manager . . . . . . . . 219 Instance Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 User Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 Resource Consumer Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 Schema, Security, and Storage Management . . . . . . . . . . . . . . . . . 221 Distributed Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 Warehouse Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 Other Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 Critical Skill 6.6 Manage Database Objects . . . . . . . . . . . . . . . . . . . . . 223 Control Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 Redo Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 Undo Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 Schema Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 Critical Skill 6.7 Manage Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 Archive Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 Tablespaces and Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 Critical Skill 6.8 Manage Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 Create a User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 Edit Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 Critical Skill 6.9 Manage Privileges for Database Users . . . . . . . . . . . . 231 Grant Authority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 Project 6-1 Create Essential Objects . . . . . . . . . . . . . . . . . . . . . . . . . . 235 Chapter 6 Mastery Check. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 7 Backup and Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 Critical Skill 7.1 Understand Oracle Backup and Recovery Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 Where Do I Start? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 Backup Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 Oracle Binaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 Parameter Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
  11. xi Contents Control Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 Redo Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 Undo Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 Checkpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 Archive Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 Data Files, Tablespaces, Segments, Extents, and Blocks . . . . . . . . . . 245 Dump Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 Critical Skill 7.2 Learn about Oracle User-Managed Backup and Recovery. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 Types of User-Managed Backups. . . . . . . . . . . . . . . . . . . . . . . . . . . 248 Cold Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 Hot Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 Recovery from a Cold Backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 Recovery from a Hot Backup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 Seven Steps to Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 Recovery Using Backup Control Files . . . . . . . . . . . . . . . . . . . . . . . 253 Critical Skill 7.3 Write a Database Backup. . . . . . . . . . . . . . . . . . . . . . . 254 Critical Skill 7.4 Back Up Archived Redo Logs. . . . . . . . . . . . . . . . . . . . 256 Critical Skill 7.5 Get Started with Oracle Data Pump . . . . . . . . . . . . . . . 257 Critical Skill 7.6 Use Oracle Data Pump Export . . . . . . . . . . . . . . . . . . . 258 Critical Skill 7.7 Work with Oracle Data Pump Import. . . . . . . . . . . . . . 264 Critical Skill 7.8 Use Traditional Export and Import . . . . . . . . . . . . . . . . 269 Critical Skill 7.9 Get Started with Recovery Manager . . . . . . . . . . . . . . . 270 RMAN Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271 Set Up a Recovery Catalog and Target Database . . . . . . . . . . . . . . . 274 Key RMAN Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274 Backups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 RMAN Using Enterprise Manager . . . . . . . . . . . . . . . . . . . . . . . . . . 278 Performing Backups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 Restore and Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 Project 7-1 RMAN End to End . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283 Chapter 7 Mastery Check. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 8 High Availability: RAC, ASM, and Data Guard . . . . . . . . . . . . . . . . . 287 Critical Skill 8.1 Define High Availability . . . . . . . . . . . . . . . . . . . . . . . 288 Critical Skill 8.2 Understand Real Application Clusters . . . . . . . . . . . . 289 Critical Skill 8.3 Install RAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 Critical Skill 8.4 Test RAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 Workload Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 ASM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 Critical Skill 8.5 Set Up the ASM Instance . . . . . . . . . . . . . . . . . . . . . . 297 Project 8-1 Install ASMLib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 Critical Skill 8.6 Create ASM Disk Groups . . . . . . . . . . . . . . . . . . . . . . 302 Project 8-2 Create Disk Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 Critical Skill 8.7 Use ASMCMD and ASMLIB . . . . . . . . . . . . . . . . . . . . 304
  12. xii Oracle Database 11g : A Beginner’s Guide Critical Skill 8.8 Convert an Existing Database to ASM . . . . . . . . . . . . . 306 Critical Skill 8.9 Understand Data Guard . . . . . . . . . . . . . . . . . . . . . . . 308 Critical Skill 8.10 Explain Data Guard Protection Modes . . . . . . . . . . . 309 Critical Skill 8.11 Create a Physical Standby Server . . . . . . . . . . . . . . . 312 Project 8-3 Create a Physical Standby Server . . . . . . . . . . . . . . . . . . . 313 Chapter 8 Mastery Check. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 9 Large Database Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317 Critical Skill 9.1 Learn to Identify a Very Large Database . . . . . . . . . . . 318 Critical Skill 9.2 Why and How to Use Data Partitioning . . . . . . . . . . . 319 Why Use Data Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 Implement Data Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 Project 9-1 Create a Range-Partitioned Table and a Local-Partitioned Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340 Critical Skill 9.3 Compress Your Data . . . . . . . . . . . . . . . . . . . . . . . . . 344 Data Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344 Index Key Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346 Critical Skill 9.4 Use Parallel Processing to Improve Performance . . . . 347 Parallel Processing Database Components . . . . . . . . . . . . . . . . . . . 347 Parallel Processing Configuration . . . . . . . . . . . . . . . . . . . . . . . . . 348 Invoke Parallel Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350 Critical Skill 9.5 Use Materialized Views . . . . . . . . . . . . . . . . . . . . . . . 351 Uses for Materialized Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352 Query Rewrite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353 When to Create Materialized Views . . . . . . . . . . . . . . . . . . . . . . . 354 Create Materialized Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 Critical Skill 9.6 Use SQL Aggregate and Analysis Functions . . . . . . . . 356 Aggregation Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356 Analysis Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 Other Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 Critical Skill 9.7 Create SQL Models . . . . . . . . . . . . . . . . . . . . . . . . . . 367 Project 9-2 Use Analytic SQL Functions and Models . . . . . . . . . . . . . 370 Chapter 9 Mastery Check. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372 A Mastery Check Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 Chapter 1: Database Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 Chapter 2: Installing Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379 Chapter 3: Connecting to Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 Chapter 4: SQL: Structured Query Language . . . . . . . . . . . . . . . . . . . . 381 Chapter 5: PL/SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 Chapter 6: The Database Administrator . . . . . . . . . . . . . . . . . . . . . . . . 385 Chapter 7: Backup and Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 Chapter 8: High Availability: RAC, ASM, and Data Guard . . . . . . . . . . 390 Chapter 9: Large Database Features . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
  13. Acknowledgments an Abramson: I would like to thank all of those who are part of my life I and who have been part of this great adventure. I would like to thank my family: my wife, Susan, is my true partner who puts up with me being me; and of course my two joys in life, my daughters Baila and Jillian— they have become two wonderful and intelligent women, and I am so proud and expect that their dreams will all be within their reach. To my friends, the people who are part of my everyday journey and whom I am so lucky to have as part of my life: Michael Brown, Chris Clarke, Marc Allaire, Marshall Lucatch, Jim Boutin, Kevin Larose, Al Murphy, Ken Sheppard, Terry Butts, Andrew Allaire, Mark Kerzner, Michael Abbey, Michael Corey, Ted Falcon, Moti Fishman, Tom Tishler, Carol McGury and everyone at the IOUG, and Jack Chadirdjian—you are all an important part of my life, and I am honored to know each of you and call you all friends. Michael Abbey: Thanks to my wife, Sandy; and my children, Ben, Naomi, Nathan, and Jordan; as well as two new-found wonders of my life—a granddaughter named Annabelle and a daughter-in-law Lindsay. Michael Corey: Special thanks to my friend, Ian Abramson, whose hard work and efforts made this book happen. Michelle Malcher: I would like to thank my junior DBAs, Mandy and Emily, for their fun breaks from work to enjoy life. Thanks to my husband for putting up with the long hours I spend sitting in front of a computer. Special thanks to Ian Abramson for getting me involved with this book and his support and encouragement. Thanks to all involved in the IOUG; keep sharing ideas and working with each other to sharpen each others’ skills and grow careers. Ted Falcon: I would like to acknowledge those people whose love and support have allowed me to get to where I am today. First and foremost are my wife, Vanessa; and our 3 children, Mya, Matthew, and Noah. Thank you for everything that you do to enrich and fulfill my life. I love you all more than you know. To my parents, Mel and Tita, thank you for your continued guidance and love. To my brother, Adrian, our battles on the basketball court are legendary. Your quest to one day beat me is xiii
  14. xiv Oracle Database 11g : A Beginner’s Guide inspiring. I love you, little brother. To my huge extended family, thank you for your love and support. To my friends—you are all family, especially Bruha. To my friend Garth Gray, who guided me through the halls of U of T Scarborough and to this crazy world of IT. Thank you for the advice, the support, and the drives down to ITI. Finally, to my friends and colleagues whom I’ve met throughout my career, especially Ian Abramson; thank you for your friendship, guidance, Raptor tickets, and for allowing me to be a part of this book.
  15. Introduction he release of Oracle Database 11g is one that comes with much T anticipation. We are at a time when data is exploding and the cost of operations must be reduced. Oracle 11g is a release that addresses many of these concerns and provides a database that can help organizations move forward without boundaries. With the release of Oracle Database 11g: A Beginner’s Guide, we bring back together the Abramson, Abbey, and Corey team that has been writing these books for over 13 years. That time slice is pale compared to the length of time the Oracle database software has been embracing the information highway. Recently Oracle celebrated its 30th anniversary with the customary hoopla and fanfare…justifiably so. One cannot rub shoulders with fellow information technologists without experiencing Oracle’s technology, and quite a piece of technology it is! In the beginning, there was a database, and then came development tools. The Oracle product line added components at an ever more accelerating rate. This book is all about the foundation underneath just about everything running the Oracle technology stack—the database. Regardless of what corner of the technology you work with, being familiar with the underpinnings of the database technology makes you a better practitioner. Where has Oracle been, and where is it going? The former question is not that hard to answer, the latter a mystery until it unfolds. In 1979 we saw the first commercial SQL RDBMS offering from a new company in Redwood Shores, California—Software Development Laboratories. Close to two years later, the company morphed into Relational Software, Inc. in Menlo Park, not far from its origin. The VAX hardware platform was the initial home of the database offering. The rest of the story of this company, now known as Oracle Corporation, is revolutionary—all the way from the first read-consistent database (1984), through its first full suite of applications (1992), to the first web database offering (1997). The calendar year 2000 saw the first Internet development suite, followed not long thereafter by the release of Enterprise Grid computing with Database 10g in 2003. The acquisitions path emerged strongly in 2004 with the purchase of PeopleSoft, and it did not stop there. Significant technology xv
  16. xvi Oracle Database 11g : A Beginner’s Guide acquisitions are now common for this software giant, with Stellent Inc., Hyperion Solutions Corporation, and, more recently, BEA Systems. As of the publication date of this book, Oracle has acquired over 40 companies, making their products a significant component of its growth strategy. The database will always be the backbone of Oracle’s product line—hence the fifth release of this successful suite of works: Oracle Database 11g: A Beginner’s Guide. What many people find so fascinating about the Oracle technology stack is how you can bury yourself in such a small part of the database offering. The part that you are familiar with compared to the complete technology stack can be likened to a little itty-bitty street corner compared to the network of intersections in a thriving urban metropolis. Many of us live and breathe our piece of the database technology, never having the opportunity to experience the features and functionality leveraged elsewhere. That is why we wrote this Beginner’s Guide. Our main audience is just that, the beginner, but there are also chapters in this book that cater to the information needs of seasoned veterans with the technology. In the earliest days of the Beginner’s Guide, we continually heard two dramatically opposing opinions about the same thing. On one hand, some people said “One thing I really like about the Oracle database software is that it’s so easy to tune”; on the other hand, some claimed “One thing I really hate the Oracle database software is that it’s so hard to tune.” Exactly where you align yourself as you get further and further into this book remains to be seen; suffice it to say, the material covered in Oracle Database 11g: A Beginner’s Guide will help you make more informed decisions and adopt better best practices now and in the future. Oracle Database is a powerful tool, and this book will be your first step toward empowerment and your future of becoming an Oracle expert. This book features the following elements, which enable you to check your progress and understanding of the concepts and details of the product: ■ Critical Skills listed at the beginning of each chapter highlight what you will learn by the end of the chapter. ■ Step-by-step Projects reinforce the concepts and skills learned in each chapter, enabling you to apply your newly acquired knowledge and skills immediately. ■ Ask the Expert questions and answers appear throughout the chapters to make the subject more interactive and personal. ■ Progress Checks are quick, numbered self-assessment sections where you can easily check your progress by answering questions and getting immediate feedback with the provided answers. ■ Mastery Checks at the end of each chapter test proficiency in concepts and technology details covered in the chapter through multiple-choice, fill-in-the blank, true/false, and short-answer questions.
  17. xvii Introduction This book introduces you to many aspects of the Oracle database software. Chapter 1 starts with the concept of a database and how Oracle is structured so that you understand the fundamentals. Chapter 2 covers installing the software that you are going to need to try things out. We have provided a step-by-step guide to installing the software on Linux, but if you wish to install it on another platform, this chapter will help you understand the choices that you need to make when installing the database. Once your database is installed, you will need to communicate with it; in order to do this, you may need to install Oracle client software to access the database. Chapter 3 on connecting to Oracle will guide you through the tasks that can often be complex, but we provide information on how to keep it simple. Once the database is installed and you can communicate with it, you need to speak the languages that the database understands. We provide you with a solid introduction to Structured Query Language (SQL) in Chapter 4, as well as Oracle’s own programming language, PL/SQL, in Chapter 5. These two chapters will help you create robust interactions with the database to get data into and out of your database. The administration of the Oracle database is largely a function of the people who work closely with Oracle’s software. Thus, we provide you with a deep introduction to these functions and features. In Chapter 6 we will show you what database administrators (DBAs) do on a daily, weekly, and other basis. In Chapter 7 we provide guidance on how to do backups and, in case things really go wrong with your database, how to restore your old database. Oracle 11g has many features that are at the leading edge of technology, and Oracle Rapid Application Clusters (RAC) and Automatic Storage Management (ASM) are important technology in the order to support the high-availability needs of today’s applications. Take time in Chapter 8 to become familiar with all of this technology to ensure that you understand how today’s databases are deployed and optimized for performance and availability. Finally, in Chapter 9 we discuss features that apply to large databases. As you will learn or are already aware, databases are growing at an exponential rate. We need to use the facilities of the database that address this growth and ensure that we optimize the investment an organization makes in its Oracle software. This book closes by discussing many of the features that will become everyday necessities in your Oracle job. There is one thing you must keep in mind as you travel around the pages of this book: Oracle Database 11g is a complex product with many, many more features and facilities than we can discuss here. We have chosen topics based on our own experiences of what Oracle customers use 90% of the time, but realize that this is just the start of a very interesting journey. As we say, “You have to start somewhere.” Oracle Database is an exciting product, and one that will provide you with limitless chances to learn more about it. This book is one of your first steps; we hope you take from it the curiosity to dig deeper into the topics.
  18. This page intentionally left blank
  19. Chapter 1 Database Fundamentals CRITICAL SKILLS 1.1 Define a Database 1.6 Become Familiar with Other Important Items in Oracle 1.2 Learn the Oracle Database 11g Database 11g Architecture 1.7 Work with Object and System 1.3 Learn the Basic Oracle Database Privileges 11g Data Types 1.8 Introduce Yourself to the Grid 1.4 Work with Tables 1.9 Tie It All Together 1.5 Work with Stored Programmed Objects
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
2=>2