Beginning Oracle Database 11g Administration From Novice to Professional Iggy Fernandez... Beginning Oracle Database 11g Administration: From Novice to ProfessionalCopyright © 2009 by I
Trang 2Beginning Oracle
Database 11g
Administration
From Novice to Professional
Iggy Fernandez
Trang 3Beginning Oracle Database 11g Administration: From Novice to Professional
Copyright © 2009 by Iggy Fernandez
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-10 (pbk): 1-59059-968-3
ISBN-13 (pbk): 978-1-59059-968-6
ISBN-13 (electronic): 978-1-4302-0628-6
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
Development Editor: Douglas Pundick
Technical Reviewer: Bob Bryla
Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Tony Campbell, Gary Cornell, Jonathan Gennick, Michelle Lowman, Matthew Moodie, Jeffrey Pepper, Frank Pohlmann, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh
Project Manager: Richard Dal Porto
Copy Editors: Jim Compton, Sharon Wilkey
Associate Production Director: Kari Brooks-Copony
Production Editor: Kelly Gunther
Compositor and Artist: Kinetic Publishing Services, LLC
Proofreader: Nancy Sixsmith
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 kn`ano)ju<olnejcan)o^i*_ki, or visit dppl6++sss*olnejcankjheja*_ki
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 ejbk<]lnaoo*_ki, or visit
dppl6++sss*]lnaoo*_ki
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use eBook versions and licenses are also available for most titles For more information, reference our Special Bulk Sales–eBook Licensing web page at dppl6++sss*]lnaoo*_ki+ejbk+^qhgo]hao.
The information in this book is distributed on an “as is” basis, without warranty Although every precau-tion has been taken in the preparaprecau-tion 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 indi-rectly by the information contained in this work
The source code for this book is available to readers at dppl6++sss*]lnaoo*_ki
Trang 4For Michelle.
“Oh Fame!—if I e’er took delight in thy praises,
’Twas less for the sake of thy high-sounding phrases, Than to see the bright eyes of the dear one discover She thought that I was not unworthy to love her.”
—Lord Byron
And for all the IT colleagues and friends who, over the years, have asked me to teach them the basics of Oracle Database.
Trang 5Contents at a Glance
Foreword xvii
About the Author xix
About the Technical Reviewer xxi
Acknowledgments xxiii
Introduction xxv
PART I N Database Concepts CHAPTER 1 Relational Database Management Systems 3
CHAPTER 2 SQL and PL/SQL 21
CHAPTER 3 Oracle Architecture 51
PART II N Database Implementation CHAPTER 4 Planning 65
CHAPTER 5 Software Installation 81
CHAPTER 6 Database Creation 95
CHAPTER 7 Physical Database Design 131
CHAPTER 8 User Management and Data Loading 151
Trang 6N I N D E X 429
stripe data, 141
Structured Query Language See SQL
Submit Recovery Job button, 300
subqueries, 36
subquery factoring, 11, 24
success messages, 119
Supplier table, 25–28, 31–32, 38–39, 43–46
suppliername command, 22, 25–28, 30–31,
34–37, 39–46
Supplierstatus data, 33, 36–37
supplierstatus data item, 25, 34–35, 37
SYS account, 106, 319
SYS schema, 152, 185
SYSAUX tablespace, 54, 74
SYSMAN account, 106, 347
SYSTEM account, 106, 158, 319, 382
system capacity, 306
system change number (SCN), 58
System Global Area (SGA), 52, 56–57
system monitor (SMON), 59
system privileges, 165
SYSTEM schema, 185
system statistics, 391
SYSTEM tablespace, 54, 74, 281, 319
T
TAB$ table, 145
table partitioning, 66
table privileges, 165
Table Reference subdiagram, 25
(Table_1 JOIN Table_2) JOIN Table_3
expression, 14
tables, 5, 152, 391–392
tablespaces, 54
tape backups, 258–259
templates, database, 103–104
temporary files, 55, 301
TEMPORARY TABLESPACE statement,
159
TERMINAL value, 205
testing section, 348
third-party tools, 198, 218
time series, 201, 281, 322–325
TIMESTAMP value, 205
Tivoli monitoring tool, 218
tkprof utility, 358, 382
TNS_ADMIN variable, 85
tnsnames.ora file, 54, 59, 84–85
touser clause, 171 trace files, 56, 75, 313, 382 tracing jobs, 382
traditional recovery, 281, 285 Training database, 51 transaction identifiers, 285 Transaction Processing template, 104 transactions, 14–15
transparency, 345 trigger operations, 15 triggers, 40, 152 troubleshooting error codes ORA-00060, 244–245 ORA-00600, 245–250 ORA-01555, 242–243 ORA-07445, 252 overview, 240–242 example of, 227–231 five-step method, 224–225 incident versus problem management, 231–232
Internet resources, 232–236 Oracle Support, 236–239 overview, 223
problem management practices, 226–227
types of, 280–283 ts$ table, 194 Tuning Pack, 66, 120
U
UNDO_MANAGEMENT setting, 243 UNDO_RETENTION setting, 243, 283, 308
undo_tablespace parameter, 118 UNDO_TABLESPACE setting, 243 Union operator, 9
unique indexes, 133 uniqueness constraints, 16–17 UNLOCK procedure, 308 UPDATE statement, 27–28 UPPER function, 22 usable space, 75 USE_HASH hint, 388 USE_MERGE hint, 388 USE_NL hint, 388 user commits counter, 365
Trang 7N I N D E X
430
user management
creating users, 158–161
giving permissions to users, 162–166
modifying user attributes, 167
overview, 151–158, 319
removing users, 167
revoking permissions granted to users,
166
USER_ view, 156
USER_OBJECTS view, 156
user-managed backups, 261
users, defined, 151
USERS tablespace, 163
utlpwdmg.sql script, 319
V
V$ARCHIVED_LOG command, 266
V$DIAG_INFO view, 203
V$EVENT_NAME view, 367
V$OSSTAT view, 216, 322
V$SESSION_EVENT table, 366
V$SESSTAT view, 365
V$SQLAREA view, 213
V$SYS_TIME_MODEL view, 322
V$SYSSTAT view, 210, 319, 322, 365–366
V$SYSTEM_EVENT view, 322, 366
VALIDATE DATABASE command, 292, 308 VARCHAR (variable character) data type, 26
variable element, 43 VAX/VMS platform, 6 verbal communication, 335 verification section, 284, 349 VERSIONS BETWEEN clause, 284 VERSIONS_STARTTIME clause, 284 VERSIONS_XID clause, 284
View Backup Report page, 207 VIEW$ table, 154
virtual columns, 387 volume managers, 107 VPD (Virtual Private Database), 17
W
wait interface, 365–366 warm standby, 339 WARNING: Subscription for node down event still pending message, 231 welcome screen, 102
WHERE clause, 24–25 workload, monitoring, 209–212 WORM drives, 310
write skew, 16