Fedora 15 Released

Fedora 15 has finally been released and is available in all the usual places, including here.

Naturally, Gladstone has been tested on it (it’s been working on the Alphas and Betas for a while now), and works just fine (with a slight pause when it first runs, because it has to download the lsb_release package before it can really get going).

There is a nasty linking error for 11g, of course, as previously described -and the workaround is exactly the same as before, too. Namely, Gladstone outputs a new shell script in the oracle user’s Desktop directory ahead of time, and this script can then be run when the Oracle Universal Installer linking error occurs, after which you can click the OUI’s ‘Retry’ button and all will be fine. (You run the second shell script as the oracle user, not as root).

The only real problem now, which I mentioned before too, is that in Gnome 3, the contents of the Desktop directory are not displayed on the, er, actual Desktop! So, you have to know that second shell script is there, because you won’t actually be able to see it as such.

If that’s as clear as mud, well… stick with Scientific Linux for an easier ride, I guess!

Also, I noticed an extremely long pause between the conclusion of the linking phase and the start of the Database Configuration Assistant that wasn’t there in the Alpha or Beta versions. The pause happened on three different physical servers, so although your mileage might vary, I think it’s definitely real. You have to be very, very patient therefore -but it does get there eventually.

Anyway, I also have prepared a Kickstart script for Fedora 15 (and a floppy image containing said script for those that don’t have a web server onto which the plain script can be dropped). If you use that script to perform the initial installation (it’s invoked in exactly the same way as for Scientific Linux 6, which I discussed here), you’ll end up with a substantially slimmed-down O/S (no Evolution mail client, for example; and 890-ish packages installed instead of the default 1200+) that’s still Oracle-friendly.

Oracle is for Newbies

I’m not sure where all these “Senior DBAs” with 17 years’ experience who think that “Oracle is f*cking complicated” and “not for newbies” as a consequence actually learnt their trade, but I’ll take a stab in the dark and suggest that it was, as newbies, by installing it, playing with it and, occasionally, stuffing up whilst doing so.

I suppose it’s true that those same senior DBAs will concede, eventually, that all they really mean is that “a week long course is not going to get someone up to speed”, but if their headline basically says “go away newbies, this stuff’s too complicated for you”, the damage has already been done, I think.

In any case, I think a week-long course might well get someone “up to speed”, though it’s obviously not going to make them the world’s leading Oracle DBA expert. For what it’s worth, I taught my first DBA course at Oracle Corporation six weeks after having first set eyes on the software and, though I say it myself, it wasn’t a bad course and the technical content was all that was required. It can be done, then; if not in one week, then half-a-dozen or so. Competence, at least, if not expertise.

It all depends on the person involved, really, doesn’t it? If you happen to be inquisitive, diligent and with a logical frame of mind, you’ll take to Oracle very well. If you’re intellectually lazy, casual in your study methods and find strict logic tricky, you’re not going to be very good at Oracle, no matter how long you study it. It also, I think, depends on the person doing the teaching: if their teaching style or materials leaves willing students bewildered, that’s the teacher’s (or her materials’) fault, not the student’s. But either way, the point is that “it depends”… and dismissal of entire swathes of people as mere ‘newbies’ doesn’t get us meaningfully closer to what’s really going on.

For the record, I don’t think database administration is particularly difficult -nor that Real Application Clusters are especially more difficult than single-instance Oracle to manage effectively. It’s an acquired skill, of course… but we all had to acquire it somewhere, sometime; and I don’t think it’s anything particular more skilful than the wizardry my local car mechanic performs every time he fixes my car. Anyone that tells you this stuff is so complicated that it’s for the eyes of Senior DBAs only and you might as well not bother is basically doing the old High Priest trick: only they are privy to the Great Mysteries and you are unworthy. Which is simply not true… and is otherwise known as “being patronising”.

New Scientific Gladstone (5.6)

My Gladstone pre-installation script for those intending to install the Oracle 10gR2 or 11gR2 RDBMS has been updated to take account of the fact that there is now a beta version of Scientific Linux 5.6 out.

I downloaded the O/S itself from here, and a modified version of Gladstone that can cope with the new O/S is available from the usual place.

It’s interesting to see how the cloners are handling their release schedules, what with Red Hat having just released version 6.1 of the “real” Enterprise O/S. Centos decided to concentrate on getting version 5.6 out of the door and worrying about getting a version 6 later; Scientific Linux did exactly the opposite. Their version 6 has been out quite a while whilst their 5.6 is, as this post has already mentioned, still in beta.

Where the Scientific Linux community gets my vote is that their 5.6 is obviously not far away (the beta I linked to above is incredibly stable), and their 6.0 has been a pleasure to use for months. Centos, meanwhile, managed to be late with their 5.6 release and still hasn’t got a 6.0 release planned for, as far as anyone can tell, any time soon.

From the outside, it looks like Centos as a project is really struggling -from internal politics? lack of developers? lack of other resources? I don’t know, and they’re not exactly communicative. But the net result from my perspective is that I’ve given up on Centos and will be using Scientific as my RHEL clone of choice from here on. I have mentioned this before, but now I’m getting serious about it: there will be no more Centos-compatible releases of Gladstone, even if they finally get version 6.0 out in the next couple of weeks.

How small can you get it?

My blog post title naturally refers to “the size of one’s Centos installations”, in case it wasn’t obvious!

Centos (and therefore Red Hat and its other clone cousins) installs a dirty great big Gnome system by default, complete with software such as OpenOffice.org, which I wouldn’t have said was exactly essential on a server! So how minimal can you get a Red Hat/Centos/etc installation, whilst nevertheless retaining a highly functional OS (so you have a file manager and an Internet browser so on, not just a bare command line?), that is additionally capable of running something like Oracle?

I’ve played around with this question quite a bit over the years, and here’s my not-so-secret recipe for svelte-ish Centos.

The first and most important thing to do is to make sure you customise your list of packages during the OS installation process itself… and de-select absolutely everything, including the Base group.

So, for starters, de-select “Desktop – Gnome” and select “Customize now” on this screen:

Once you click Next, you’ll be taken to this screen, where you work through the list on the left and de-select anything that’s been selected by default in the right-hand panel:

You’ll notice here that I’m de-selecting the Base package group, but there are about a half-dozen other groups that are selected by default lurking under the Applications and Servers groups, so un-check those, too.

Now you can go ahead and complete the OS install: it should only take around 3 minutes. When you reboot, you’ll have to log on at a command prompt (as root), at which point you can check how slim you’ve managed to get things:

That’s a 677MB installation of Centos 5.6 (64-bit), sitting on a suitably modest  1.9GB root partition – and that’s probably about as small as you’ll ever get a Red Hat-type OS to be (Ubuntu Server can be about half that size, by way of comparison). I’ll therefore call this the “minimal OS” and I’ll use it as the base onto which each of the options described in the rest of this blog piece will be installed.

A 677MB O/S is a good start, I suppose …but it’s not really usable, is it? Not unless you are a command-line loving guru, anyway. So how, minimally, to get a GUI-ish environment added to your 677MB starter OS? Well, there are a couple of options here.

Option 1 : Drastically Minimal

For truly minimal results, having logged on as root, type this command:

yum install xorg-x11-server-Xorg xorg-x11-xinit twm nano xterm

That should prompt you to perform a 34MB download/install, comprising about 40+ packages.

You may now need a quick edit of your default /etc/X11/xorg.conf file: mine had a section which mentioned driver=”vmware”. Because I hadn’t installed guest additions in my virtual machine at this point (because we’re being minimalist, right?!), that would not work. Change it to driver=”vesa”, however, and you’ll be good to go.

Now, you should be able to issue the command:

startx

…which will get you this:

This is the twm window manager, which is as basic (and horrible) as it’s possible to get. Left-click anywhere on the desktop and that sickly-green menu will appear, which contains ‘kill’ options to let you shut something down and an ‘xterm’ option to let you open up a terminal session. From the terminal, of course, everything is possible… indeed, I well recall using exactly this interface back in 2004 to install from scratch a two-node RAC in New York from a Sydney office. So, the functionality is certainly there, if you are able to grit your teeth hard enough. You’ll note from the screenshot that we’re now up to 865MB used on my root partition… still fairly svelte, for Red Hat-based distros, I think.

If you’re going to install Oracle on this box, you may well want to do it by using the Gladstone preinstallation script… and that’s fine. But you’ll first need to issue this command:

yum install redhat-lsb

…which adds another 14MB or so to the server.

Of course, you’ll then be needing an Internet browser to download Gladstone in the first place: the simplest approach, I think, is to do a

yum install firefox

… (though it costs another 75MB of download, including a lot of Gnome-related ‘litter’). You run the browser subsequently by opening an xterm and typing the command firefox, after which everything’s pretty standard fare.

You won’t be able to right-click the downloaded Gladstone shell script to alter its permissions, of course: old timers won’t be surprised to know, however, that a chmod 775 gladstone.sh at the command prompt will achieve the same thing.

Option 2 : Getting Fairly Maximal

If the delights of twm seem a bit too minimalist for you, there is a slim-ish alternative: Xfce. This is the desktop environment that Xubuntu uses (for one): it’s claimed to be lighter on resources than Gnome or KDE and therefore a lot faster than either. However, it uses a lot of the same libraries that Gnome uses, so I’m not really convinced that choosing it over bog-standard Gnome is hugely worthwhile: I mention it here only because it’s a nice way of showing what you can get on Centos without completely buying into Gnome. 

Assuming you’re prepared to give it a whirl, however, you’ll find that it’s very simple to install in your “minimal OS” install. Just issue the commands:

yum groupinstall "XFCE-4.4"
yum install xorg-x11-xinit xorg-x11-server-Xorg

That will trigger a somewhat less-than-svelte 123MB download, involving around 200+ packages. It takes a while, therefore, to get installed. It’s also true that I again needed to edit my /etc/X11/xorg.conf to change the driver from “vmware” to “vesa”; but once I’d done that, I simply had to type the command:

startxfce4

… to get this:

Now that’s a proper GUI, complete with the Thunar file manager and a truly graphical terminal. Any Gnome or KDE user would, I think, feel rapidly at home here. But look at the disk usage figures on the root partition in that screenshot: we’re now using 1.2GB of disk space, which is quite a jump from the 677MB starting-point. It’s a lovely GUI environment, therefore… but it’s not exactly “lightweight”, not in the extreme sense meant in this article, anyway.

Option 3: The Best of Both Worlds

Happily, there’s no reason why you have to install the entire XFCE desktop environment just to get some of its nicer tools (like the Thunar file manager). If you do the Option 1 route I’ve described above, there’s nothing to stop you simply typing:

yum install thunar

A mere 13MB later and you’ll be able to run the very GUI file manager by issuing the command thunar in an x terminal session. Stick an ampersand on it (i.e., type thunar &) to make it run in the background, freeing your xterm for other work in the foreground.

And that’s pretty much the way I like my Red Hat/Centos/Scientific Linux boxes to run when I use them as an Oracle database server: minimal install, add in a couple of X-related packages, add twm, add Firefox, Thunar and redhat-lsb … done! That all takes up a mere 1.1GB, but makes a perfect platform on which to run Gladstone and then install Oracle.

There are other non-Gnome, non-KDE window managers, of course. Fluxbox is nice; icewm is attractive; ratpoison is ghastly in a 1970s pre-GUI way… but very, very functional. Not all are easy to install on Centos, since they’re not always in the standard repositories, but they’re all do-able with various degrees of difficulty. But I’ll settle for what I’ve described here: it means I can manage the servers when I have to, but know otherwise that nothing’s getting between my databases and my CPU cycles unnecessarily!

Gladstone and the new Fedora

Fedora 15 has been in beta for a while now (available here -make sure you get the x86_64 Install DVD, not any of the ‘Live CD’ downloads).

When I wrote the Gladstone Oracle preinstaller script, it was tested to work with Fedora 15 Alpha -but I’m happy to confirm that it works perfectly well with the beta, too.

One slight niggle is that Fedora 15 Beta uses the Gnome Shell desktop environment -and that means the desktop you see once logged in is not ‘live’. You can’t, for example, drag-and-drop a file onto it and see it appear as a desktop icon. You do still have a Desktop directory, and it can still have things in it… but visually you won’t be reminded that those files exist:

This is a simple example of what I’m talking about: the Nautilus file manager clearly shows three files and a directory are sitting in my Desktop directory, but nothing is actually showing on the blue stripey desktop itself (you’ll have to trust me that there’s nothing hiding underneath Nautilus, either!)

It’s actually a bit more than a niggle -it strikes me as a bloody stupid way of doing things, and I can only hope that the Gnome devs stop this sort of thing happening whilst they’re on the path to world desktop domination.

Anyway, in the meantime, it means that Gladstone can be a little trickier to run on Fedora 15 Beta than it should be, if you are using it to prepare for an Oracle 11g Release 2 installation. That’s because Fedora still suffers from an ‘error in invoking target’ compilation error during the eventual 11g installation -and Gladstone deals with that by creating a short bash script ahead of time. When you encounter the linking error, you just double-click the ‘fixing script’ and let it run (it takes seconds only), after which you can click ‘Retry’ back in the Oracle installation process, and all will be well.

Except that now, of course, you can’t actually see that a ‘fix me up’ script has been created for you, because Gladstone thoughtfully writes it out to…. the Desktop! If you can’t see it, you tend not to know to double-click it -and that means you’re stuck with a flakey Oracle installation process left hanging!

All I can really do at this point is lament the tide of so-called “progress” in the development of a desktop Linux and encourage any Fedora users trying to install Oracle 11gR2 via Gladstone: do what I’ve done in that screenshot above. Open your Desktop folder in Nautilus before you launch the Oracle installer so that you can double-click the fedora-linking-error-fix.sh shell script when you encounter the agent linking error.

Updated Gladstone for Centos users

I missed the precise release date of Centos 5.6 and I’ve recently spent a fortnight touring Tasmania (thoroughly recommended if you get the chance!), so I’m even more behind than usual.

It’s not a particularly exciting release -hardly anything has really changed much compared with version 5.5 (as the numbering might lead you to expect, I suppose). But my original Gladstone Oracle Preinstallation script won’t run on it because it checks the OS self-identification strings, which have changed.

Happily, however, I’ve finally gotten around to revising Gladstone so he takes account of the new release. Both 10gR2 and 11gR2 install without drama once Gladstone’s done his stuff.

Additionally, if you click on that link, you’ll note that it’s pointing to a Google Docs repository… my original choice of file host turned out to have a penchant for pop-ups, pop-unders, adverts galore and other faintly unsavoury web practices.

(Update August 1st 2011: all downloadable files are now stored on a Dropbox public repository. Google Docs suddenly stopped being shareable in quite the way I needed it to be.)

Gladstone – An Oracle installation script

I only have twenty-nine 150GB-plus databases to manage these days, and most of those are running on servers with uptimes in excess of a year (it would have been longer, but I only got them to switch to Linux about 13 months ago). I don’t, therefore, tend to do a lot of Oracle installations these days -and my automated pre-installation configuration shell script which used to make the job fairly easy has therefore languished of late.

That automated script initially went by the name of ‘Doris‘ (for “Dizwell/Oracle Reliable Installation Script”), a name which appears to have stuck in some quarters.

About a year after Doris appeared, I re-wrote it (and updated it) to use Gnome GUI pop-ups and other interactive elements and accordingly re-named it ‘GOAL‘ (for “Graphical Oracle All-in-one Loader”).

Now, I’ve re-written the script one more time. Call it Doris 2 or GOAL 2, if you like. Me? I’m calling it Gladstone for no reason whatsoever except that half of Diznix’s name comes from Disraeli, so it’s only fair to remember the other fella from time to time!

I thought it might be worth mentioning a couple of Gladstone’s key design features here:

Gladstone deals with modern distros and has been run successfully on:

Note that if a distro supplies a “Live CD” and a much larger DVD installation ISO, it is the DVD ISO version that will work. The Live CD version will (probably) be missing quite a lot of files and libraries that Gladstone expects to be there, because they are there when a full-blown DVD ISO is used for the Operating System install. Specifically, do not use the Live CD versions of Fedora, Centos or Scientific Linux and expect Gladstone to work. Similarly, do not use the Server Edition of Ubuntu… Gladstone’s been designed for, and tested on, the Desktop Edition only.

Gladstone only prepares your distro for the installation of 10g Release 2 or 11g Release 2… code to do an 11g Release 1 installation, for example, has been dropped. The reasoning there is that those are the only two still-supported Oracle releases (though obviously support is not provided by Oracle at all if you’re doing home installations onto the likes of Debian anyway!). Putting it another way: you’d be certifiably insane (IMNHO) to consider installing any other Oracle version these days, so I’m not going to waste time coding for something that isn’t worth doing!

For all tested distros, both Oracle releases eventually install successfully, though nearly all 10g installations run into the “Error in invoking target ‘collector’ of makefile ‘/srv/oracle/product/10.2/db_1/sysman/lib/ins_emdb.mk’” error during the Oracle installation linking phase. This is a non-fatal error that can be ignored without apparent harm to any substantial bit of Oracle RDBMS functionality.

Nearly all 11g installations are flawless on all tested distros. Two distros (Fedora and Linux Mint Debian Edition) require an additional workaround for which a shell script is created by Gladstone. Run that additional script when you get linking errors during the main Oracle installation and you’ll be able to click ‘Retry’ and continue to a successful conclusion.

Gladstone was written with the idea of allowing myself to become the oracle user, rather than merely creating a new user as is traditional. By default, you are still prompted to supply a new account name (and if you just press enter, you get a new one called ‘oracle’), but if you type your own username in (or that of any existing user, come to that), that account will be re-configured to make it suitable for Oracle installation ownership. This is definitely a ‘non-standard’ way of doing things, but suits me and my desktop (and laptop) PCs just fine. Your mileage might well vary, of course, and all the usual disclaimers apply!

Some people never liked Doris or GOAL… they thought it wasn’t very original and would break Oracle support if done on a production box. Well, Gladstone isn’t very original either, since what it does is only what’s documented as needing to be done prior to an Oracle installation (though because you’re not having to do all the typing, it’s likely to get it more correct than you might manage on your own -which is the whole point, of course!) And the issue of support is moot, anyway -because the thing simply can’t be run (as it stands and by design) on a distro for which Oracle offers any support!

Anyway, take it or leave it. If you take it and find that you encounter errors or issues, let me know here and I’ll see what can be done, if anything, to fix it for others. I’ll have detailed notes for each supported distro in due course.

Google be Praised

I don’t think I’d be spilling any trade secrets if I said that whenever I go searching for Oracle tips/workarounds, I am always bound to find links to utterly useless results at Experts Exchange and any of the bazillion domains hosted by Don Burleson.

There have been browser extensions you could install to block things from the Google results pages by domain, but they’ve always been something you had to remember to install -and if you changed browsers, you were potentially back at step 1.

Today, Google have announced a game-changer: an option to block an entire domain from their search results, merely by clicking a link! Brilliant!

For example, if you’re doing an Oracle installation and come across the all_no_orcl linking error, you’ll do a search and end up with results like these:

The first two results there are from different domains owned and run by Don Burleson. If you think, as I do, that it would be useful to remove those two domains from any future search for reliable technical information about Oracle, you can now just click the Block dba-oracle.com and Block dbaforums.org links now helpfully included in the search results above. You’ll get a little ‘cloud puff’ animation as that particular domain disappears into thin air!

If you ever do the same search again, this time those blocked sites won’t appear in the results:

Now, the Oracle forums are the first results listed.

This feature works in all the major browsers (IE8, Chrome, Firefox), though I’m not sure it’s working reliably in Australia yet. It also, unfortunately, requires you to first visit a site on the domain you want to block and then to back-click to the original search results page. Only then does the ‘block’ link appear.

Currently, Google promises that the new feature won’t actually alter the Page Rank for any domain that gets blocked, but that might happen in the future.

At the bottom of any future search results page, you’ll see a count of how many links to blocked sites have been suppressed, along with an option to display them anyway. There’s also a management link, so you can unblock domains should you decide to:



All this means that you can make search results less full of stuff you know from bitter experience is likely to be a waste of time or, worse, downright misleading -and that’s a great thing to be able to do.

(Incidentally, if you want to stick to managing your own blocks using extensions, the plugins are still available: Personal Block List for Chrome and OptimizeGoogle for Firefox).

First Saturday of the Month

Trivial, really, but I needed to run a database procedure if it was the first and third Saturdays of the month. Oracle’s date functions are not something I’ve ever really enjoyed using much, so this is to save me from having to work it all out again from scratch in the future!

Here’s how you get the first Saturday of any given month:

select next_day(trunc(to_date('13/10/2011','DD/MM/YYYY'),'MM')-1,'sat') from dual;

And to get the third Saturday? Easy: just add 14 to the above:

select next_day(trunc(to_date('13/10/2011','DD/MM/YYYY'),'MM')-1,'sat')+14 from dual;

Instead of all that “to_date(’13/10/2011′,’DD/MM/YYYY’)” gumph in there, of course, I will get my procedure to simply refer to the current server date:

select next_day(trunc(sysdate,'MM')-1,'sat')+14 from dual;

It works because:

  • trunc(sysdate,’MM’) always returns the first day of the current month. So…
  • trunc(sysdate,’MM’)-1 returns the last day of the month before this one. And…
  • next_day(last-day-of-previous-month,’name-of-day’) will therefore give you the date of the first named day after the last day of the previous month. Which, in English, as the same thing as ‘first X of the current month’.
  • ‘name-of-day’ can be any of the day-name standard abbreviations (so, in English, ‘mon’, ‘tue’, ‘wed’, ‘thu’, ‘fri’, ‘sat’, ‘sun’), although full names will also work (so ‘monday’ works as well as ‘mon’, for example).

Straightforward enough if you’re blessed with a good memory, I suppose. If only I were!!

Oracle 11g Network Access Control Lists

This has tripped me up a couple of times, so it’s time to document the workaround!

In 10g, you might have written a bit of PL/SQL that invokes the package utl_smtp so that the database sends you an email about something -and, although the code would definitely have ended up quite ugly (utl_smtp is like that!), it would have been entirely functional. Upgrade to 11g, however, and that same code will now error out with an ORA-24247 network access denied by access control list (ACL) message. Utl_smtp is not the only package affected, either: utl_http, utl_tcp, utl_mail and utl_inaddr are all similarly affected. If you wrote code that referenced any of these packages, it would break in 11g having worked fine in 10g.

The reason for the breakages is that 11g introduced tighter security on access to all networking services and this security is enforced by Access Control Lists (ACLs). The ACL-based security works independently of package grants… so although a user might have execute permissions on utl_smtp, if he doesn’t also have an ACL allowing him access to the smtp networking service, he’s not going to be sending emails anywhere.

In the right context, this extra security is a great thing… but in the context I work in, it’s a royal pain in the butt! I just want my old code to work -and I don’t want to have to do battle with another layer of user privilege management to get it to do so.

Here, then, is the “can we please pretend we’re running in 10g again” fix. It blows the whole ACL idea out of the water by simply creating an ACL that says everyone can access every networking service, no questions asked. Run it as SYS:

begin
dbms_network_acl_admin.create_acl (
   acl          => 'networkacl.xml',
   description  => 'Allow Network Connectivity',
   principal    => 'PUBLIC',
   is_grant     => TRUE,
   privilege    => 'connect',
   start_date   => SYSTIMESTAMP,
   end_date     => NULL);

dbms_network_acl_admin.assign_acl (
   acl         => 'networkacl.xml',
   host        => '*',
   lower_port  => NULL,
   upper_port  => NULL);

commit;
end;

The first bit of code simply creates an ACL and grants rights to it to PUBLIC. The second bit says that the ACL just created doesn’t restrict hosts or port ranges (which effectively means it’s restricting stuff-all). Your old 10g code will now run just fine in 11g once more.

Obviously, this isn’t subtle and there are good reasons why Oracle tightened up the security surrounding access to these networking services… which my code simply ignores and pretends aren’t an issue. So this is not exactly “world’s best practice”! But in the right situation (basically, one where you are in a hurry to have things behave as they did in 10g and never mind the implications), then this code will do the trick.