Monday, October 30

rlwrap for rhel / centos / unbreakable

Just buil a new RPM file for rlwrap 0.26 for Centos 4, Redhat 4 and Oracle Unbreakable Linux. I've added my (very) basic sqlplus auto complete file.

If you are not familiar with rlwrap but use Oracle on Linux/Unix you should definatly have a look. rlwrap provides basic "bash style" command line editing in sqlplus (and other command line tools), you get command history with working arrow keys and normal command line editing.

Download 32-bit version: rlwrap-hali-0.26-1.i386.rpm
Download 64-bit version: rlwrap-hali-0.26-1.x86_64.rpm

Sunday, October 29

Running Oracle Unbreakable Linux under VMWare

I finally got around to do a proper install of Unbreakable Linux today.
Pretty much as expect, it's pretty much identical to CentOS. It's got yum and all that.

Took the opertunity to try the new free version of VMWare GSX Server, or at least what used to be known as GSX. They just call it VMWare server now.
The VMware tgz install on my 64-bit Ubuntu 6.10 was quite smooth. You still have to enter a serial, easily obtained from filling out a simple form on the vmware website. The installation of vmware-authd failed though. Since Ubuntu's xinetd doesn't read /etc/inetd.conf I had to create an entry in /etc/xinet.d/.
hlinden@htpc:~$ cat /etc/xinetd.d/vmware
service vmware
disable = no
socket_type = stream
protocol = tcp
user = root
wait = no
user = root
server = /usr/sbin/vmware-authd
port = 902
Speed wise VMWare server is great, I only allocated 384Mb RAM to the VM and it still feels quite snappy and fast. I've only tried running two VM's at the same time so far. But my first impressions are simply, great stuff! The VM creation wizard thingy even had Solaris x86 in the list, haven't tried it yet but I sure will.

Took a few screenshots during the Unbreakable Linux installation.

Wednesday, October 25

Oracle Unbreakable Linux

Ok, so Oracle is doing "a CentOS".
Oracle is taking the Redhat Enterprise Linux source code, removing all the trademarks, logos and references to Redhat and recompiling it with the Unbreakable Linux label. If there are any bugs found and redhat don't fix them fast enough (at all?) Oracle will take care of that and guarantee all bugs will be fixed and backported to all versions of Unbreakable Linux.
Sounds pretty good to me, especially when you look at the support cost model.

The basic support contract "network level" gives you access to patches via Oracles up2date equivalent. And the cost is a mear $99 per year per system.
If you want enterprise support you get that for a couple of hundred more.
If you want premium support you get that for about $1399 per year, you can't even get that support level from Redhat.
The full support policy can be found here.
And... even better... support contract are 50% off for the first few months (although I still haven't found where you can actually buy them).

Read more. Take a few minutes (about 60) to watch Larrys keynote, quite interesting.

Download ISO images, free for all.

Monday, October 23

Dell AMD Opteron servers

We've known about this for quite some time, I think I heard the first rumors last November and we saw new AMD desktop machines from Dell about a month ago.
And now we have to new shiny Opteron Socket-F machines. They all run Linux of course.

First the anticipated Dell PowerEdge SC1435. A nice little box, as I've said before, the rack mounts in the SC series just get things done. I do think the price tag at around $3000 USD is a bit high. That'll probably drop quite a lot if you haggle with Dell and buy them in bulk. It is a perfect JBoss server, deployed in a nice farm of course, or it would make a very nice HPC node.
Now if just Dell would send me a few of these to test, they could use a bit of blogger hype. :)

The second new box looks even more interesting,
the Dell PowerEdge 6950.
A four socket machine with up to 8 cores and 64 Gigs of memory. On par with the HP DL585 and sort of a "half size" machine compared to the Sun X4600. I wonder which box packs the best bang for buck, but thats for another post. But a similar speced X4600 cost about twice as much, but on the other hand you get the extra scalability and future proof CPU cards instead of on-board socket-f.
The PE 6950 takes 5 internal SAS disks and has got 7 (free) PCIe slots.
Thats quite a lot of I/O for more NIC's and HBA's, do I dare to say this makes a very nice RAC node. Probably one of the top players in the area, team it up with a decent SAN and you are in business.
Starting price is not bad, not bad at all. An entry-level machine comes in at around $10000 USD.

See the product videos over at direct2dell.


Saturday, October 21

Oracle 10gR2 on Ubuntu 6.10 AMD64

I just finished installing Oracle 10gR2 on my Intel Core2 Ubuntu 6.10 machine running in x86_64 (AMD64) mode. The installation is fairly straight forward with a few gotchas. In comparison to CentOS/Redhat, Ubuntu 6.10 has got much more native 64-bit libraries, pretty much everything is actually 64-bit. Under Redhat most libraries are 32-bit. And the Oracle Universal Installer (OUI) uses a 32-bit Java runtime so hence we have to install a few i386 compatability libraries to get it working.

First of all make sure your machines hostname resolves to your external IP and not the loopback IP (
Double check using this command
$ grep $(hostname) /etc/hosts htpc
If you see just edit the hosts file to have the external IP.

Now you need to install a few compat libraries and 32-bit libraries.
sudo apt-get install gcc libaio1 lesstif2 
lesstif2-dev make libc6 libstdc++5 \
lib32stdc++6 lib32z1 ia32-libs
This will probably cascade in to quite a few packages depending on how much you have installed, be patient and let it download everything it needs. The extra ia32 libraries is probably the biggest change to the old 32-bit installation.

Edit /etc/sysctl.conf to have the kernel parameters required by Oracle (I've added a few extras here as well to avoid unecessery swapping).
Add these lines:
# Oracle stuff
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
Create the oracle user and required groups (you don't really need the nobody group, it's only used by to be the group owning the oraenv and dbhome scripts).
sudo groupadd nobody
sudo groupadd oinstall
sudo groupadd dba
sudo useradd -s /bin/bash -g oinstall -G dba oracle
sudo passwd oracle

Increase system limits by adding these lines to /etc/security/limits.conf:
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
To avoid the non-redhat warnings during the prereqs run this command:
echo 3 > /etc/redhat-release
Add a few symlinks to avoid any script problems:
sudo ln -s /usr/bin/awk /bin/awk
sudo ln -s /bin/true /bin/rpm
sudo ln -s /usr/bin/basename /bin/basename
sudo ln -s /lib/ /lib/
sudo mkdir -p /u01/oracle/10g
sudo chown -R oracle:oinstall /u01/oracle/10g
sudo chmod -R 775 /u01/oracle
Time to run the installer, make sure you are allowed to use the X11 server (export DISPLAY, xhost, vnc whatever).
To get the 32-bit JRE to work you need to set the XLOCALELIBDIR before running the installer:
export XLOCALELIBDIR=/usr/lib32/X11/locale
cd /your/install/dir
I just ran the defaults straight through (except the SID name and password). The installation without any warnings or errors. The linker worked fine and everything was configure properly, dbca created the standard database.
oracle@htpc:~$ uname -a
Linux htpc 2.6.17-10-generic #2 SMP Fri Oct 13 15:34:39 UTC 2006 x86_64 GNU/Linux
oracle@htpc:~$ rsqlplus / as sysdba

SQL*Plus: Release - Production on Sat Oct 21 20:13:45 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> select platform_name from v$database;

Linux 64-bit for AMD


This guide is based on the Oracle 10gR2 x64_64 installation guide and I've also used Dizwells excellent Ubuntu 6.06 32-bit guide for some ubuntu specific notes. Thanks.

Cool, now I can alt-tab between sqlplus and my latest Prison Break episodes on the TV . :)

Friday, October 20

Funny temporary table behavior in Postgres

Was playing around with temporary tables in PostgreSQL and found this quite weird behavior.
When you have a table called say animal and create a new temporary table with the same name postgres is totally ok with the "duplicate" name. Since the temporary table ends up in a different schema I presume. Anyway, it was quite confusing before I figured out what was going on.
It's the same both in 8.1 and 8.2beta. Not sure if it to be expected, a oversight from my side or simply a "bug".

[postgres@dolphin ~]$ psql
Welcome to psql 8.2beta1, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

postgres=# create user test password 'test';
postgres=# create database testdb owner test template template0;
postgres=# \c testdb test
You are now connected to database "testdb".
testdb=> create table animal (dog int);
testdb=> \d
List of relations
Schema | Name | Type | Owner
public | animal | table | test
(1 row)

testdb=> \d animal
Table "public.animal"
Column | Type | Modifiers
dog | integer |

testdb=> create temporary table animal (cat int);
testdb=> \d
List of relations
Schema | Name | Type | Owner
pg_temp_1 | animal | table | test
(1 row)

testdb=> \d animal
Table "pg_temp_1.animal"
Column | Type | Modifiers
cat | integer |

testdb=> drop table animal;
testdb=> \d animal
Table "public.animal"
Column | Type | Modifiers
dog | integer |


Tuesday, October 17

SQL challange #1

Ok, time for a little competition. Myself and Lukas Smith where helping a user with an at first very simple SQL problem. But after a few minutes we wouldn't find a "nice" way to solve it.

So here is the problem:
1, 2
2, 1
3, 4
3, 6
4, 3
6, 3
And the output from the query we want is:

All rows with a matching sister "a=b" relation should be "merged".

Lukas found one quite good way using exists in a self-join.

Any RDBMS goes, ANSI SQL is an advantage but not necessary. Analytics perhaps?
Nicest/fastest/cleanest query wins. Post any questions as comments.
E-mail me or post your solution as a comment to this blog.

See Lukas' invite to the challenge. :)

Thanks and good luck!

Saturday, October 14

Running Ubuntu 6.10 on Abit AB9

Playing around with my new media center PC at the moment.
Ubuntu 6.10 Edgy (daily build from Oct 13th) installed without too many problems yesterday, most of the hardware on my Abit AB9 pro motherboard was detected out of the box.
However the ethernet controller, a Realtek 8111B, card was not detected.
From lspci I got Realtek Semiconductor Co., Ltd. Unknown device 8168 (rev 01) and after a quick look in google I found this article on how to get the card working. Worked great, just download, change the three MODULE_PARM lines in the src to MODULE_PARM_DESC and it compiles ok.

A few notes on installing Linux on the AB9 motherboard though, a few thought from my experience. First of all, use a very recent version of Linux. Ubuntu 6.10 worked for me and I'd expect Fedora Core 6 would work.
Use the jmicron controller, not the ICH8R controller for the disk and optical drive.

Another thing, which I think is just related to me not having used debian/ubuntu enough. After I partitioned my disk and create ext3 file systems using labels I was unable to mount using LABEL=foo, turns out I had to restart the udev service before they showed up. In CentOS, they just appear under the dev-mapper.

I'm quite impressed on how good it looks on my LCD television. Even xvid files in HDTV resolution look great.

Friday, October 6

Blog design updates

Joined the blogger beta program yesterday which allowed me to do a few cool updates to the template of the blog.
Note the "Latest Oracle downloads" RSS-feed and the labels amongst other things.

Thursday, October 5

Media Center 10g

I'm currently shopping around for a combined media center PC / Oracle test box, must be the first time someone tried to combine those two in one box. And the first time someone plan to hook up a Oracle server to a television set. But they, there is a first for everything.
Currently looking at the new Intel Core2 processors. The 2.13GHz E6400 seems to be the best value for money. I wouldn't mind the E6600 with 4Mb cache, but the extra £67 can probably be spent on something that adds more value to the system, like an extra SATA disk to distribute the IO load. Not sure if AMD AM2 processors are a valid option anymore? The new Intel 965/975 chipsets are probably not supported in Solaristhough, where as a Nforce chipset probably works gret.
Found a quite decent looking case for the system as well, the Silverstone LC17.
I'll post a photo of sqlplus on a 32" LCD television once I buy the system. :-)

Tuesday, October 3

Dell 9th generation servers

Quick overview of Dells 9th generations rack-mount server line up

It's been a couple of months now since Dell introduced the first machines in the new "9th generation" server line-up, the PowerEdge 1950, 2950, 2900 and the Blade 1955 all looked like quite nice machines, they can be fitted with the new DRAC/5 card and onboard PERC.
And they have recently been accompanied by slightly simpler (and more cost effective) SC1435 and the baby 860.

All machines use the new generation Intel processors (64-bit), FB-DIMM memory and SAS and/or SATA disk drives.
I'm not going to go on about products specs and other sales crap, you can find all that on the Dell website. Just my view on the machines and what they are suitable for. Everything from using Linux as the OS on the box. Solaris 10 is currently not confirmed as working, using 06/06 you still need a driver disk for the PERC card and ethernet is unsupported so you need a addon Intel PCI card to even make use of the server.

Dell PowerEdge 1950
Nice 1U pizza box machine. I would use this as an application or web server, if you equip it with the 4 2.5" disk backplane you could possibly have a very small database on it. Disk I/O is very likely to be a bottle neck though. Hooking it up to a SAN is another option. Good layout of the internal components and the back connectors are easy to access. The PCIe slots are a bit limited in lenght, but then again there aren't many long cards available any more (anyone remember the old full lenght PCI raid cards?). Quite redundant with dual "most things".
To summarize, a perfect box for a Apache HTTPd or Java app server.
Starting price in a usable spec: $3437

Dell PowerEdge 2950
Pretty much the same machine as the 1950 but with more I/O. Six 3.5" drives or eight 2.5" drives. Decent small office file server, takes 1.8Tb internally (3Tb if you go SATA), room for extra Ethernet cards if you want to run iSCSI. Would also be a good "all in all" intranet server, put Postgres, PHP, Postifx and few other things on it. Or install a Zimbra and use it as a e-mail server.
Slap 8 2.5" drives in it and it is a nice decent DB server. If you team up a group of these and hook them up to a SAN they make great RAC-nodes. As the 1950 it is fairly redundant and can be trusted to work by itself for non-critical things.
Starting price in a usable spec: $3757

Dell PowerEdge 2900
Not really a rack-mount box but it does come with a rackmount kit. Only included here as it is the only "one box solution" for larger installations such as a Oracle EE, mid-sized file server or even a large e-mail server. Takes up to 10 internal drives (8 + 2 cage), thats 3Tb with current SAS drives. Lots of PCIe I/O, six slots for HBAs and NICs. If you like virtualization it would make a great VMWare box, it takes an impressive 48Gb RAM (you don't want to see the price tag for this though).
5U in a rack though, I hope you're not paying per U if you colocate it.
Starting price in a usable spec: $4370

Dell PowerEdge 860
This one I don't really understand. First of all, who came up with the name 860, it is clearly a 950. Second of all I don't really get where this box is meant to be used, the SC1435 is a better choice in 90% of all cases. The only advantage over the SC1435 is the fact that it has the normal kick ass DRAC/5 card as an option. It takes Celeron, Pentium D and Xeon 3000 series processors, I really *really* recommend against using a Celeron proc in anything that goes in a rack.
Possible uses (if I have to) would be a DNS server, mail relay, basic web server or management server.
Starting price in a usable spec: $1391

Dell PowerEdge SC1435
This little guy is not officially out yet, should be available in the comming weeks. The tower equivalent SC1430 is currently available though. I must admit that this is probably one of my favorites in the line-up, not because it's a great flexible, highly redundant machine. But simply because it's cheap and gets the job done! No hot swap anything. This is probably the perfect app or web server for larger load balanced solutions. This is however an AMD Opteron Socket-F server, not a Intel as the other. Quite confusing to be honest. I would have hoped that Dell launched a completely new line for the opteron gear.
I would not consider this box unless I was installing at least 4 (or possibly even 6) nodes for a single deployment. If they fail, you'll have a longer down time period than most other boxes since you probably have to get it out of the rack to service it. But it's cheap and just get things done. I can imagine many high performance computing farms rubbing their hands when they see this box, it's very suitable for a Linux beowulf cluster.
You can read my review of the older SC1425.
Starting price in a usable spec: $2900 (estimated)

Dell PowerEdge 1955
The Blade server in the new family. Data processing, web servers, app servers and possibly other uses if you add the FC daughter card. Quite decent machines and as a 1855 admin I'm very pleased so far.
One thing to remember though, the 1955/1855 chassis backplane is not redunant, deploy in groups of two chassis and at least 8 servers to make them cost effective. Price excluding chassis, which usually comes in at about $3000 with redundant PSU's, DRAC, IP-KVM and a pair of switch modules.
Starting price in usable spec: $2516

Regarding the price, the starting list price on Dells website is unusable. One disk drive included, way to little RAM, no DRAC card etc. All machines have been speced out to a suitable minimal config for actuall deployment use with redundant PSU's, a PERC card, at least 2Gb RAM etc and Bronze NBD support. The size and usage of the box has also been considered, as an example the 2900 was fitted with six drives since it's main purpose is disk and I/O expandability.

For Solaris 10 support see this post.

Sunday, October 1

PostgreSQL 8.2 hits beta

PostgreSQL 8.2 hit beta other day.
Just installed it in a Solaris zone on my laptop (you need a fairly recent Solaris Express release to use the a dtrace [pdf] functionallity).
A few new cool features.

  • dtrace support in Solaris
  • Warm standby server support
  • CREATE INDEX without locking the table
  • Improved syntax of the config file, support for SI units (kilobyte, megabyte, hour etc)
  • Basic support for SQL 2003 analytical functions (I couldn't find any docs about this).
  • Faster vacuuming
  • Improved WAL and log management

Quite a lot of exciting stuff. Analytics could be fun and the speedups in WAL and logging could make a improvement for write intense operations, an area where postgres have been quite slowish in the past.

Full list and downloads here. Cool.