Friday, January 27, 2006

ITIL: Normal Service Will Be Resumed Just As Soon As We Know What Normal Is

I have just attended a briefing on ITIL, the IT Infrastructure library. This was very interesting, despite not answering my burning question: pronunciation. Apparently we can pronounce it "EYE-tul" or "itt-ILL" or indeed any way we choose, including spelling out the initials1. Whichever way we pronounce it, ITIL is a framework for best practices for the delivery of IT services assembled by CCTA, the folks who've also given us SSADM and PRINCE. We tend to think about IT services as being application support, networks, etc but it should cover everything, including system development. Certainly anybody who is a production DBA is in the business of delivering an IT service.

I had come across ITIL once before, when working as a consultant for a government agency. This was a long running gig, in which we were responsible for the whole IT provision. After a couple of years the word "ITIL" got bandied around but it seemed to make no difference to our delivery of services. This briefing explained why: it takes three to five years to successfully implement ITIL. Which is quite astonishing given that these days it is rare for an IT project to last more twelve months. ITIL requires such a lot of time to implement because it is a framework for thinking about service delivery rather than a set of procedures. ITIL covers the what and to a certain extent the why; of course, the real work is in the how. Identifying discrete processes and documenting them is what takes the time, particularly as each will probably take several iterations to get them right. One useful tip I learnt is that anybody who mentions "ITIL compliance" is talking through their hat. Being a set of suggestions ITIL has nothing to comply with2.

The reason why ITIL can specify such a long time scale is that it is actually targeted at internal IT departments delivering services to their company's users. This assumption reveals itself it a number of ways. For instance, ITIL has SLAs - Service Level Agreements (the definition of Normal Service and permitted deviations) - because an agreement suffices when we have an IT department dealing with their business colleagues. This is a very bad fit with the prevalent model of IT today - outsourcing and consultancy - which is wholly driven by contracts and contractual negotiation. The next revision of ITIL (due 2007) apparently will address this aspect of service delivery.

By codifying and standardising terms ITIL provides a useful way of thinking about things. For instance it distinguishes Incident Management from Problem Management. Incident Management is when our users cannot connect to the system because the listener is down; restart the listener and the incident is closed. Normal service has been resumed. Problem Management on the other hand is when the listener has crashed three times in the last month and we need to find out why; is it because we don't have a separate listener for the extproc?

Another useful distinction is User and Customer. Both are consumers of our service. The user is the person who actually, um, uses the service whereas the customer is the one who pays for it. This means that the user and the customer have different priorities. The user needs the service to carry out their job, so they tend to be interested in quality, especially reliability. The customer has a set of targets for their business which our service helps them meet. Therefore they are interested in value for money. This matters because it is the customer who specifies the service. ITIL assumes the customer talks to the user, but this is not always the case. Another difference is that the IT Department mostly deals with the user. When it all goes horribly wrong it is the user who phones the Help Desk not the customer.

I find distinction between user and customer helpful because it illuminates several of my previous development projects. As a consultant I am exhorted to regard all the staff who work for my clients as customers. This is a good thing. But it is useful to distinguish between the people who use the system and the people who will fund its development. Given free rein in the Requirement Gathering stage users will tend to ask for the moon on a stick. We need the customer to remind them of the harsh financial realities. Alternatively it is not unknown for customers to seek to use a development project to drive through business change, riding roughshod over their own users' requirements. This is a harder one to handle: they are paying for it. All the IT team can do is assert the need for the users to be trained in the new way of working as well the new system. I think now I could look at any requirement and determine whether it is a user's requirement or a customer's requirement.

These are political rather than technical issues and ITIL is not going to solve them. However, by identifying the issues and defining responsibilities for both technical and business roles it seems to provide a useful start. I'm sufficiently enthused to consider doing the ITIL foundation course.




1. Apperently "EYEtul" sounds like something rude in Manadarin or Cantonese but then doesn't everything?
2. Although there are now the BS15000 and ISO20000 standards, which mandate certain ITIL practices.

Thursday, January 26, 2006

Oracle Patching Malarky

The last few months have really taken the shine off Oracle's reputation for building secure products. The latest spat between Duncan Harris (Oracle) and David Litchfield (Next-Generation Security Software) looks like shaping up into a fine old row.

Yesterday Pete Finnegan advised everybody using iAS to apply David Litchfield's workaround immediately. However,Robert Lemos owver at Security Focus reports Oracle's Harris as saying something along the lines that Litchfield's workaround is inadequate and "the configuration changes have at least five technical problems that could cause problems for some applications" (paraphrase by Security Focus not Harris's actual words). Harris recommends testing it before deploying to a production server. This is obviously sensible advice.

Whether Oracle going toe-to-toe with security researchers is a sensible strategy is slightly less obvious.

Tuesday, January 24, 2006

Friday, January 13, 2006

Get your output in real time

Roger Cunha has posted a neat alternative to DBMS_OUTPUT on the OTN PL/SQL forum. It uses UTL_FILE to write to stdout, which means you can get output from your PL/SQL procedures whilst they are still running. Obviously it's only for *nix platforms and you can only see the file from a SQL*Plus session on the database server. Still, it's a cute trick to keep in the toolbox.

Of course, screen output remains the Devil's Debugger.

Wednesday, January 11, 2006

Buy Sun, Get 10.2 Free!

Sarcastic IT site El Reg has a report on the latest Sun and Oracle pricing move: buy an UltraSPARC server and get Oracle Enterprise Edition free. Well, we have to buy a year's worth of Oracle support but we'd all do that anyway, eh? The key thing about this is that the price is free regardless of how many processors the server has. Now that's the sort of licensing model everybody can understand.

Tuesday, December 20, 2005

Oracle Licencing IV: The Carnage Continues!

The Register in its delightfully sarcastic way breaks the news of the latest refinement to the Oracle licencing model. Basically,
Sun's UltraSPARC T1 chip will be multiplied by a factor of .25...the dual-core x86 chips from Intel and AMD will be multiplied by a factor of .50, whilst "all other" multi-core servers - mostly the Unix crowd - will follow the .75 rule.
Contrary to the their normal high journalistic standards El Reg don't provide a source for this story but the press release is on the Oracle Corporate site.

This is not quite the revolutionary new pricing strategy Larry hinted at in his OOW2K5 keynote. Instead it further muddies the waters when it comes to costing a server installation without helping those customers for whom none of the current pricing models are suitable. Since you ask, yes, my current client is one such case. They have lots of database applications but almost no Oracle installations. Looking at the roll-out of my current project, the Oracle licensing costs are a substantial part of the problem. The per user model doesn't work with web-based systems. The per employee model doesn't work with a workforce of forty thousand most of whom will use the system maybe once a week. Which only leaves the complex, expensive and - yes - unfair per processor model.

Upgrade your server and pay more to Oracle for the privilege? Hmm, it's a toughie.

Wednesday, December 07, 2005

Manageability: an Oracle fan gets illogical

Thanks to Doug Burns for pointing out this interesting article on the comparatitive manageability of MS SQL Server and Oracle by Buck Woody (crazy name, crazy guy!).

I was particularly struck by his assertion that SQL Server is easier to manage because it requires fewer steps to achieve any given task. Despite touting this as a scientific assessment Buck Woody fails to provide even the most basic information, such as which versions he's comparing. His "proof" of this statement amounts to an invitation to install MSSQL and see for ourselves.

On the other hand, there was a very interesting presentation at OOW2K5 called "Which Database Is Easier to Manage: Technical Case Study Comparing Oracle, SQL Server and IBM DB2" by Kevin Canady and Aaron Werman of Edison Group, Inc (not Oracle employees) who asserted the opposite. They presented a set of findings based precisely on counting the number of steps reuired to do common database tasks using the vendor's GUI management tool. Oracle have made a lot of progress in manageability in 10g and the Edison Group assessment is Oracle 10g is considerably easier to manage than MSSQL. They have published these findings as head-to-head slapdowns(Oracle 10g vs Microsoft and Oracle 10g vs DB2) but the three-way comparison was dead instructive. In some areas MSSQL is less manageable than DB2. Of course, Canady and Werman were comparing production versions, which meant MSSQL 2000; an old, old product but whose fault is that?

In the Q&A slot I questioned whether counting steps in the vendor's GUI is the appropriate metric for assessing manageability. Particularly for repetitive tasks a GUI is a lot less productive than even SQL Worksheet; besides, many experienced DBAs would have scripts to undertake common tasks. The presenters took the point, but it's the old case of measuring what is what measurable. We can count the number of steps it takes to achieve something in a wizard. It's a lot harder to compare how easy it is to achieve that same thing by the quickest possible means, because that might vary from DBA to DBA: my PL/SQL is quicker than my Python scripting but not as quick as your Perl scripting.

Monday, December 05, 2005

Aargh! HTMLDB is giving me JDeveloper flashbacks!

When I first started working with JDeveloper 3.0 in 2000 - we were not so much early as lonely adopters of BC4J (at least on this side of the pond) - the documentation was in a parlous state. We could get a first cut something working using the wizards, but as soon as we needed to go off piste we were lost. The in-built help text was rubbish; virtually nothing at all on BC4J, which had been introduced into 3.0 and had no link with any existing Oracle technology. All OTN offered were some tutorials and, later on, some How Tos; inevitably these never quite covered the areas that were troubling us the most.

Having spent a couple of days wrassling with HTMLDB I find I'm in the same predicament. Sure I can build straightforward Create/Edit/Delete pages quite nicely but now I want to build an integrated application and ... it's not easy. The document consists of tutorials and How Tos, which - you know what's coming - don't quite show me how to do what I want to do. The problem is the documentation doesn't seem to be written by people with a lot of experience in writing form-type applications. The two day tutorial doesn't even mention Master-Detail forms, which I would have thought is a fairly basic; even spreadsheets frequently have some header info.

Of course, the HTMLDB forum seems to have a lot more answered posts than I recall the JDeveloper forum got back in the days. OTN has quite a few sample applications, so perhaps I just need to install all of them until I find an example. And there's also blogs. So no doubt the information I need is out there, somewhere. It's just finding it that's going to be the issue. At least I hope so. I've been trying to build an LOV that has its query restricted by an existing value on the page; the resources on the interweb have offered me at least three different implementations , none of which worked the way I wanted.

I'm just stressing out here probably because I'm trying to be too clever too soon. I obviously need to stop being an active user and spend two days going through the tutorials, building applications I don't need, in order to get a handle on the basics. But with a heavy heart I'm afraid I have to tell my project manager to start cranking out the Excel again. It's not going to be as easy to implement his spreadsheet in HTMLDB as I thought. Blast.

Thursday, December 01, 2005

Neology Corner: Reshoring

I am introducing a new coinage into the wild: reshoring. This is what happens when a project that has been offshored turns out to have been wrongshored (heh); when everything's gone pearshaped and the project is brought back to be sorted out. Sample usage: "Have you heard about Project FFIENNES? They're reshoring it from Bangalore."

Was my coining of this phrase inspired by any specific project I have come across? You might think that, I couldn't possibly comment.

Wednesday, November 30, 2005

UKOUG Development Engineering SIG

Yesterday was my first real SIG on my own. My co-chair Guy Mortenson couldn't make it and the agenda was wholly organised by me. So I await the feedback with trepidation. The good news is that Guy and I were re-elected unopposed. Not that the UKOUG is a banana republic, but as Chair I had to preside over the election process...

I think the agenda was quite balanced: we had two items on new technology (HTMLDB and JDeveloper, two items on old technology (Forms) and I filled Guy's clowning role by delivering a short skit called "The worst week of my professional career".

The core audience for the DE SIG remains Forms developers; there's some people using Java but no-one using PHP or .NET and no interest in .NET. As an organiser I find the problem ith Forms is finding something new to say. Pretty much the only topics that are in the slightest bit fresh are highly technical investigations into the plumbing of Oracle application server. Kavitha Prakash from Oracle Support confirmed this to me afterwards; she said that pretty much all of the calls Support get are about app server configuration, deployment and debugging; there are almost no calls on coding problems. Gavin Leith of Sopra Newell and Budge gave an interesting talk on JDAPI, a Java tool for programatically tweaking Forms programs. This would have been useful to know about two years back when I was migrating a Forms client/server project to 9i web Forms, but to be frank I hope never to touch Forms again.

The talk that seemed to generate the most interest was given by David Richard of on HTMLDB. This was actually part 2 of a presentation that he started to give at the previous SIG in June. This time he actually managed to demonstrate his case study application and show some of the wiring under the hood. The application was a tactical solution for the NHS. This both proved the complexity of apps that we can build with HTMLDB and (I think) hinted at the limitations of the tool: A4C was a fantastic project to knock up in five weeks but it would be a nightmare to maintain. The problems of configuration management and code visibility in a metadata repository would get too pressing. Still, it inspired me. Last Friday my project manager showed me his latest spreadsheet for estimating and I told him we should be doing it soem other way; as I type this I am installing HTMLDB so that I can do it better.

Lastly Duncan Mills demonstrated his favourite new features in the new JDeveloper 10.3. I have to say the Java Server Faces implementation looks very good. My sole reservation is that it is so huge. Even Duncan had to look at his crib sheets to wrangle some piece of syntax. He's been living with this for most of the year: if he doesn't know it all, what hope is there for the rest of us? This is a serious point. Just to build a pop-up LOV required choosing a widget from a list of many dozens of options. Can there possibly be enough time to master these tools before the Java caravan moves on and there's a whole new set of APIs to learn?

Thursday, November 17, 2005

How To Be A Good Guru

In her engaging UKOUG presentation on being a newbie Lisa Dobson devoted a large chunk of time to Being A Good Newbie. That is, how to post questions on Oracle-related lists in the manner most likely to elicit a helpful response. We might summarise this advice as don't poke the tigers.

Lisa didn't have the OTN Forums on her list of, er, lists but we get a lot of newbies posting questions there. Partly it's just location, location, location: the Oracle site is the obvious first port of call when you need help1. Also, it is not a forum where the really big beasts - the Oak Table chaps - visit and the level of discussion hardly ever descends to hex dumps of block headers and other such esoterica. Hence newbies are perhaps less likely to feel embarassed about posting simple questions. This is obviously a good thing but it does impose a burden on us soi disant experts who volunteer to answer their questions. So, in homage to Eric Raymond's seminal guide to list etiquette for newbies I am modestly proposing some advice to would-be responders. And, yes, I know I still regularly break these guidelines.

How to Answer Questions the Smart Way


#1. Don't answer questions to which you don't know the answer


Obvious really, but it's very easy to think you know something about the database that is no longer true, or maybe never was. For instance it has been a long time since anybody asserted that explicit cursors performed better than implicit ones, but people still proferred this advice long after it had ceased to be true. Be sure that if you do post something factually incorrect your peers will gleefully expose your bloomer to the wider world. It is better to post the right solution second than be first with a wrong one.

It is perfectly okay to research an answer. Indeed, one of the benefits of answering questions on the forums is that we discover stuff we didn't know. Questions coming from out of leftfield can tell teach us interesting (and sometimes even useful) things about how the database works.

#2. Explain yourself


Eric Raymond advises newbies to approach technical gurus in a supplicatory fashion. They are supposed to treat lists as resources of last resort, to kowtow before the collective wisdom and then present a detailed description of their problem, including complete specifics of environment and configuration, plus all the things they've already tried and all the manuals, whitepapers, etc they've already read, before humbly beseeching us for the merest crumb of assistance. Of course the ungrateful wretches never do this but we should still respond graciously.

It's not enough to dash off the correct answer. Consider whether its correctness will be obvious to the questioner. If not, try to explain why it's the correct answer. That way there's less chance that the questioner will be posting an almost identical question next week. Whenever possible include a link to the relevant part of the manual. Linking to a specfic heading in a chapter is better than just linking to the Table of Contents, but the manual is not always tagged the way we would like. Similarly, if you need more information, explain what else you need to know and why you need to know it. If you want (say) an explain plan and you suspect they don't know what that is, link to the manual.

#3. Give as little assistance as necessary


The most effective form of learning is discovering things for ourselves. Teaching someone how to diagnose their own code (use SQL> SHOW ERROR, look up the error, check the syntax in the online documentation) is better than just rewriting their code for them. Not least because in rewriting the code we are likely to break some business rule we do not understand.

#4. Show your workings


When answering a SQL related post it is always best to include a worked through example. Take a tip out of Tom Kyte's practice: use cut'n'paste from SQL*Plus to demonstrate that what you have asserted is in fact the case. This is a corollary of #1.

If, for reasons of time or environment (for instance you do not access to a database) it is acceptable to post untested code, provided:

  • you indicate it is such;
  • you think an untested code sample is more helpful than no code sample at all;
  • you think it is probably correct. Heh.

Nothing exposes a poseur faster than a piece of code that doesn't even compile, so make sure you cover yourself.

#5. Use humour judiciously


Many people using the forums do not have English as their first language. Humour does not always travel well between cultures. Some questioners will not be expecting humour in a work context2. Furthermore, even amongst English speakers, humour can be difficult to spot without the non-verbal signifiers that accompany barroom banter. In particular irony is a tough one to pull off. Still, humour is a Good Thing and can liven up some dry reads so by all means be witty (if you can - lame jokes are, well, lame). It is helpful to use emoticons to signify that your preceding line was intended humourously, even if they are a debasement of the high standards of English literature. Jane Austen never posts on Oracle lists anyway :)

Oh, and sarcasm is right out (see #6).

#6. If you can't say something nice don't say anything at all


Just like your mother told you.

There are no stupid questions only stupid answers. If someone has posted a question you don't think is worthy of an answer then don't bother answering. Remember: you're a volunteer, there is no compulsion, you are choosing to answer the question. So, the person is not wasting your time by asking a stupid question, you are wasting your own time by typing a stupid (angry, sarcastic or belittling) answer. By all means explain what is wrong with the question, show how it could have been phrased better or request more details. If some newbie has posted "my code doesn't work", ask them to describe the observed behaviour, to explain the difference from expected behaviour and to paste in the error message and callstack (if appropriate).

If somebody seems to be particularly unreasonable - posting an URGENT!!! question on Saturday and then whinging in follow-ups that nobody has responded - feel free to explain to them that you are a volunteer, this is a free service and there is no SLA. In fact, if they want an answer within a set timeframe they should stop being so darned cheap and spring for a support contract. Also, if I suspect the poster is a student looking for me to do their homework I always ask for a course credit (Not being American I have no idea what this means).

#7. Avoid jargon, baffling acronyms and idiolects


Fnord. This is just another way of demonstrating your superiority over the OP. Of course, like wit, you can use such stuff if you think your audience will get it. Alternatively, embed a link to the Jargon Dictionary, although this rather undermines the point of using abbreviations. LOL.

#8. Never never never just respond with RTFM. Not ever.


Telling some newbie "RTFM" is an act of pure arrogance. It just feeds the respondent's ego without helping that questioner learn anything, except maybe not to ask for help in the forum again. Barbara Boehmer taught me this one. Keep in mind that the Oracle FM is huge; there are dozens of books and the search engine fronting the online version ain't that great. At the very least, post "RTFM" and a link to a relevant part of TFM. That way at least they will know where to go the next time they need to find out something.

STFW is at least as bad and arguably worse. Googling for information about Oracle problems takes a lot of skill, not just in filtering queries but in knowing which results can be trusted. There are plenty of snakeoil merchants out there. (You may think you know who I am talking about but there are others too).

#9. Meditate on eternity


Other people will read your posts in the future, because they will come up in search results. Obviously if these people are using the OTN Forum search engine they'll probably be after an answer to some completely different question but Google also indexes the OTN Forums. So try to make your answers suitable for a wider audience. Besides, as Jakob Nielsen observed in another context, your future boss may be reading.

#10. Keep your newbie mind


We were all newbies once. We are all still newbies in some dimension of the database, it's just too big for one mind to know everything. Even Tom Kyte occasionally farms out questions to Sean Dillon, Cameron O'Rourke et alia. So the next time you find yourself about to type a withering riposte to some "dumb" question just remember: one day, in some forum or other, you will ask a dumb question and an arrogant, big-brained geek is going to squash you like a fly.


1. Unfortunately this means people do assume their questions will be answered by Oracle employees and therefore there is some SLA we have to meet. In fact most OTN forums have little or no active Oracle participation (the HTMLDB, Developer and JDeveloper forums being honourable exceptions).

2. Here is my favourite example (the words are approximate, this is from memory). The questioner ask a generically "stupid" question, "How can I improve the performance of my database?". A wag responded (using the UBB [code] markup so it looked authentic):

ALTER SYSTEM SET GO_FASTER='TRUE'
/

The original posted replied, "I tried this command but it failed due to illegal option". Which is funny but also rather cruel.

Tuesday, November 15, 2005

Another rainy day in this twenty-first century metropolis

Yesterday I decided to do a bit of work at home, as I wanted to do some data modelling (documentation, documenation, doncha just luv it?) and, for some tedious reason, I have Visio Professional on my home laptop but only Standard on my work machine.

First I decided it was finally time I activated my licence. Not having internet access at home meant having to do it over the phone. I can see now why the web method is recommended; typing in seven sets of six digits twice, once on the phone keypad the second on the computer with the added fun of pressing the phone hash key after every set is not a lot of fun. Particularly when you have a four-year-old boy registering their displeasure at you being on the phone by playing a toy synthesizer in the most unmusical fashion possible. Because I'm a masochist I registered my Office licence at the same time. Of course, MS don't seem to think people will register two products so I have to hang-up and redial.

Then I discovered that Visio doesn't support cut'n'paste of multiple lines into the Entity Definition column sheet (unless there's some trick I need to discover). After a while the repetition got to me so I decided I would be better off trying reverse engineering. Only I didn't have the database schema on my home laptop (having cleared 9i to install XE), so it's into the office after all.

On the way I decide to go to the parcel office to collect my latest consignment from Amazon. After all, I have Tooting Bec tube station at the end of my road and it's only one stop. And they are work-related books. Except that the Nortyhern Line is undergoing emergency engineering so there are no trains going south. Because it's be raining the traffic is blocked solid so I decide to walk instead of waiting for a bus. This is a sound decision: in the fifteen minutes it takes me to walk to the parcel office I overtake about half-a-dozen buses; not one overtakes me back. I casually note that most of the traffic consists of single people sitting in cars, leavened with the occasional van.

At this rate I'm starting to think that the post office will have lost my parcel but no, they have it and it contains the correct books. Hurrah! Now all I have to do is get into work, which is slow but at least I get there.

On the way home in the evening the service is suspended because of a security alert aty Balham. Naturally London's superb bus service is available to take up the slack. As if. Very long wait, very crowded buses, very slow journey.

When I get home I install the schemas into my XE database. At least that works. I fire up Visio, click into reverse engineering mode and it shows me all the objects in my XE database. But when I tried to actually import a table it fails with fatal error. No clues but I'm guessing some kind of driver issue; I'll give it another go this evening.

But wasn't the twenty-first century supposed to be different? Where is my helicopter for commuting to the office? Where is my holiday on the moon? Where is the technology that works properly, first time, all the time?

Friday, November 11, 2005

Oracle Express Edition: Good things come to those who wait

I decided to give XE one last try on Windows before turning to VM Ware. So I uninstalled XE using the MSI program. This did a stand-up job of tidying up everthing which was a relief as it's not an experience I've always had with de-installing Oracle before.

Then I set about tweaking my configuration. About the only problem on the known issues list that I didn't have was an account name with spaces. Here's what I did do:

(1) Control Panel > System > Advanced > Environment
  • Remove ActiveState Perl from the PATH variable
  • Point TEMP and TMP variables at C:\temp instead of the default
  • Remove the ORACLE_HOME variable (not sure I have this, I think it might break an Ant script)

(2) Stop the Oracle 9i services
(3) Control Panel > Region and Language, change preference to English (US)
(4) Reboot

Then I re-ran the installer and it worked! I now have a nice 10gXE on my work machine. Just in time for the weekend, my wife will be pleased. And my 9i installation isn' t broken either so I'm a happy bunny once more.

Thursday, November 10, 2005

Oracle Express Edition: Security Patching Policy

Earlier this month Pete Finnegan wondered whether we will get security patches for XE. Mark Townsend has now posted on the OTN XE Forum that Oracle intends to release fully patched versions of XE. Users will just install the new XE software over their existing install. This approach is deemed to be "easier than patching".

Given the target demographics of XE this is probably true but it will be interesting to see how this works in practice. This will presumably create additional overhead for ISVs who wish to customise the XE download (for instance by replacing the default seed DB).

Still, at least it looks as though we will avoid Pete's nightmare version of thousands on unpatched Oracle databases taking over the web.

Wikipedia: the dumbness of crowds

A posting on the XE forum observes that "By far the best known Wiki is Wikipedia". Almost certainly true but how very depressing.

The problem with the Wikipedia is that entries are of highly variable reliability and quantity. Due to the sort of people who contibute to Wikipedia, the entries on (say) Star Wars or the Klingon language are broader, deeper, more detailed and accurate than (say) the entries on relational database theory. In practice most of the entries on computing and related disciplines are reasonably reliable, because there are anough web users with relevant knowledge to correct obvious errors in their own fields (if they can be bothered).

Even so, unless you already know a fair bit about the topic it can be hard to determine whether the entry has been written by a leading expert or some passing nimrod. And when it gets to things like Latvian mythology, who knows? Is this entry on Tanis Diena, the sacred pig holiday a spoof? How would you find out, except by going to some authoritative (but less exciting) source such as the Encyclopedia Britannica in your local library? Even the Wikipedia founder says that too many entries in the Wikipedia "are nearly unreadable crap".

I am reminded of the chapter in "Surely you're joking, Mr Feynman" when Richard Feynman was reviewing physics textbooks for schools.
The man who replaced me on the commission said, "That book [that I thought was bad] was approved by sixty-five engineers at the Such-and-such Aircraft Company." I didn't doubt that the company had some pretty good engineers, but to take sixty-five engineers is to take a wide range of ability - and to necessarily include some pretty poor guys...It would have been far better for the company to decide who their better engineers were, and have them look at the book. I couldn't claim I was smarter than sixty-five other guys - but the average of sixty-five other guys, certainly!


Of course, there are some very good uses for the wiki technology. A prime example is the Extreme Programming Roadmap. This site is hosted by Ward Cunningham, who invented the Wiki concept as well as being one of the founders of XP along with Kent Beck. This wiki works because it is a site for sharing and exploring ideas. It is a conversation, an exchange of opinions, not a source of facts. It is precisely not an encyclopedia of Extreme Programming (eXPedia? or has somebody already got that?).

Wikipedia is predicated on the assumption that knowledge works like some kind of pachinko machine: the channel where the most balls go must be the truth. But actually all you end up with is a lot of balls.

Tuesday, November 08, 2005

Oracle Express Edition: Third Strike

Mike Townsend on the XE forum said that the ORA-12557 error indicated an Oracle Home variable pointing at the wrong set of DLLs. After some bootless tweaking of registry settings (actually wuite a lot of booting was involved, I think fruitless is the word I'm after) I found that I had an ORACLE_HOME in my environment variables.

So I set that to the XE directory. And lo! the ORA-12557 error went away and the database build progressed a bit further. Not far enough to actually build the XE database you understand, but at least it was connecting to the instance. Unfortunately changing that variable to point to XE home breaks my 9i installation very badly. As I need 9i for my work right now and I don't need XE I think that just about wraps up my XE adventures for the time being.

In an unrelated item I note that the Register has a report on a survey finding that software problems cause people to swear, drink and throw things. Well I never! The things these surveys reveal!

Oracle Express Edition: two strikes, the pitcher steps up to the plate...

The world is divided into two groups of people: those for whom installing Oracle Express edition has been a piece of cake and those for whom it's been a flipping nightmare. Unfortunately I find myself in the latter group.

The first problem was the install spinning when it was trying to create the XE services. CPU meter up to 100% for as long as you like. This turned out to be an artefact of having NLS_LANG set to UK English. All that was required was settting to American_America.WE8ISO8859P1. Ooops! We might have thought that offshoring so much development and support work would have alerted Oracle to globalisation but apparently not.

Having got past that the second problem rears its ugly head. I now have an instance but no data files. Each time the scripts tried to connect to the database the failed with ORA-12557: TNS:protocol adapter not loadable. This is a rara avis; the only note on Metalink relates to Grid controllers, which doesn't seem to fit the case here, and Google likewise draws a blank. Let's hope Mike Townsend comes up with something.

Before you Linuxen start smirking this is not particularly a Windows problem: I was able to install XE on my home laptop first time. My home machine is lower spec but same operating system so it's something about the specific configuration of my work machine that's giving me grief. I am only persevering with this because if I ever need XE, I will need it on my work machine.

Although I must admit I am starting to get very tired with the process: it requires several manual steps - editing the registry, renaming files, two reboots - to clear down XE prior to re-installing. However, I have just discovered that if I re-run the MSI against an untouched install it asks if I want to uninstall XE. I wish I known this earlier: the Installation guide talks about using Add/Remove Programs in the Control Panel but that option only appears once the installation has passed the Services point. Of course, the MSI uninstall option may also only be triggered if the prior install got to that point. I'm afraid I lack the strength to de- and re-install just to find out.

So what have I learnt so far? Not a lot. I've spent hours, literally hours, trying to install XE on my work machine with no success. I certainly haven't had time to build an app on my home machine. I do know two things. One is that the MSDE team is not yet quaking in their boots. The other is that I don't think this blog is likely to appear in the 10XE User Experiences any time soon.

Thursday, November 03, 2005

UKOUG Annual Conference: A retrospective

Walking along the canals of Birmingham on Sunday I was struck by how not like San Francisco it was. Not just the colour of the sky but the whole attitude of the place. The canals of Birmingham have been reclaimed from their industrial past and re-branded as a tourist attraction. What this actually means is a lot of canal side bars with aspirational names like Panama, Ipanema and Santa Fe (not particularly famous for it's canals). One ristorante has an Venetian gondola moored outside. Meanwhile dead leaves float in the canal and people scurry past in their windcheaters and overcoats. Still, you can't get a decent pint of IPA in St Mark's Square so it cuts both ways.

Another difference between Open World and UKOUG, as Mark Rittman has also observed, is that us UKOUG committee members were there to do a job, so blogging in real time was difficult. Here are my personal highlights from the annual conference.

Best Presentation: Developing your career through system disasters by Martin Widlake


An irresistible title and a first class presentation. It wasn't just cynical laughing at the dumb things people do, it also gave tips on how to turn those dumb things to your professional advantage. Martin was full of useful insights, advice and aphorisms. "Disaster tolerant software isn't". Compressed time scales "move us into our stretch zones and develop our resilience skills". Interestingly enough the presentation turned, briefly, into a lecture on the value of certain RAD/Agile practices, specifically, developing systems in discrete chunks that take no longer than three months to deliver. As Martin said:
You don't understand your users. That's okay because they don't understand you either.

This is the situation he calls the Knowledge Curtain.

Most Brain Stretching Presentation: Null values: Nothing to worry about by Lex de Haan


It wasn't the SQL that fazed me it was the calculus. I'm a historian, get me out of here! Lex delivered a through exploration of how NULL works in SQL and the relationship between the empty set and NULL. The key fact is that a NULL in a arithmetic expression returns NULL whereas group functions ignore NULL. He gave us some good hints for writing queries to handle NULL without getting the wrong results. Definitely a presentation to download and work through the examples.

Most Interesting Factoid: How To Handle Missing Information Without Using Nulls by Hugh Darwen


I always thought that the reason the relational theory crowd didn't like NULL was because they objected to the absence of meaning. Hugh said that if SQL had implemented NULL=NULL that would have been okay. Well, okay-ish. The absence of meaning would still be a problem but it's the additional work necessary to handle NULL that really rankles (I supect Fabian Pascal may take a different stance). Anyway, Hugh started his presentation with the observation that everybody in the audience had a vested interested in the badness of SQL and ended it with an exhortation to us to pester Oracle for better SQL. Guilty as charged, but I'm afraid I'm more likely to pester Oracle for a more complete Type implementation than I am to ask for changes to the SQL standard. Although I do think being able to SELECT * EXCEPT comm FROM emp; would be nice to have.

Worst Start To A Presentation: Performance from a Different Perspective by Mogens Nørgaard


There's never a good time to hear the skirl of the bagpipes but 9.00am is really bad. (My father was Scottish so I'm allowed to say this.) At last year's conference Mogens presented without shoes. This year he presented without trousers1. It might be a good idea to skip next year's presentation ;)

Most Depressing Fact: Does ADF live up to the hype? by Paul Jeynes


In 2000 when I was working on a project using BC4J with JDeveloper3.0 we had real problems getting any kind of assistance from Oracle Support or finding relevant How To documentation. Of course, in those days Java was still supported by the Server Tech guys because Support thought it was only used in the database. Five years on, ADF is here, Java is primarily used in the J2EE web environment and the quality of support does not seem to have improved much.

Most Intriguing Business Move: The Launch of Oracle Express Edition by Tom Kyte


As Tom observed at the start of his presentation this has already been widely blogged even before the launch but he still managed to generate a buzz. Obviously giving away a free database was (with hindsight) almost inevitable in the current database market. People do like free as a price. I think the interesting thing about Oracle XE is its potential as a MySQL killer. With Oracle XE you are going to get a reliable database with stored procedures, triggers and relational integrity. Furthermore, you've got an easy migration path if you exceed the (generous) limits or need certain enterprise features. Probably the only people who aren't going to choose XE are zealots in the Open Source and the Microsoft communities. Who'd have thought they'd end up on the same side? So, taken with the purchase of InnoDB, I think Oracle really has MySQL AB by the short and curlies.

The only thing Oracle can do to muck this up is not issue patches, at least for show stopping bugs and security holes. There's no point in encouraging thousands of new people to join the Oracle community if means exposing them to Oracle-focused worms. Whilst stealing Microsoft's shtick on helping developers and learners Oracle do not also want to give themselves Redmond's reputation on security issues.

Best Meal: The Oracle Blogger's Dinner by Mark Rittman


Actually this is not a difficult call as catering for over two thousand people over short periods of time rarely generates fine cuisine. Still, thanks to Mark for organising it and thanks to James Haslam of the UKOUG for sponsoring it. It was nice to be able to put faces to some of the blogs I read. I think next time we should wear badges with the name of our blogs. By the way, what is it with Chinese restaurants? The set menus are always ridiculously over-specified. The third course had far too many dishes. As the sole troublesome veggie I ended up with three dishes all to myself plus rice, on top of the previous two courses. Thank goodness I had been unable to fill myself up on prawn crackers beforehand.


1. To be fair Mogens did wear a kilt.

Thursday, October 27, 2005

Agile Databases and other paradoxes

So Niall Litchfield’s aside about Sandra Momali’s taste for Agile development has kicked off a bit of a debate. I thought I’d throw in my tuppenceworth, as I find XP a very seductive idea, even though I haven’t had much opportunity to use more than a couple of its techniques. I think it is easy for discussion about Agile development to descend into straightforward bashing of Java heads and developer-vs-DBA scrapping. Which can be fun for the participants but are not particularly enlightening for spectators. Besides there’s more to Agile than Java. In fact, Bruce Tate (author of Better, Faster, Lighter Java) seems ready to dump it in favour of Ruby because Java is insufficiently agile, EJB3.0 notwithstanding.

I hope we can all agree that the problems that Agile seeks to address are valid ones. Applications are all too frequently delivered which are bug ridden, late, not what the customer wanted, not what the customer now needs, and sometimes all of the above simultaneously. Let’s disregard considerations of whether there are other approaches that can also solve these problems and take the Agile approach as a given. The question that needs to be answered is, "Can Agile techniques sensibly and profitably be applied to database development?"1

From the Agile side of the fence the answer is mostly a resounding raspberry. Agile practioners tend to regard regard databases as persistence repositories of last resort. They have a number of strategies to avoid writing SQL. Not just by deferral, using Mock Objects in the development stage, but by making deliberate architectural decisions to not use databases. These range from serialization to files through use of in-memory object stores like Prevayler to hands-off Object-Relational mapping tools like Hibernate. Last year I was talking to a UKOUG member who no longer attended the SIG I help run. He explained that his project was currently being migrated to a new version using Hibernate, Spring, Velocity, etc. I said, that sounds exciting, could someone do a presentation at the SIG? Back came the answer: No. Being Java developers they literally could not see the point in talking to a database user group. The whole point about their approach to application development was to avoid thinking about the database at all.

Some of this resistance may be down to sheer pigheadedness, but (at the risk of seeming to patronise Ron Jeffries) many of these people are actually very bright and aware people. They just don’t think databases can be Agile. Why is this? Let’s look at some of the Agile practices that are made harder by working with an RDBMS.

Incremental Design


Agile starts with rather sparsely-defined requirements and uses techniques such as Test Driven Design to flesh them out. This is not building a prototype, this is working, production quality code. By building real code the Agile practioner can show his user a working application and get meaningful feedback that allows him to refine the requirements. Hence together they build the system that the user actually wants. The anti-pattern for this is Big Design Up Front. Here we spend ages drawing a mesh of boxes called an Entity Relationship Diagram. We show it to a bemused user who nods guardedly. We turn it into a data model but the user still isn’t as excited as we are. Finally the database gets built and then the front end gets built on it and whereupon the user wails, "But that’s not what I meant at all!" The question is, does the fault lie in the database or the process? Are databases inherently BDUF?

Obviously, we can just build one table at a time. But is that enough? Probably not. We still need to normalise our database2. Consequently, any attempt to build our database incrementally means constantly refactoring of our existing tables, to eliminate duplication. Can we do this? Yes we can! Of course it requires that we hide all our tables from public gaze behind an API - PL/SQL packages, views or types, which some people will just hate. The larger question is Tom Kyte's point about the importance of designing for performance right from the start. Does that imply BDUF? Yes, at least some. The other problem is that refactoring an object is a lot simpler than splitting one table filled with twenty million rows into two tables. Our database design can be reasonably plastic in development but once we go into production inertia kicks in. I think here is the killer for Agile practices: database refactoring is hard. Scott Ambler seems to be ploughing a lonely furrow in this area but his thoughts on The Process of Database Refactoring make interesting reading.

User stories


Agile practices tend to re-inforce each other and that’s the case with User Stories and Incremental Design. User stories describe how the customer’s business works. These stories will not mention data storage, except by implication. Customers don’t specify a database, they specify an application, that is, a front end. Customers cannot accept or validate databases. Even if we gave them TOAD and they wrote SQL queries that would not prove the database met any of their requirements, because their requirements are specified in terms of the front end. And without continuous user feedback we cannot be sure that we are coding in the right direction.

Kent Graziano has been working on building a datawarehouse using Agile techniques. He has presented on Agile Methods and DataWarehousing several times this year. When I saw him talk at Open World he said he had got some grief from Agilistas because the ETL section of datawarehouses doesn’t have users. So there cannot be any user stories. But as Kent points out, just because the business user (the customer) doesn’t know or care about the ETL process doesn’t mean that ETL has no users. On Kent's project they put the BI report writer in the user role. Which is a nimble, indeed agile, extension of the practice which doesn’t, as far as I can see, break any tenet.

Common Ownership of Code


When programming an agile practioner drives a path through the code base. If she finds an existing part of the application that blocks her implementation she can change, extend or fix that code. She can do this safely because the existing code has unit tests and the existing application has integration tests. More importantly, she can do this new work because the existing code base is in Java and she knows Java. But if this piece in the code base was in PL/SQL she would be lost: she doesn’t know PL/SQL. Even worse, suppose her change requires a new table? Then she would have to go to the DBA to find out about schemas, tablespaces, etc. This is too slow for the Agile way of working.

Teams of specialists are not Agile. We know this is true. How often have we been trying to progress a project only to be told, “We can’t do that, Gary’s on leave today.” To be fair this does not just apply to databases. I think Agile practices militates against heterogeneous programming environments and would be equally suspicious of (say) extensive use of shell programming. So, unless pretty much the whole team is competent in PL/SQL, using stored procedures just does not fit in an Agile project.

What this boils down to is the matter of where we should put the business logic. Unfortunately this frequently descends into a religious war. Either you believe it’s obvious that business rules belong in the database or it’s obvious to you that they belong in the middle tier. So let’s put it another way: in a client/server application where does the business logic belong? I think a large part of the middle tier proponents would then grudgingly accept the merits of the database as the repository of business logic. In most sites today we probably have heterogenous applications written in a variety of styles, techniques and languages, including many client/server applications. Our best hope of consolidating business rules is to use the database. But, this is an emotional debate and not one I expect either side to cede.

Object Oriented Programming


The alert amongst you will have noticed how often the term object appears in that list of persistence techniques: this is key. Agile programming languages are object-oriented languages. I was recently embroiled in a debate on the Test Driven Design list when I was told this surprising fact. Surprisng because I thought for several years I had been doing Test Driven Design by using Steven Feuerstein’s utPLSQL to build database applications. Apparently there’s more to Test First than merely writing our tests first.

Obviously an RDBMS is not object-oriented. A non-OO language like PL/SQL lacks certain key features supposedly necessary to the full panoply of Agile practices - abstraction, interfaces, reflection. Does this matter? I remain unconvinced. XP originated in the Smalltalk community and pretty much everybody you come across on Agile/Test Driven arenas seems to be an OO programmer. However, this is a self-fulfilling prophecy. Come out as a relational database developer and you get labelled as a handyman with only a hammer in your toolbox.

Use of Tools


Agile practioners make full use of utilities to improve their productivity - smart IDEs, code completion, continuous integration, automated unit testing, test coverage estimnators, refactoring browsers, etc. Compared to this panoply of riches PL/SQL looks very Spartan. There is the aforementioned utPLSQL but not much else. Of course, this is a vicious circle. PL/SQL lacks the tools to support Agile practices so people who want to be Agile don’t use PL/SQL so nobody builds the tools for PL/SQL.

Database development tools tend to focus on browsing the data dictionary and running SQL statements. There is very little around that genuinely supports the developer in building better PL/SQL or helps the DBA build better databases. This is a situation that is only going to get worse, as Oracle Designer slowly fades into the sunset. Paul Dorsey’s BRIM project (AKA The Tool) may be one to watch. Interestingly there is very little open source stuff for PL/SQL developers, compared to the wealth of freely downloadable utilities for Java heads and Pythonistas. I think this illustrates the lack of people who are competent in both an application (i.e. a UI building) language and PL/SQL.

Still, the Agile Manifesto says we have come to value individuals and interactions over processes and tools, so that’s all right then.

Instaneous Feedback


There is an old rule of thumb from the HCI arena that states that a user will regard as “too slow” any task that takes longer than ten seconds; if it takes longer than a minute they will start on another task and come back to the first task later. In Test Driven circles, running a suite of unit tests is such a task. The JUnit list regularly features complaints about how long it takes to run unit tests that require population of a database. This interferes with flow. Hence the popularity of Mock Objects. Hence the drive to isolate the database elements to as small a subset of the application as possible.

I think the database has to cop to this one. If your sole experience of database population is writing tedious XML files for use in DbUnit then you will naturally have a jaundiced view of RDBMS systems. But even people who know how to write SQL must admit that deleting and inserting records takes longer than instantiating some objects (once the JVM has been warmed up!). That’s the price we happily pay for rigour.

Pair Programming


Well, database people are notoriously misanthropic. Especially DBAs. We can still talk to each other.

Conclusion


The Agile argument is databases are slow to build and inherently hard to understand. This is true. But it’s true because Agile is primarily a methodology targeted at building user-facing applications. Its adherents tend to work from the user interface downwards. Of course it’s crucial that we build an application that meets the user’s needs. But the user’s needs extend beyond the functional requirements of the application screens.

That doesn’t mean we cannot apply Agile techniques to database development projects. Certainly I regard Test First to be an invaluable technique in building stored procedures; I’m always nevervous when I’m not coding to a utPLSQL test case. My experience of working on DSDM projects tells me that incremental development - in particular placing working code in front of users early and often - is a very good idea. Kent’s work proves that Agile techniques can be profitably applied even to a juggernaut like a datawarehouse. The pain comes when OO-fixated bean-mongers clash with constraint obsessed databasers. Perhaps if they drank less coffee they wouldn’t be so hyped up all the time.


1. By database development I mean building data structures (i.e. tables) as well as programs (PL/SQL).

2. I learnt yesterday that Codd’s Twelve Rules have been deprecated because "Codd formulated them as a quick and dirty way to counter all the nonsense that was floating at that early time, they are not orthogonal or systematic, and our understanding of RM has progressed considerably since then."

Thursday, October 20, 2005

ToDo Driven Development

Lucas Jellema has just posted a technique for incorporating TODO tags in PL/SQL codes. This was a spooky piece of synchronicity because I had just stumbled across a "sexy new development methodology" called ToDo Driven Development on the SecretGeek blog. Leon Bambrick's implementation is for .Net and I was going to port it PL/SQL but Lucas has saved me the effort. Mind you, ToDo Driven Development has an extension which tracks HACKs as well as TODOs and that's obviously worth having. So I may enhance Lucas's code this evening.