Expert Oracle Database Architecture: Oracle Database Programming 9i, 10g, and 11g Techniques and Solutions, Second Editi

Expert Oracle Database Architecture: Oracle Database Programming 9i, 10g, and 11g Techniques and Solutions, Second Editi
Authors
Thomas Kyte
ISBN
1430229462
Published
26 Jul 2010
Purchase online
amazon.com

Now in its second edition, this best-selling book by Tom Kyte of Ask Tom fame continues to bring you some of the best thinking on how to apply Oracle Database to produce scalable applications that perform well and deliver correct results. Tom has a simple philosophy: you can treat Oracle as a black box and just stick data into it or you can understand how it works and exploit it as a powerful computing environment.

Page 2 of 2
  1. Editorial Reviews
  2. Customer Reviews

Customer Reviews

Charles Hooper said
I pre-ordered this book in May, having previously read the two previous editions of this book ("Expert One-On-One Oracle" and "Expert Oracle Database Architecture: 9i and 10g Programming Techniques and Solutions") cover to cover. Now that I have had an opportunity to fully read this edition, I now realize that the first edition of this book subconsciously set the standards that I expected of all other Oracle Database books I have subsequently purchased. The latest edition is now among my five favorite Oracle Database books, sharing the top five ranking with "Cost-Based Oracle Fundamentals", "Troubleshooting Oracle Performance", and "Optimizing Oracle Performance".

The author of this book is a Vice President at Oracle Corporation, and is well known for his [...] website, articles in Oracle's magazine, forum/Usenet postings, and presentations. The author recently revised the Oracle Concepts Guide, which is part of the Oracle Database 11.2 documentation library. Slightly off topic: It might be notable that a book written by a VP at Oracle Corporation is not published by Oracle Press. Oracle Press is a marketing label used by McGraw Hill to market its line of Oracle books - the books are not formally written by Oracle Corporation nor are they formally tech edited by Oracle Corporation, although some employees of Oracle Corporation have used McGraw Hill as a publishing company. At least for me, for several years the "Officially Authorized Oracle Press" logo on books published by McGraw Hill seemed to be endorsement of the books by Oracle Corporation, but that is not the case, as was clarified by one of the threads on the AskTom site.

The book contents are very well organized, allowing the reader to continually build on previously introduced concepts. Many forward and backward references in the book are provided - "see the section a1 in chapter n for additional information". It is surprising just how much new content is included in this edition of the book - this book reads as though it were written specifically for Oracle Database 11g R2 with exceptions in behavior mentioned for older Oracle Database releases. Even if you have read one of the older releases of the book, I do not recommend just jumping into one of the chapters using either the table of contents or the index at the back of the book. Start at the beginning of the book and finish at the end of the book. The author introduces very useful bits of information in the chapters that are not specific to the chapter title, and do not appear in the table of contents or the index at the back of the book. Just a couple of examples of useful information that will be missed (especially if you only read the first half of the book):
* Page 421: UTL_RAW.CAST_TO_RAW and UTL_RAW.CAST_TO_VARCHAR2 functions with sample code.
* Page 434: Using DUMP(number, 16) to see the raw bytes used to store values.
* Page 464: Using DBMS_UTILITY.GET_CPU_TIME to determine the previously used CPU seconds for the session.
* Page 465: Oracle Database 10g R2's deterministic function optimization.
* Page 470: Use of the analytic function RATIO_TO_REPORT
* Page 472: Creating a UNIQUE function based index to enforce uniqueness of values in a column when another column contains a specific value.
* Page 477: Oracle Forms by default updates every column including primary key columns, and that behavior could lead to deadlocks.
* Page 478: Disabling table locks on a table will help detect unindexed foreign keys.
* Page 487: Using DBMS_SPACE.FREEBLOCKS to determine the number of index blocks in the index freelist.
* Page 512: Using the VSIZE function to indicate how much storage space a column value requires.
* Page 513: Warns of a calculation error (that is not a bug) when adding the floating point numbers 0.3 and 0.1 - the result is not 0.4.
* Page 646: Using DBMS_STATS.SET_TABLE_STATS to simulate a large table in order to determine how data volume changes will impact the execution plan generated by the optimizer.
* Page 656: Using the NTILE analytic function to break a rowset into equally sized groups of rows.
* Page 687: Starting with Oracle 9i it is possible to insert into one or more tables using complex WHEN conditions.
* Page 739: Encrypting a column in a table may cause significant changes to the execution plans that specify that column in join or filtering conditions.
* Page 740: Index range scans are not possible with indexes created for encrypted columns.

The author uses an odd, yet very helpful teaching method throughout the book. Break something, with the assumption that you are reading the chapter because something is already broken, and then show you how to fix the problem and ultimately avoid the problem in the future. Unfortunately, the index at the back of the book only contains a small handful of these problem-solution cases - another reason to read the whole book and take good notes. A list of the errors covered in the book as teachable moments follows:
* Chapter 1: ORA-02391, ORA-08177, ORA-00060
* Chapter 2: ORA-12162, ORA-16196
* Chapter 3: ORA-00942, ORA-25138, ORA-01021, ORA-02096, ORA-12913, ORA-12505, ORA-01031
* Chapter 4: ORA-29339
* Chapter 6: ORA-00054, ORA-00069
* Chapter 7: ORA-01555, ORA-08177
* Chapter 8: ORA-02290, ORA-02292, ORA-02291, ORA-30036
* Chapter 10: ORA-22908, ORA-01427
* Chapter 11: ORA-25954, ORA-01450, ORA-01743, ORA-0001, ORA-00069
* Chapter 12: ORA-12899, ORA-01461, ORA-01465, ORA-01438, ORA-00932, ORA-01839, ORA-30079, ORA- 22285
* Chapter 13: ORA-00376, ORA-01652, ORA-14511, ORA-01843, ORA-14400, ORA-14767, ORA-14652, ORA-14659, ORA-14402, ORA-01408, ORA-02429, ORA-14038
* Chapter 14: ORA-12838
* Chapter 15: SQLLDR-601, SQL*Loader-144, ORA-29913, ORA-06512
* Chapter 16: ORA-28365, ORA-28348

Helpful Foundation Knowledge in the Found in the Book:
* Notes at the front of the book show how to quickly install Statspack, change AUTOTRACE settings, permanently configure the SQL*Plus environment, and the requirements for the Runstats, Mystat, Show_Space, and Big_Table scripts that are used later in the book.
* Provides a warning not to use bitmap indexes on columns just because the columns have low cardinality columns, for example a column named PROCESSED that has either a value of Y or N, without first considering concurrency - how will the column be used and updated.
* Pages 17 through 21 demonstrate SQL injection when bind variables are not used in an example that most people probably would not consider as a threat - the SQL injection was accomplished by simply changing the NLS_DATE_FORMAT.
* Page 72 warns against setting undocumented parameters: "Use undocumented parameters only at the request of Oracle support. Their use can be damaging to a database, and their implementation can - and will - change from release to release." This is a warning that should be included in every book before the first mention of hidden parameters.
* The book provides a detailed list and description of the functionality provided by Oracle's background processes.
* Demonstrates how to build test cases to verify performance/scalability issues.
* Pages 262-265 provide a very detailed demonstration of transactions automatically restarting. This behavior might cause, for example, before update triggers to fire more than once, various problems with PL/SQL variables, autonomous transactions, and various PL/SQL packages (UTL_FILE, UTL_SMTP, UTL_HTTP, etc.).
* Excellent section on the topic of index myths, one of which had its roots in Oracle Database 5.
* Shows a lot of examples of practical SQL and PL/SQL in test cases, which is extremely helpful for people trying to learn either SQL or PL/SQL. The test cases frequently include TKPROF output.
* The book includes a nice analogy of Oracle Database's parallel execution option by comparing that feature with writing either a short or long report - coordinating the writing of a small report could take longer than simply writing the report without assistance.
* Excellent section dedicated to answering frequently asked questions about SQL Loader.
* The chapter showing the use of external data includes examples with SQLLOADER, external tables, flat files, and Data Pump unload (used to write out the contents of a table to allow that table's rows to be used in another database).
* The book almost always lists the first Oracle release version that offered a feature when that feature is introduced in the book.
* Typically indicates when syntax introduced in the book is operating system dependent. For example, on page 682 "ls -l" is specified for Unix/Linux and "dir /q /n" for Windows.
* The downloadable source code library seems to be complete, making it easy for readers to reproduce the tests that are found in the book.

Not everything about the book is perfect. The errata page for the book currently lists a problem where the author used the word "be" too many times in a sentence. What else needs a little fine tuning, is not quite right, or is simply incorrect? The following are my observations about the book:
* The book frequently seems to assume that a fully optioned version of the Enterprise Edition of Oracle is used by all of the readers of the book, which may set the readers up for false hope in solving certain problems, or implementing solutions that cannot be used in production environments (the chapters discussing bitmap indexes, partitioning, and parallel execution are exceptions, where the requirements are stated):
--- Advanced Queuing on page 10
--- SQL Profiles on page 11
--- FLASHBACK on page 26
--- Fine-grained access control on page 46
--- Index key compression on page 407
--- Chapter on the topic of Data Encryption does not mention what capabilities are available for the Standard Edition, Enterprise Edition, or the Enterprise Edition with the Oracle Advanced Security Option.
* Page xxxvi describes running the utlxplan script as the user SYSTEM. Running this script should not be necessary starting with Oracle Database 9i.
* Chapter 1 seems to be a little loose with terminology, specifically with the terms "database" and "Oracle". These chapters were probably intentionally written as such to help introduce the reader to the world of Oracle Database. The first couple of pages of the second chapter provide a definition of "database" and "instance".
* Some code sections of the book have lines with unnecessarily bold fonts (page 13, 29, 33, 34, 37, 53, 54, 59, 61, 175).
* Page 109 typing error: "Normally, on UNIX/Linux, this group will be DBA by default, and OSDBA on Windows. That group is `special,' in that any user in that group can connect to Oracle `as SYSDBA' without specifying a username or password." On Windows the group name is ora_dba, not OSDBA - the same error is found in the previous edition of the book.
* Page 131 behavior change: "A serial (nonparallel query) session will use a small percentage of the PGA_AGGREGATE_TARGET, typically about 5 percent or less. So, if you've set the PGA_AGGREGATE_TARGET to 100MB, you'd expect to use no more than about 5MB per work area (e.g., the sort or hash work area). You may well have multiple work areas in your session for multiple queries, or more than one sort or hash operation in a single query, but each work area will be about 5 percent or less of the PGA_AGGREGATE_TARGET." It appears that this behavior changes when the OPTIMIZER_FEATURES_ENABLE parameter is set to 10.2.0.1 or greater, as evidenced by the change in the _SMM_MAX_SIZE parameter as found in a 10053 trace file or a query of X$KSPPSV and X$KSPPI.
* Page 220 join error: The self-join of V$LOCK probably should have also joined on the TYPE column in addition to the ID1 and ID2 column. Additionally, the BLOCK column could potentially have a value of 2, rather than 1 in a RAC environment.
* Page 335 typing error: shows the view name V$UNDOSTATUNDOSTAT, should be V$UNDOSTAT.
* Page 419 suggested use of a deprecated feature: Shows using the exp command with Oracle Database 11.2.0.1 to create a people.sql file containing a CREATE TABLE command for an object based table. Page 116 states the following "Export [exp] is officially deprecated with Oracle Database 11g Release 2. It is supplied only for use with legacy database structures."
* Some of the autotrace generated execution plans do not conform to the DBMS_XPLAN style execution plans that are automatically generated as of Oracle Database 10g R2, even though it appears that the author was connected to Oracle Database 11g R2. Example include the two execution plans on page 480.
* The SQL*Plus prompts are atypical (not "SQL>") as displayed in the book - while it might be helpful to show which database the SQL*Plus session is connected to, it makes it hard to read some of the code samples that span more than a single line.

The problems found in the book are absolutely minor in comparison to the value of the information provided in the book. Yes, it is probably harsh to be judged by the standards set in the previous edition of the book. This edition update was certainly not a five hour task, and probably was not a five month task either. I suspect that this edition has been in development for most of the last five years, since the publication of the previous edition. If you have read the previous editions of this book, set those books aside and start reading from the beginning of this edition - you will not be disappointed.

Gregory E. Smith said
I have purchased, and read cover-to-cover, the original version of this book and Tom Kyte's other profoundly good Oracle books. Mr. Kyte is exceptionally skilled in the understanding of database technology and design/development principles and in the explanation of how you use the former to achieve the best case result in the latter. This is no simple list of features -- it is a brilliant explanation of what they do and when you should use them, in a well-organized structure that makes the book useful as a reference as well. If you are an Oracle DBA or Developer and you haven't already read the current versions of Tom's books, you (or your efforts) have almost definitely suffered for it. Spend the small amount of money (and more importantly, the time) to purchase and read this book!

I do have a single caveat for this edition that cost it a star: there are no notes that point out the changes between this and the previous edition of this title. The changes are of course centered on Oracle 11g new features, so you can find changes if you know Oracle 11g's new features are, but I find myself a bit disappointed that I couldn't jump to the new/changed sections straight away, and that no notes or tips are in place once you are in a changed section about what text specifically is new. The text itself does mention which Oracle version specific features were introduced in, so you can pick out the new 11g changes from the main body of text -- still, I would have preferred side notes or some kind of highlighting to make this info easier to find.

If you don't already have the first edition of this book, buy and read this edition cover-to-cover; my caveat does not apply to you in any way. If you possess and have already read the first edition, buy this before you upgrade to 11g and familiarize yourself with the real operational details of 11g's new and modified features. I plan on reading the new edition cover-to-cover anyway, as the material is good enough to rehash and I imagine I will pick up things I overlooked or have forgotten since my full read-through of the first edition.

Yan Li said
The author of this book, - Tom Kyte is no stranger for Oracle professionals. As an oracle DBA and developer for years, I've been a regular visitor of his "Ask Tom" website. I'm very glad to see the new edition of his "Expert Oracle Database Architecture" has been released. I just finished reading this book and strongly recommend it to all Oracle developers and DBAs. 780 pages is a good size - not too heavy to carry.

Tom covers the fundamental concepts and deep insights using simple conversational language, in the style of his "Ask Tom" columns. The book also provides many useful examples, codes and tips on resolving real world issues. An example of bind variables tells how much hard parsing utilizes resources (cpu/latches etc) and I was also impressed that Tom always finds ways to measure the usage. I had some blurred concepts about LOBs and parallel query/DML/DDL. This book helped me to clarify them. The book also covers some 11g new features. We need to keep track of what Oracle has already done to avoid reinventing the wheel.

I also enjoyed the following sections and found them useful and interesting:
- How (and How Not) to Develop Database Applications
- Bad Transaction Habits
- Frequently Asked Questions and Myths About Indexes

To develop a successful Oracle application, we should understand the database inside out. What I like the most about this book is that it not only tells you "what" but also "how"; explains not only "when" and "why" but also "when not" and "why not". That's the main reason I read Tom's book and visit his site - to get the "why" behind the methods. It's uncomfortable to implement something without knowing why.

You don't have to read this book from cover to cover - although it would be a good idea to do so. Each chapter can be read as a standalone piece. The book can also be an excellent, handy reference to put on your bookshelf.

Chapter 1: "Developing Successful Oracle Applications" is a great summary of the whole book.
Chapters 2-5 are about Oracle's architecture, memory, files and processes.
Chapters 6-9 cover concurrency and transaction control, such as locks and latches, redo and undo.
Chapters 10-13 are about objects including tables, indexes, data types and partitions.
Chapters 14-16 cover parallel executions, data loading and security (encryption, etc.).

I agree with Tom in that, a developer (and DBA) should not treat the database as a "black box". Armed with the knowledge and skills gained from this book, you can at least make the black box translucent, if not transparent. I feel that it's much more worthwhile to get a good book and learn from it at your leisure than to spend a lot of money taking shallow training classes.

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” - Tom Cargill