Oracle SQLPlus / Unix Shell Script interaction

Sometimes you need interaction between between sqlplus and unix shell scripts, like passing some shell variables to sqlplus or executing shell scripts based on the output of an SQL-Select statement.

I used the following demo table:

[frank@w0004 ~]$ sqlplus /nolog
SQL> connect foo/bar
SQL> create table foobar (line varchar2(20));
SQL> insert into foobar values('test1');
SQL> insert into foobar values('test2');
SQL> insert into foobar values('test3');
SQL> commit;

And here comes the shell script I used:

#!/bin/bash
username=foo
password=bar

sqlplus -s /nolog << EOF | grep -v 'Connected' > tmpout.txt
set pagesize 0 feedback off verify off head off echo off
connect $username/$password
whenever sqlerror exit 1
select line from foobar;
exit;
EOF

if [ -f tmpout2 ]; then 
  rm tmpout2.txt 
fi

for i in `cat tmpout.txt`; do
sqlplus -s /nolog << EOF | grep -v 'Connected' >> tmpout2.txt
set pagesize 0 feedback off verify off head off echo off
connect $username/$password
whenever sqlerror exit 1
select * from foobar where line = '$i';
exit;
EOF
echo $i "row";
done

Cyrus 2.3.8 and Thunderbird 2.0 ACL Problem

I am currently moving my IT infrastructure to a new server. That included also an switch to Cyrus IMAP 2.3.8 - which comes with Fedora Core 6. After an smooth and short move I have seen - so far - on problem in combination with Thunderbird 2.0. I could move mails to the trash, but all "Delete Mail" buttons are disabled. :-(

It turned out that Cyrus 2.3.8 has a few more ACLs and to resolve that issue I had to add those ACLs to my mailboxes. You have a lot of users with many mailboxes? Jo Rhett has posted a short Perl-Script on the info-cyrus maillinglist http://lists.andrew.cmu.edu/pipermail/info-cyrus/2007-April/025878.html.

VMware Server under FC6 Kernel 2.6.19

Sometimes the Linux Kernel can be a little bit painful in my opinion. Just tried to compile the VMware Server Kernel Modules under 2.6.19 and got:

make[1]: Entering directory `/usr/src/kernels/2.6.19-1.2911.6.5.fc6-i686'
  CC [M]  /tmp/vmware-config0/vmnet-only/driver.o
  CC [M]  /tmp/vmware-config0/vmnet-only/hub.o
  CC [M]  /tmp/vmware-config0/vmnet-only/userif.o
/tmp/vmware-config0/vmnet-only/userif.c: In function ‘VNetCopyDatagramToUser’:
/tmp/vmware-config0/vmnet-only/userif.c:629: error: ‘CHECKSUM_HW’ undeclared 
(first use in this function)
/tmp/vmware-config0/vmnet-only/userif.c:629: error: (Each undeclared identifier is 
reported only once
/tmp/vmware-config0/vmnet-only/userif.c:629: error: for each function it appears in.)
make[2]: *** [/tmp/vmware-config0/vmnet-only/userif.o] Error 1
make[1]: *** [_module_/tmp/vmware-config0/vmnet-only] Error 2

If you search for the error message in google you can already find some patches for the VMware Kernel Modules. But I preferred to get it working manually...

I added CHECKSUM_HW to /lib/modules/2.6.19-1.2911.6.5.fc6/build/include/linux/skbuff.h:


#define CHECKSUM_NONE 0
#define CHECKSUM_PARTIAL 1
#define CHECKSUM_HW 1
#define CHECKSUM_UNNECESSARY 2
#define CHECKSUM_COMPLETE 3

Since config.h is missing as well, I gave config.h an touch as well:

touch /lib/modules/2.6.19-1.2911.6.5.fc6/build/include/linux/config.h

Now the Kernel Modules compile and VMware Server is up and running :-D

FC6, iSCSI + Oracle RAC and 23C3 -- new stuff for the cold days

Wuff, the year 2006 nearly finished with the speed of light. But there is still one month left with a lot of new stuff to check out.

Last week I upgraded my notebook from Fedora Core 5 to Fedora Core 6. Hey! Everything worked without a problem. Just the usual update of the fedora-release-6-4.noarch.rpm package followed by yum upgrade and I am on FC6...

There are two new OTN articles about iSCSI and Oracle RAC. The first one "Setting Up an Inexpensive iSCSI Linux Cluster Using SLES10 and OCFS2" is from Mark Fasheh and Todd Trichler. The Paper is quite short and only describes how to get the storage part working. This article is also included in the "How-To's" section on the "Download OTN's Greatest Hits CD". The second article "Build Your Own Oracle RAC 10g Release 2 Cluster on Linux and iSCSI" from Jeffrey Hunter includes an complete work through from OS installation to the RAC setup.

Finally the "Fahrplan"/Agenda of the 23C3 conference in Berlin got released too. That is definitely something you should check out...

First Install of Oracle Enterprise Linux

Just finished the download and installation of Oracle Enterprise Linux. As already stated in the news it is essentially Red Hat Enterprise Linux 4.

I hoped for a little bit more customization towards data center or Oracle database installations. Not even the default screen for the firewall or SELinux settings includes some Oracle specific things like port 1521:

Well, but they include some RPMs for ASM (Automatic Storage Management) I could not find on my latest Centos 4.4 DVD:

Disc3:
glade2-2.6.0-1.oracle.i386.rpm
oracleasm-2.6.9-42.0.0.0.1.EL-2.0.3-2.i686.rpm
oracleasm-2.6.9-42.0.0.0.1.ELhugemem-2.0.3-2.i686.rpm
oracleasm-2.6.9-42.0.0.0.1.ELsmp-2.0.3-2.i686.rpm
oracleasm-support-2.0.3-2.i386.rpm

If you want to learn more: