Twitter Updates

    follow me on Twitter

    G-AVLN in front of her home

    G-AVLN in front of her home

    Mostly Unix and Linux topics. But flying might get a mention too.

    Friday, October 28, 2005

    Ingres 3 - part 2

    Well, now that the software appears fully installed and configured, the daemons all hovering in the background waiting to spring to life, time to put some data in, and see if one can ever see it again ;-)

    Logged in as user ingres, and off we go:

    [ingres@fedora4 ~]$ createdb newone
    Creating database 'newone' . . .
    Creating DBMS System Catalogs . . .
    Modifying DBMS System Catalogs . . .
    Creating Standard Catalog Interface . . .
    Creating Front-end System Catalogs . . .
    Creation of database 'newone' completed successfully.
    So far so good, now have a go at creating then selecting some data:

    [ingres@fedora4 ~]$ sql newone
    INGRES TERMINAL MONITOR Copyright 2005 Computer Associates Intl, Inc.
    Ingres Linux Version II 3.0.2 (int.lnx/105) login
    Fri Oct 21 09:49:07 2005

    continue
    * create table t1 (col1 char(20));
    * insert into t1 values ('hello world');
    * select * from t1
    * \g
    Executing . . .
    (1 row)

    ┌────────────────────┐
    │col1 │
    ├────────────────────┤
    │hello world │
    └────────────────────┘
    (1 row)
    continue
    * \q
    Your SQL statement(s) have been committed.
    Ingres Version II 3.0.2 (int.lnx/105) logout
    Fri Oct 21 09:52:46 2005

    So, what's the conclusion? Well, I'm very impressed.

    I suppose I will encounter some problems with the very installation I have just completed, as there are specific environmental settings, as well as kernel parameters that I did not investigate and adjust.

    Another important issue a chose to totally ignore is that of user identity when performing the download and installation. This should also have been identified and used correctly. However, what the above exercise proved, is that Ingres for Linux is fine, and can be used 'out of box'.

    Basic installation and configuration is simple - if the defaults are fine for you, that is!

    Friday, October 21, 2005

    Ingres 3 - part 1

    A customer of ours is planning an upgrade to Ingres3, whilst changing from Dynix to Linux at the same time. So I thought that I'd refresh my acquaintance with Ingres, since I haven't seen this version yet. I have had some experience of looking after a Linux system running Ingres, but this is the first time I'll be installing r3 myself.

    At this stage I'm not even sure that what I'm doing will work. This is going to be what I call a dry run - I'm going to play it by ear, following the installation steps intuitively, rather than following any particular set of instructions - so, the following steps should be taken more as a log of events, rather than a tutorial. I had a look at www.tldp.net , which does have an ingres HOWTO, but it is a really old one, and although most of the document might be OK, I decided not to risk it ;-). At least this way I will have to use some brain cells.

    You've been warned! To emphasize the point, here is a quote from the "Ingres r3 Getting Started" document (part of the downloaded documentation package):

    "Note: Make sure you thoroughly understand the issues regarding system resources, storage locations, and other configuration parameters before installing Ingres. If you are not sure, have someone more knowledgeable in these areas perform the following tasks."

    I have not even checked or tested that system requirements are good enough - here is the briefest of specs:
    I'm using Compaq nc6120, with 2G RAM, inside a VMWare virtual machine with Fedora Core 4.

    So, to the installation.

    Step 1 ================================================================
    Download the following files from CA site: http://opensource.ca.com/projects/ingres/

    ingres-3.0.2-105-pc-linux-i386.tgz
    ingresr3documentation.tar.gz

    You will need to register with CA first.

    Step 2 ================================================================
    Prepare for the installation: create 'infrastructure' and unpack the tarballs.

    # mkdir -p ingres/documentation

    Unpack the documentation. I chose to separate the documentation (PDF files) from the installation software.
    # cp ./ingresr3documentation.tar.gz ingres/documentation
    # (cd ingres/documentation; tar xzvf ingresr3documentation.tar.gz)

    Unpack the Ingres 3 software
    # cd ingres;
    # tar xzvf ingres-3.0.2-105-pc-linux-i386.tgz
    # cd ingres-3.0.2-105-pc-linux-i386

    Step 3 ================================================================
    Perform the installation

    Need to run the Licence scripts first, to accept the conditions. The main database installation script won't work until you do this one first. Trust me, I know this from experience ;-)

    # ./ingres-CATOSL

    Can now run the main Ingres 3 installation script.

    # ./*install
    INSTALL OUTPUT: Invoking RPM...
    INSTALL OUTPUT: Preparing... ################################ [100%]
    INSTALL OUTPUT: System user ingres has been created but no password has been set.
    INSTALL OUTPUT: Please set the password to enable login for this user.
    INSTALL OUTPUT: 1:ca-ingres ################################ [ 6%]
    INSTALL OUTPUT: II_INSTALLATION configured as II.
    INSTALL OUTPUT: 2:ca-ingres-dbms ################################ [ 12%]
    INSTALL OUTPUT: Setting up Ingres Intelligent DBMS, this may take some time...
    INSTALL OUTPUT: See /opt/CA/IngresII/ingres/files/install.log for more info.
    INSTALL OUTPUT: 3:ca-ingres-net ################################ [ 18%]
    INSTALL OUTPUT: Building the password validation program 'ingvalidpw'.
    INSTALL OUTPUT: Could not compile ingvalidpw: Using executable from the distribution instead.
    INSTALL OUTPUT: Executable successfully installed.
    INSTALL OUTPUT: 4:ca-ingres-qr_run ################################ [ 24%]
    INSTALL OUTPUT: 5:ca-ingres-abf ################################ [ 29%]
    INSTALL OUTPUT: 6:ca-ingres-c2audit ################################ [ 35%]
    INSTALL OUTPUT: 7:ca-ingres-das ################################ [ 41%]
    INSTALL OUTPUT: 8:ca-ingres-esql ################################ [ 47%]
    INSTALL OUTPUT: 9:ca-ingres-ice ################################ [ 53%]
    INSTALL OUTPUT: Setting up Ingres Web Deployment Option, this may take some time..
    INSTALL OUTPUT: See /opt/CA/IngresII/ingres/files/install.log for more info
    INSTALL OUTPUT: ngres release 3 has installed successfully.
    INSTALL OUTPUT: The instance will now be started...
    INSTALL OUTPUT:
    INSTALL OUTPUT: Starting Ingres, instance

    So, the following Ingres packages have been installed:

    # rpm -qa | grep ingres
    ca-ingres-net-3.0.2-105
    ca-ingres-das-3.0.2-105
    ca-ingres-odbc-3.0.2-105
    ca-ingres-tuxedo-3.0.2-105
    ca-ingres-CATOSL-3.0.2-105
    ca-ingres-dbms-3.0.2-105
    ca-ingres-qr_run-3.0.2-105
    ca-ingres-c2audit-3.0.2-105
    ca-ingres-esql-3.0.2-105
    ca-ingres-jdbc-3.0.2-105
    ca-ingres-ome-3.0.2-105
    ca-ingres-star-3.0.2-105
    ca-ingres-vision-3.0.2-105
    ca-ingres-3.0.2-105
    ca-ingres-abf-3.0.2-105
    ca-ingres-ice-3.0.2-105
    ca-ingres-rep-3.0.2-105
    ca-ingres-documentation-3.0.2-105


    Service 'rc' file has been installed:

    # ls -l /etc/init.d/ingres*
    -rwxr-xr-x 1 root root 7187 Oct 20 19:27 /etc/init.d/ingresII

    Indeed: the service list in the runlevel 5 lists the following:

    Ingres II name server (iigcn) - running
    Ingres II recovery server (dmfrcp) - running
    Ingres II DBMS server (iidbms) - 1 running
    Ingres II Star server (iistar) - 1 running
    Ingres II Net server (iigcc) - 1 running
    Ingres II Data Access server (iigcd) - 1 running
    Ingres II JDBC server (iijdbc) - not active
    Ingres II RMCMD process (rmcmd) - running
    Ingres II archiver process (dmfacp) - running

    And, sure enough, loads of Ingres processes are running:

    # ps -ef | grep ingres
    ingres 25691 1 0 19:34 pts/1 00:00:00 /opt/CA/IngresII/ingres/bin/iigcn II
    ingres 25805 1 0 19:34 pts/1 00:00:02 /opt/CA/IngresII/ingres/bin/iidbms recovery (dmfrcp) II
    ingres 25925 1 0 19:34 pts/1 00:00:01 /opt/CA/IngresII/ingres/bin/dmfacp II
    ingres 25935 1 0 19:34 pts/1 00:00:19 /opt/CA/IngresII/ingres/bin/iidbms dbms (default) II
    ingres 26079 1 0 19:34 pts/1 00:00:00 /opt/CA/IngresII/ingres/bin/iigcc II gcc
    ingres 26135 1 0 19:34 pts/1 00:00:00 /opt/CA/IngresII/ingres/bin/iigcd II gcd
    ingres 26189 1 0 19:34 pts/1 00:00:02 /opt/CA/IngresII/ingres/bin/iistar star (default) II
    ingres 26270 1 0 19:34 pts/1 00:00:02 /opt/CA/IngresII/ingres/bin/rmcmd II

    That's all for this posting - next time, I'll see if my common sense approach worked. Chances are that many settings, variables, locations (possibly even additional libraries, etc) will have to be tweaked, adjusted, added...

    Why am I so pessimistic? Well, it's just that it's been going too well so far! ;-)

    Commenting out a block of lines in a script

    Everybody knows of the '#' character as the character allowing to comment out lines that are not meant to be interpreted by the shell in a shell script.

    Well, how cumbersome and untidy it ends up sometimes! Imagine you have a block of code, perhaps a big for-do-done loop, or a complex if-elif-else-fi statement and you need to, temporarily, take it out of the script for some reason. Inserting hash in front of each line, and then removing it again when done with whatever test you wanted to conduct is just plain messy.

    Ok, you could argue that this can be done nicely in vi :

    First, identify line numbers with:

    :set nu

    Then:

    :10,30s/^/# /

    will insert the hash at the begining of line, on lines 10 through 30, but even this is long-winded, and if you are using another editor, then the method may not be available at all.

    The alternative is to use a combination of the 'do nothing' command: the colon command, and the 'here document'. Imagine the following construct:

    : <<>
    ....
    ....
    ....
    BLOCK-OF-LINES-COMMENTED-OUT

    You can easily move the two lines up and down the script, and isolate the blok of line you don't want to 'participate' at run time.

    How does it work? The colon command means 'do nothing', but generate exit status 0, success. The way we are using it here is: 'do nothing, and whilst doing this ;-) use stream of data provided as 'here document'. This embedded data is not not interpreted by the shell at run time, so it hides our code!

    Monday, October 17, 2005

    The case in date

    Tha date command, one of the eldest tools in Unix has got one quirk that escaped me all those years. As usual with these things, it was a delegate who pointed this out to me, with a wry smile.

    A bit of background first. If you need to extract hour and minutes from the date command, you'd probably use:

    $ date +%H:%M
    14:48

    The little 'inverted polish logic' (is that why they keep telling me these things? ;-) ) is if you try to use the AM/PM indicator, achieved with the 'p' options.

    Try the following:

    $ date +%H:%M\ %p
    14:49 PM

    Then try:

    $ date +%H:%M\ %P
    14:49 pm

    Don't know the background to this, but it does appear a deliberate tease ;-)

    Saturday, October 15, 2005

    Sunday, October 09, 2005

    Still the best kept secret?

    I'm amazed how many people are still not aware of what Linux is! And I don't mean any Fred (sorry to all Freds out there!) off the street. I mean IT professionals, who come and join our UNIX classes. OK, so it was a Unix Fundamentals I'm referring to in particular; but even then, I would expect a bit more appreciation of the players in the industry.

    We give away a Knoppix disk on our UNIX/Linux courses. Frequently people ask - "what's that?". In itself, this is not an unexpected question, after all Knoppix is not a distribution talked about in board rooms. But when I answer: "it's a distribution of Linux, which...." and I still get a follow up "what's that?", then I do despair!

    Blog Archive