05.11.2015 Views

Apress.Expert.Oracle.Database.Architecture.9i.and.10g.Programming.Techniques.and.Solutions.Sep.2005

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 1 ■ DEVELOPING SUCCESSFUL ORACLE APPLICATIONS 5<br />

• The developers were following a m<strong>and</strong>ate to be “database independent”—a m<strong>and</strong>ate<br />

they could not hope to follow for many reasons, the most obvious being that they didn’t<br />

know enough about what databases are <strong>and</strong> how they might differ. This team would not<br />

be able to know what features of the database to avoid in an attempt to remain database<br />

independent.<br />

• The developers encountered massive performance problems, data integrity problems,<br />

hanging issues, <strong>and</strong> the like (but they had very pretty screens).<br />

As a result of the inevitable performance problems, I was called in to help solve the difficulties.<br />

Since I started my career attempting to build database-independent applications (to<br />

the extent that I wrote my own ODBC drivers before ODBC existed), I know where the mistakes<br />

will be made because at one time or another I have made them myself. I always look for<br />

inefficient SQL, lots of procedural code where a single SQL statement would suffice, no feature<br />

invented after 1995 being used (to remain database independent), <strong>and</strong> so on.<br />

I can recall one particular occasion when I’d been called in to help <strong>and</strong> could not fully<br />

remember the syntax of a new comm<strong>and</strong> that we needed to use. I asked for the SQL Reference<br />

manual <strong>and</strong> was h<strong>and</strong>ed an <strong>Oracle</strong> 6.0 document. The development was taking place on version<br />

7.3, five years after the release of version.6.0! It was all the developers had to work with,<br />

but this did not seem to concern them at all. Never mind the fact that the tool they really<br />

needed to know about for tracing <strong>and</strong> tuning didn’t even exist back then. Never mind the fact<br />

that features such as triggers, stored procedures, <strong>and</strong> hundreds of others had been added in<br />

the five years since the documentation to which they had access was written. It was very easy<br />

to determine why they needed help—fixing their problems was another issue altogether.<br />

■Note Even today, in 2005, I often find that database application developers have not spent any time reading<br />

the documentation. On my web site (http://asktom.oracle.com), I frequently get questions along the<br />

lines of “What is the syntax for . . .” coupled with “We don’t have the documentation, so please just tell us.”<br />

I refuse to directly answer many of those questions, but rather point questioners to the online documentation,<br />

which is freely available to anyone, anywhere in the world. In the last ten years, the excuse of “We don’t<br />

have documentation” or “We don’t have access to resources” has been rendered obsolete. The introduction<br />

of the Web <strong>and</strong> sites such as http://otn.oracle.com (<strong>Oracle</strong> Technology Network) <strong>and</strong> http://<br />

groups.google.com (Google Groups Usenet discussion forums) make it inexcusable to not have a full<br />

set of documentation at your fingertips!<br />

The very idea that developers building a database application should be shielded from<br />

the database is amazing to me, but this approach persists. Many people still believe that<br />

developers cannot afford the time to get trained in the database <strong>and</strong> that basically they should<br />

not have to know anything about the database. Why? Well, more than once I’ve heard “<strong>Oracle</strong><br />

is the most scalable database in the world, so my people don’t have to learn about it—it will<br />

just do X, Y, <strong>and</strong> Z.” It is true that <strong>Oracle</strong> is the most scalable database in the world. However,<br />

it is just as easy (if not easier) to write bad, nonscalable code in <strong>Oracle</strong> as it is to write good,<br />

scaleable code. You can replace the word “<strong>Oracle</strong>” in the last sentence with the name of any

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!