The Prime Number Few

I was chasing links through Wikipedia the other day, which always leads somewhere interesting.

In this case I fell into the deep waters of linguistics and learned about garden path sentences. They caught my eye in particular because the article includes one of my favourite jokes, albeit with a slightly different construction to my usual one.

"If time flies like an arrow, do fruit flies like a banana?"

Now that I've read a deconstruction of the joke, it seems a little less funny though.

A List Of Weekend Successes

A list of things we did this weekend

  1. Recommissioned sprinkler system, watered plant, soaked lawn, decommissioned sprinkler system
  2. Cut kids’ hair — no fatal wounds inflicted.
  3. Cleared basement
  4. Got rid of four old tires
  5. Made chicken and rice soup
  6. Mended kite — flew kite — broke kite again
  7. Boxed 10 cu.ft. of kids clothes, to go to Afghanistan via USAF apparantly.
  8. Got Poweredge 6400 running on Centos 4, moved it to the basement & started Oracle 10.1 install.

OK, about item 8.

The tricky part of the business was the boot. I had grub stage2read errors coming out the wazoo, and eventually gave up on trying “conventional” fixes. Booting with a floppy drive turned out to be the answer, as long as it referenced an initrd. Quite the learning experience.

Note to self: make backup of floppy disk! Maybe two backups.

Poweredge 6400 — the Great o/s Debate

First, some boring details.

The service tag for this machine is H6MGN01, and the recorded configuration seems to be pretty accurate. The critical part is this: “ASSEMBLY, CARD (CIRCUIT), POWEREDGE EXPANDABLE RAID CONTROLLER NUMBER, 3-DC, 128″

Maybe it’s a truism that the tricky part of working with these systems is getting the drivers for the array loaded before the install, but I seem to have worked that out. There was a nervous moment of array errors before I realized that the controller card was slightly unseated during shipping, but that seems to be a non-issue now.

Dell appear to have pretty good support for Linux, on the whole. I’ve been through the information at http://linux.dell.com/storage.shtml and deduced the following.

  1. The PERC 3/DC requires a MegaRAID driver “megaraid_mbox”
  2. The required driver is present in RHEL4 kernel 2.6.9-5.EL and higher — sounds good for a Whitbox or Centos install!
  3. SLES9 ought to work, but has not been tested on the PERC3 series by Dell
  4. The PERC3/DC firmware update must be extracted to floppy on a Windows machine
  5. There are Solaris drivers for the Adaptec card, but not for the PERC3. Boooh.

Point 1: no problem. Actually SuSE 8 appears to have the right drivers also. I tried a quick install yesterday evening but it choked on reboot with a “GRUB loading stage2Read error” — maybe something needs tweaking there.

Point 3: Rats. I’m going to have to get creative there, with some major surgery to move a floppy over to my Windows machine.

Anyway, I’m downloading Centos ISO’s right now, so we’ll see how they perform. Do you think that driver has to be specifically loaded before the install? I guess we’ll find out …

Poweredge 6400 — the Great o/s Debate

First, some boring details.

The service tag for this machine is H6MGN01, and the recorded configuration seems to be pretty accurate. The critical part is this: “ASSEMBLY, CARD (CIRCUIT), POWEREDGE EXPANDABLE RAID CONTROLLER NUMBER, 3-DC, 128″

Maybe it’s a truism that the tricky part of working with these systems is getting the drivers for the array loaded before the install, but I seem to have worked that out. There was a nervous moment of array errors before I realized that the controller card was slightly unseated during shipping, but that seems to be a non-issue now.

Dell appear to have pretty good support for Linux, on the whole. I’ve been through the information at http://linux.dell.com/storage.shtml and deduced the following.

  1. The PERC 3/DC requires a MegaRAID driver “megaraid_mbox”
  2. The required driver is present in RHEL4 kernel 2.6.9-5.EL and higher — sounds good for a Whitbox or Centos install!
  3. SLES9 ought to work, but has not been tested on the PERC3 series by Dell
  4. The PERC3/DC firmware update must be extracted to floppy on a Windows machine
  5. There are Solaris drivers for the Adaptec card, but not for the PERC3. Boooh.

Point 1: no problem. Actually SuSE 8 appears to have the right drivers also. I tried a quick install yesterday evening but it choked on reboot with a “GRUB loading stage2Read error” — maybe something needs tweaking there.

Point 3: Rats. I’m going to have to get creative there, with some major surgery to move a floppy over to my Windows machine.

Anyway, I’m downloading Centos ISO’s right now, so we’ll see how they perform. Do you think that driver has to be specifically loaded before the install? I guess we’ll find out …

A New Arrival

My new (used) Poweredge 6400 arrived today — a new dawn of technical complexity, electrical power consumption and noise pollution has arrived in the Sponge household.

The first technical challenge is what name to give to the machine? In accordance with my own conventions it has to be that of a London train station, and because it is short, wide, and dressed in black I immediately thought it looks like a Victoria. Unfortunately I already have one of those, so I think it’ll have to be “Waterloo”.

It’ll be a fine chance to give a brief history lesson on the Empire’s Days of Glory to my mob of ungrateful foreign colonial children.

Creating Built-in Help For PL/SQL Packages

This is a trivial application of basic techniques, but it seemed to me to be an idea worthwhile of sharing.

Anyway, I sometimes have a need to code up some PL/SQL to support ETL operations, and such procedures are often executed from the command line in SQL*Plus by operators. Currently I’m working on a generic package to support manual refresh of some troublesome materialized views.

This is not necessarily the sort of thing that the operators will run every day, and hence it seems worthwhile to put the documentation for the procedures literally at their fingertips by providing a built-in help function. I’ve done this by adding to the package a definition of a pipelined function called HELP, which simply spools out descriptions of procedures and parameters, and here’s how it works.

Start with an object type definition such as:

create or replace TYPE HELP_TEXT_TYPE
AS OBJECT ( help_text varchar2(80) );
/

Then add a table type definition:

create or replace TYPE HELP_TEXT_TYPE_TABLE
AS TABLE OF HELP_TEXT_TYPE;
/

In your package you’ll need a pipelined function specification:

Create Package help_demo
as
   function help                     
   return help_text_type_table
   pipelined;
End;
/

Then the package body contains the function definition, such as:

Create or replace Package Body help_demo
as
   function help
   return   help_text_type_table
   pipelined
   is
   begin
      Pipe Row(help_text_type('IF THIS IS DIFFICULT TO READ THEN USE THE COMMAND ...'));
      Pipe Row(help_text_type('set heading off pagesize 1000'));
      Pipe Row(help_text_type(''));
      Pipe Row(help_text_type('HELP for package HELP_DEMO'));
      Pipe Row(help_text_type('=========================='));
      Pipe Row(help_text_type(''));
      Pipe Row(help_text_type('Procedures'));
      Pipe Row(help_text_type('----------'));
      Pipe Row(help_text_type(''));
      Pipe Row(help_text_type(' None'));
      Pipe Row(help_text_type(''));
      Pipe Row(help_text_type('Functions'));
      Pipe Row(help_text_type('---------'));
      Pipe Row(help_text_type(''));
      Pipe Row(help_text_type('help:'));
      Pipe Row(help_text_type(' You''re reading it now. This is a demonstration of how'));
      Pipe Row(help_text_type(' to provide a built-in help functionality for a PL/SQL package'));
      Pipe Row(help_text_type(' that is accessible through SQL*Plus to user of the package'));
      Pipe Row(help_text_type(''));
      Pipe Row(help_text_type('Parameters'));
      Pipe Row(help_text_type('----------'));
      Pipe Row(help_text_type(''));
      Pipe Row(help_text_type(' There are none of those either, but if there were then they''d be'));
      Pipe Row(help_text_type(' listed and described here, like the following examples'));
      Pipe Row(help_text_type(''));
      Pipe Row(help_text_type(' autocommit; (Y/N) Default N'));
      Pipe Row(help_text_type('   Whether or not to commit each process as it completes'));
      Pipe Row(help_text_type('   A commit will be issued at the end anyway'));
      Pipe Row(help_text_type(''));
      Pipe Row(help_text_type('That Is All'));
      Pipe Row(help_text_type('==========='));
      Pipe Row(help_text_type(''));
      Pipe Row(help_text_type(' Get back to work'));
   End;
End;
/

When you issue the query;

Select * from table(help_demo.help)
/

… you get output such as …

IF THIS IS DIFFICULT TO READ THEN USE THE COMMAND ...
set heading off pagesize 1000

HELP for package HELP_DEMO
==========================

Procedures
----------

 None

Functions
---------

help:
 You're reading it now. This is a demonstration of how
 to provide a built-in help functionality for a PL/SQL package
 that is accessible through SQL*Plus to user of the package

Parameters
----------

 There are none of those either, but if there were then they'd be
 listed and described here, like the following examples

 autocommit; (Y/N) Default N
   Whether or not to commit each process as it completes
   A commit will be issued at the end anyway

That Is All
===========

 Get back to work

33 rows selected.

You might choose to wrap up the help functioanlity in a view, such as:

create view help_demo
as
select * from table(help_demo.help)
/

… to make is easier to access, or even use DBMS_OUTPUT to send the help text to the screen. I like this though as it’s accessible directly through SQL, the Universal Language.

Oracle Wiki at Dizwell

Howard’s Wiki at Dizwell is up and running, and seems to be off to a very good start considering that this is a pretty new thing for many of us. I hope that everyone will be contributing — these things only survive if we give it the oxygen of our participation, and I know that everyone has something to share.

The text formatting takes a little getting used to but at the bottom of the edit pages there are brief tips that will get you through the experience pretty painlessly.

Are you still here? Go, go ….