Skip navigation

See for all your houst0n waresūüėČ

My poor forgotten little blog. I will post something cool soonūüôā

I have my reasons for this…

Now that sun have killed SXCE and in doing so probably the future of the Solaris platform, I’m undoubtedly going to need a opensolaris box to play with..

So … As perverse as it sounds, we’re going to poke and prod opensolaris in some hopefully not too unfamiliar ways, and try to get it to live alongside S10, inside the S10 created, ZFS v15 zpool …

At the moment I have a S10U8 workstation with two zpools which looks like this:

root@insomnia:/var/tmp > uname -a
SunOS insomnia 5.10 Generic_142901-03 i86pc i386 i86pc
root@insomnia:/var/tmp > zpool status
pool: data
state: ONLINE
scrub: none requested

data ONLINE 0 0 0
c1d0p2 ONLINE 0 0 0

errors: No known data errors

pool: rpool
state: ONLINE
scrub: none requested

rpool ONLINE 0 0 0
c1d0s0 ONLINE 0 0 0

errors: No known data errors

I have two S10 BE’s set up on here:

root@insomnia:/var/tmp > lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
————————– ——– —— ——— —— ———-
s10u8_1 yes yes yes no –
s10u8_2 yes no no yes –

First thing to do, is create another BE for OpenSolaris:

root@insomnia:~ > lucreate -c s10u8_1 -n snv_130
Checking GRUB menu…
Analyzing system configuration.
Comparing source boot environment file systems with the file
system(s) you specified for the new boot environment. Determining which
file systems should be in the new boot environment.
Updating boot environment description database on all BEs.
Updating system configuration files.
Creating configuration for boot environment .
Source boot environment is .
Creating boot environment .
Cloning file systems from boot environment to create boot environment .
Creating snapshot for on .
Creating clone for on .
Setting canmount=noauto for in zone on .
Creating snapshot for on .
Creating clone for on .
Creating snapshot for on .
Creating clone for on .
Creating snapshot for on .
Creating clone for on .
Saving existing file in top level dataset for BE as //boot/grub/menu.lst.prev.
Saving existing file in top level dataset for BE as //boot/grub/menu.lst.prev.
File propagation successful
Copied GRUB menu from PBE to ABE
No entry for BE in GRUB menu
Population of boot environment successful.
Creation of boot environment successful.
root@insomnia:~ >

Next, check everything is there. Mount it, and rm everything from it.
(You should probably be a careful here and take a snapshot of your root zvol…)

root@insomnia:~ > lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
————————– ——– —— ——— —— ———-
s10u8_1 yes yes yes no –
s10u8_2 yes no no yes –
snv_130 yes no no yes –
root@insomnia:~ > zfs set mountpoint=/a rpool/ROOT/snv_130
root@insomnia:~ > zfs mount rpool/ROOT/snv_130
root@insomnia:~ > cd /a
root@insomnia:/a > ls
bin devices lib proc system
boot etc mnt reconfigure tmp
core export net rmdisk usr
Desktop home opt rpool var
dev kernel platform sbin vol
root@insomnia:/a > rm -rf /a/*
root@insomnia:/a >

Finally, lets share this out over NFS.

root@insomnia:~ > share -F nfs -o rw,anon=0 /a
root@insomnia:~ > share
– /a rw,anon=0 “”

Now for the Opensolaris install.

Download and install the latest opensolaris (at the time of writing, build 130) and get it inside VirtualBox.

I did nothing particularly unusual here, standard 64 bit VirtualBox vm with 768mb of memory.

Booted into the installer looks like this:

Once the installer completes, we don’t want to reboot..

Select ‘quit’ instead of reboot, and open a term.

Mount our NFS shared area, and the opensolaris install, and copy everything over:

jack@opensolaris:~$ pfexec su –
Sun Microsystems Inc. SunOS 5.11 snv_130 November 2008
root@opensolaris:~# zfs set mountpoint=legacy rpool/ROOT/opensolaris
root@opensolaris:~# mount -F zfs rpool/ROOT/opensolaris /a
root@opensolaris:~# mkdir /b
root@opensolaris:~# mount -F nfs /b
root@opensolaris:~# cd /a
root@opensolaris:/a# find . | ptime cpio -pvdum /b

7313440 blocks

real 3:37:17.419601197
user 29.642283189
sys 15:36.499440337

YMM (hopefully) V on the amount of time this takes to complete… Well over three hours. Ehehem….

So, once this finally completes, we can shutdown the vm and leave it alone..

Next up is a bit of fixup:

root@insomnia:/a > cd etc
root@insomnia:/a/etc > mkdir vbox_files
root@insomnia:/a/etc > mv path_to_inst path_to_inst.old zfs/zpool.cache driver_* vbox_files/
root@insomnia:/a/etc > cp /etc/path_to_inst /etc/zfs/zpool.cache /etc/driver_* .
root@insomnia:/a/etc > touch /a/reconfigure

I hit an issue here, where, as the username I had created for my user account in the installer was not the same as the one I used in the old BE so as such there was no home directory for the user.

You probably want to fix this before you reboot, as thanks to whichever bright spark decided to remove the ‘console login’ option from GDM and worse still, disable the ctrl+alt+backspace hotkey, means you’ll need to boot back to your S10 BE to fix..

Next, unmount:

root@insomnia:/a/etc > cd /
root@insomnia:/ > umount /a

Add an entry to /rpool/boot/grub/menu.lst for the new BE:

title OpenSolaris snv_130
findroot (pool_rpool,0,a)
bootfs rpool/ROOT/snv_130
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive

Reboot and be sure to choose our new BE from the grub menu.

A short reboot later, and we’re in the OpenSolaris snv_130 BE!

bash-4.0$ uname -a
SunOS insomnia 5.11 snv_130 i86pc i386 i86pc
bash-4.0$ pfexec /usr/sbin/beadm list
BE Active Mountpoint Space Policy Created
— —— ———- —– —— ——-
s10u8_2 – – 281.5K static 2010-01-17 22:16
s10u8_1 R – 9.29G static 2009-12-02 12:43
snv_130 N / 1.69G static 2010-01-17 22:43

Notice how beadm plays with my S10 BEs.

The final result:

Any of you actually patient enough to try this, have fun!ūüôā


After a bit of irc inspired digging, I’ve built a newer rev of LSOF and fortunately, it appears that the upcoming 4.83 release restores functionality on Solaris which has been broken for a while!

Will kick out some packages once it’s released.

(And yep, it supports ZFS)

If you juuuuuuust can’t wait, here are some simple instructions on building it:

Download and extract the 4.83K tar.bz2:

houston@charon:~/lsof > wget
–2010-01-03 20:33:41–
=> `lsof_4.83K.sun.tar.bz2′
Connecting to||:21… connected.
Logging in as anonymous … Logged in!
==> SYST … done. ==> PWD … done.
==> TYPE I … done. ==> CWD /pub/tools/unix/lsof/NEW … done.
==> SIZE lsof_4.83K.sun.tar.bz2 … 560608
==> PASV … done. ==> RETR lsof_4.83K.sun.tar.bz2 … done.
Length: 560608 (547K)

100%[======================================>] 560,608 367K/s in 1.5s

2010-01-03 20:33:43 (367 KB/s) – `lsof_4.83K.sun.tar.bz2′ saved [560608]

houston@charon:~/lsof > bzcat lsof_4.83K.sun.tar.bz2 | gtar -xf –
houston@charon:~/lsof >

Be slightly baffled by the confgure script, but continue on as follows:

houston@charon:~/lsof/lsof_4.83K.sun > ./Configure solaris
Testing prdata.h for PR_GWINDOWS, using gcc
Testing prdata.h for PR_LDT, using gcc
Testing gcc for 64 bit support

* Configuring for 64 bit kernel *

Testing vnode.h for VSOCK, using gcc

This configuration step (the Inventory script) takes inventory of
the lsof distribution. The script runs for a minute or two while
it checks that all the subdirectories, information files, scripts,
header files and source files that should be present really are.

It’s not absolutely necessary that you take inventory, but it’s a
good idea to do it right after the lsof distribution has been
unpacked. Once the inventory has been taken, this script creates
the file ./.ck00MAN as a signal that the inventory step has been

You can call the Inventory script directly at any time to take
inventory. You can inhibit the inventory step permanently by
creating the file ./.neverInv, and you can tell the Configure script
to skip the inventory and customization steps with the -n option.

Do you want to take inventory (y|n) [y]? n
rm -f ddev.c dfile.c dlsof.h dmnt.c dnode*.c dproc.c dproto.h dsock.c dstore.c dzfs.h kernelbase.h machine.h machine.h.old new_machine.h __lseek.s Makefile Makefile.zfs ./tests/config.cflags
rm -f ./tests/ ./tests/config.xobj ./tests/config.ldflags
Testing C library for localtime() and strftime(), using gcc … present
ln -s dialects/sun/ddev.c ddev.c
ln -s dialects/sun/dfile.c dfile.c
ln -s dialects/sun/dlsof.h dlsof.h
ln -s dialects/sun/dmnt.c dmnt.c
ln -s dialects/sun/dnode.c dnode.c
ln -s dialects/sun/dnode1.c dnode1.c
ln -s dialects/sun/dnode2.c dnode2.c
ln -s dialects/sun/dproc.c dproc.c
ln -s dialects/sun/dproto.h dproto.h
ln -s dialects/sun/dsock.c dsock.c
ln -s dialects/sun/dstore.c dstore.c
ln -s dialects/sun/machine.h machine.h
kernelbase.h assembled.
Makefile and lib/Makefile created.
./tests/ created
./tests/config.cflags created
./tests/config.ldflags created
./tests/config.xobj created

You may now customize the machine.h header file for this UNIX
dialect. The customizations will take effect when you compile
lsof. You may also choose to skip customization and proceed to
the compilation of lsof.

If you don’t know if you need to customize or want to know more
about what you can customize, consult the 00DCACHE, 00FAQ, 00PORTING,
and 00README files of the lsof distribution. You might also find
it helpful to examine the machine.h header file for the dialect
you’re customizing.

You don’t need to use this procedure to customize lsof; you can
edit the machine.h header file directly. If you later decide you
want to use this procedure to customize machine.h, execute the
./Customize script.

Do you want to customize (y|n) [y]? n

houston@charon:~/lsof/lsof_4.83K.sun > gcc -v
Using built-in specs.
Target: sparc-sun-solaris2.8
Configured with: ../gcc-4.3.4/configure –with-gnu-as –with-as=/opt/csw/bin/gas –without-gnu-ld –with-ld=/usr/ccs/bin/ld –with-cpu=v7 –enable-threads=posix –enable-nls –prefix=/opt/csw/gcc4 –with-local-prefix=/opt/csw –enable-shared –enable-multilib –with-included-gettext –with-libiconv-prefix=/opt/csw –with-system-zlib –with-gmp=/opt/csw –with-mpfr=/opt/csw –enable-languages=c,c++,fortran,java,objc,ada –enable-bootstrap
Thread model: posix
gcc version 4.3.4 (GCC)

run gmake (output snipped):

houston@charon:~/lsof/lsof_4.83K.sun > gmake
houston@charon:~/lsof/lsof_4.83K.sun >

Appears to have linked OK:

houston@charon:~/lsof/lsof_4.83K.sun > ldd lsof => /lib/64/ => /usr/lib/64/ => /lib/64/ => /lib/64/ => /lib/64/ => /lib/64/ => /lib/64/ => /lib/64/ => /lib/64/ => /lib/64/ => /lib/64/ => /lib/64/ => /lib/64/

Finally, we’ll copy it to a global zone and test it out:

root@snappy:~ > ./lsof_sparc -p 12151
sshd 12151 root cwd VDIR 136,8 1024 2 /
sshd 12151 root txt VREG 136,8 359244 228943 /usr/lib/ssh/sshd
sshd 12151 root txt VREG 136,8 392036 22431 /usr/lib/security/
sshd 12151 root txt VREG 136,8 41124 3067 /platform/sun4u/lib/
sshd 12151 root txt VREG 136,8 149428 2659 /usr/lib/security/
sshd 12151 root txt VREG 136,8 20572 4091 /lib/
sshd 12151 root txt VREG 136,8 55312 2586 /usr/lib/
sshd 12151 root txt VREG 136,8 155092 2612 /usr/lib/
sshd 12151 root txt VREG 136,8 135100 22434 /usr/sfw/lib/
sshd 12151 root txt VREG 136,8 42084 4110 /lib/
sshd 12151 root txt VREG 136,8 100972 4105 /lib/
sshd 12151 root txt VREG 136,8 1639032 4412 /lib/
sshd 12151 root txt VREG 136,8 37400 4123 /lib/
sshd 12151 root txt VREG 136,8 33348 4080 /lib/
sshd 12151 root txt VREG 136,8 1444348 5037 /usr/sfw/lib/
sshd 12151 root txt VREG 136,8 27100 4078 /lib/
sshd 12151 root txt VREG 136,8 77228 6346 /usr/lib/
sshd 12151 root txt VREG 136,8 62504 2740 /usr/sfw/lib/
sshd 12151 root txt VREG 136,8 229232 4075 /lib/
sshd 12151 root txt VREG 136,8 52920 3101 /lib/
sshd 12151 root txt VREG 136,8 870128 45032 /lib/
sshd 12151 root txt VREG 136,8 80200 3850 /usr/lib/
sshd 12151 root txt VREG 136,8 93924 4125 /lib/
sshd 12151 root txt VREG 136,8 16856 3066 /platform/sun4u/lib/
sshd 12151 root txt VREG 136,8 280840 4071 /lib/
sshd 12151 root 0u VCHR 13,2 6815752 /devices/pseudo/mm@0:null
sshd 12151 root 1u VCHR 13,2 6815752 /devices/pseudo/mm@0:null
sshd 12151 root 2u VCHR 13,2 6815752 /devices/pseudo/mm@0:null
sshd 12151 root 3u IPv6 0x30005e8c980 0t47908 TCP snappy:ssh->insomnia.lan:43612 (ESTABLISHED)
sshd 12151 root 4r DOOR 0t0 58 /var/run/name_service_door (door to nscd[133]) (FA:->0x3000236f580)
sshd 12151 root 5u FIFO 0x300016ca900 0t16 7062 (fifofs) PIPE->0x300016ca990
sshd 12151 root 6u FIFO 0x300016ca180 0t0 7067 (fifofs) PIPE->0x300016ca210
sshd 12151 root 7u FIFO 0x300016ca900 0t16 7062 (fifofs) PIPE->0x300016ca990
sshd 12151 root 8u FIFO 0x300016ca210 0t0 7067 (fifofs) PIPE->0x300016ca180


I finally reached melting point with the gnome which ships with Solaris 10, and so I decided to take a look at some other window managers.

A bit bored of Flux and Openbox, I finally settled on DWM.

For those of you who don’t know – DWM is an exceptionally lightweight window manager (weighing in at just over 2000 lines of C) which has no configuration outside of config.h, and should be pushed out with the next release over at blastwave (my sources tell me this will be today).

To get started:

# /opt/csw/bin/pkgutil -U
# /opt/csw/bin/pkgutil -i dwm-dtlogin

This will pull down DWM itself, the dtlogin integration files (/etc/dt/config), urxvt and the artwiz fonts. Select DWM from your sessions list in dtlogin, and press MOD4(Windows Key) + Shift + Enter to open a terminal.

I’ve added DMENU to the repo for those who want it, too.

Some obligatory screenies.

“Floating Layout”

“Tiled Layout”

The patch for the zenburn-esque colour theme is here

Have fun!ūüôā

Over at blastwave, we’ve been hard at work getting a new perl package togeather, and one of the things we like to do is have 64 bit binaries in the same package as the 32 bit binaries..

We achieve this with the help of a binary called isaexec; our packages install their binaries into (e.g for perl) /opt/csw/bin/sparcv9/perl and /opt/csw/bin/sparcv8/perl, and then a hard link is created as /opt/csw/bin/perl=isaexec in our package prototype.

When /opt/csw/bin/perl (which is actually isaexec) is run, it uses getexecname() and isaexec() to run the correct binary for that host.

On solaris 8 however, we noticed a bit of a strange problem. The /opt/csw/bin/perl link was working as expected, but when we use it in a script #!, we were seeing some unusl behaviour.

To demonstrate this, we’ll set up some isaexec links for bash:

root@mimas:/opt/csw/bin > cp bash sparcv8/bash_2
root@mimas:/opt/csw/bin > cp bash sparcv9/bash_2
root@mimas:/opt/csw/bin > ln isaexec bash_2

Next, a little script which calls the isaexec’d up /opt/csw/bin/bash_2:

houston@mimas:/tmp > cat
echo test
houston@mimas:/tmp > ./
/opt/csw/bin/bash_2: cannot find/execute “” in ISA subdirectories

To cut a very long story very short – there is no trivial way around this, the problem lies deep within exec on Solaris 8.

As a result, we’re making the sparcv8 binaries for perl (and anything else) the default for Solaris 8.

The v9 bins are still there, but if you want them you’ll need to use /opt/csw/bin/sparcv9/foo in your scripts.


Not a very interesting update, but I felt compelled to write something:

I’ve been back in the real world for a few weeks now, and of course the first thing I needed to do was set up a workstation.

Initially, my first choice was opensolaris-dev (in this instance, build 127) which turned out to be a rather painful experience. Besides the random crashes, 10 minute boot times and broken audio drivers, the real problem for me is that opensolaris has one of the worst packaging systems ever made.

Many people with much better prose than mine can explain the problems with IPS, if they weren’t painstakingly obvious from the moment you first used it – so I’ll leave that rant for another day.

So, I went off to and downloaded the latest Solaris 10 release and stuck it on my machine, and so far everything is working great – and compared to OpenSolaris it’s rock solid stable.

To make it more usable, the first thing I had to take care of was the lack of a decent terminal program, the gnome-terminal that ships with Solaris 10 is terribly dated, and when I’m inside vim and the cursor is over a comment, it disappears!

So I logged into the blastwave farm and made a package for urxvt, which should be available in the repo soon!

Some obligatory screenshots:

vim with a 256 color theme (zenburn)

Color test:

Next up was to install the latest Firefox which you can download from their website.

My next task is to get a proper window manager on there, such as awesomewm – which’ll come when I find some free time!ūüôā


That was a very long time without an update!

I shall be returning to the ‘real’ world soon; having found exactly how deep the rabbit hole goes, I’ve consumed the blue pill and am working on a return plan to the UK.


Bah! But, for the bestūüôā

Expect some cool stuff soon, I will be returning to my old projects, finally!


Apologies for the lack of updates! (although, as of this moment hardly anyone is reading this, so I’m not sure exactly who I’m apologizing to!)

Things have been pretty crazy with quitting my job and getting prepared to relocate 10,081 miles from here in Scotland to Brisbane, Australia.

So, the gory details: I’m landing in Brisbane on the 13th if anyone wants to hook up for a beer, if not – I might catch you at the next QOSUG!

I’ll post some more Solaris related stuff as I get the chance.

In related news – we over at Blastwave have been rather busy, expect some cool new things (Including FreeNX!!!) soon!

I’ve been given the task of writing some perl scripts which will run on a Solaris 10 machine and¬†communicate with an Oracle¬†10g¬†XE database which in turn¬†is living on a RHEL5 box.

While I have some experience installing/patching Oracle, I’ve never written a script which communicates directly with it – so¬†this¬†should be a good learning exercise.

There’s a simple table in the database called “SM_USER_CONFIG” which contains a few rows just for testing.

The first step I feel, is to get the machine communicating with the database via sqlplus.

To do this, we need to install “Instant Client” – We want “Basic” “Sqlplus” and “SDK”

(available from

I extracted all of these to /opt/instantclient:

(TCSUNDEV01:/opt/instantclient) sysmgr > ls
classes12.jar***    sdk/        tnsnames.ora
glogin.sql***  sqlnet.log*  ojdbc14.jar       sqlplus*

We need to create a /opt/instantclient/tnsnames.ora file like this:

        (ADDRESS =
          (COMMUNITY =
          (PROTOCOL = TCP)
          (Host =
          (Port = 1521)

Lets try and connect with SQL plus:

(TCSUNDEV01:~) sysmgr > setenv TNS_ADMIN /opt/instantclient/
(TCSUNDEV01:~) sysmgr > /opt/instantclient/sqlplus username/password@XE.WORLD

SQL*Plus: Release – Production on Thu Jun 25 19:16:00 2009
Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Express Edition Release – Production

  3  /



Cool, it works.

Next up is perl. We will build DBD::Oracle for this. Head over to cpan and download the src. We’re using CSWperl from blastwave.

(TCSUNDEV01:/var/tmp) sysmgr > gzcat /tmp/DBD-Oracle-1.23.tar.gz | gtar -xf –
(TCSUNDEV01:/var/tmp) sysmgr >cd DBD-Oracle-1.23
(TCSUNDEV01:/var/tmp/DBD-Oracle-1.23) sysmgr > setenv TNS_ADMIN /opt/instantclient/
(TCSUNDEV01:/var/tmp/DBD-Oracle-1.23) sysmgr > setenv LD_LIBRARY_PATH /opt/instantclient/
(TCSUNDEV01:/var/tmp/DBD-Oracle-1.23) sysmgr > setenv ORACLE_SID XE
(TCSUNDEV01:/var/tmp/DBD-Oracle-1.23) sysmgr > perl Makefile.PL -V

Using DBI 1.604 (for perl 5.008008 on i86pc-solaris-thread-multi) installed in /opt/csw/lib/perl/csw/auto/DBI/

Configuring DBD::Oracle for perl 5.008008 on solaris (i86pc-solaris-thread-multi)

Remember to actually *READ* the README file! Especially if you have any problems.

Trying to find an ORACLE_HOME
Found /opt/instantclient/

WARNING: Setting ORACLE_HOME env var to /opt/instantclient/ for you.
WARNING: If these tests fail you may have to set ORACLE_HOME yourself!
Installing on a solaris, Ver#2.8
Using Oracle in /opt/instantclient/
SP2-1503: Unable to initialize Oracle call interface
SP2-0152: ORACLE may not be functioning properly

            If sqlplus failed due to a linker/symbol/relocation/library error or similar problem
¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† then it’s likely that you’ve not configured your environment correctly.
            Specifically, your LD_LIBRARY_PATH environment variable
            set to include the directory containing the Oracle libraries.

Forcing Oracle version to be treated as
Oracle version (10.2)
Looks like an Instant Client installation, okay
Your LD_LIBRARY_PATH env var is set to ‘/opt/instantclient/’
Oracle sysliblist:
Found header files in /opt/instantclient//sdk/include.

Checking for functioning
System: perl5.008008 sunos thor 5.8 generic_117351-51 i86pc i386 i86pc
Compiler:   cc -xO3 -xtarget=generic -xarch=generic -D_REENTRANT -xO3 -xtarget=generic -xarch=generic -I/opt/csw/bdb44/include -I/opt/csw/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
Linker:     /usr/ccs/bin/ld
Linking with -lclntsh.

Using DBD::Oracle 1.23.
Using DBD::Oracle 1.23.
Using DBI 1.604 (for perl 5.008008 on i86pc-solaris-thread-multi) installed in /opt/csw/lib/perl/csw/auto/DBI/
Writing Makefile for DBD::Oracle

***¬† If you have problems…
     read all the log printed above, and the README and files.
¬†¬†¬†¬† (Of course, you have read README by now anyway, haven’t you?)

Notice the warning about sqlplus failing above. As we’re building this on a CLIENT, when sqlplus is invoked it doesn’t specify @XE.WORLD (default is to connect to a¬†local database)- We can just ignore this.

Go ahead and run “make install”

(TCSUNDEV01:/var/tmp/DBD-Oracle-1.23) sysmgr > pfexec gmake install
Skip blib/lib/DBD/ (unchanged)
Skip blib/lib/ (unchanged)
Skip blib/arch/auto/DBD/Oracle/dbdimp.h (unchanged)
Skip blib/arch/auto/DBD/Oracle/ocitrace.h (unchanged)
Skip blib/lib/ (unchanged)
Skip blib/arch/auto/DBD/Oracle/Oracle.h (unchanged)
Skip blib/lib/DBD/Oracle/ (unchanged)
Skip blib/arch/auto/DBD/Oracle/ (unchanged)
Skip blib/lib/DBD/Oracle/ (unchanged)
cc -c¬† -I/opt/instantclient//sdk/include -I/opt/csw/lib/perl/csw/auto/DBI -D_REENTRANT -xO3 -xtarget=generic -xarch=generic -I/opt/csw/bdb44/include -I/opt/csw/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -xtarget=generic -xarch=generic¬†¬† -DVERSION=\”1.23\” -DXS_VERSION=\”1.23\” -KPIC “-I/opt/csw/lib/perl/5.8.8/CORE”¬† -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\”\” Oracle.c
cc -c¬† -I/opt/instantclient//sdk/include -I/opt/csw/lib/perl/csw/auto/DBI -D_REENTRANT -xO3 -xtarget=generic -xarch=generic -I/opt/csw/bdb44/include -I/opt/csw/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -xtarget=generic -xarch=generic¬†¬† -DVERSION=\”1.23\” -DXS_VERSION=\”1.23\” -KPIC “-I/opt/csw/lib/perl/5.8.8/CORE”¬† -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\”\” dbdimp.c
cc -c¬† -I/opt/instantclient//sdk/include -I/opt/csw/lib/perl/csw/auto/DBI -D_REENTRANT -xO3 -xtarget=generic -xarch=generic -I/opt/csw/bdb44/include -I/opt/csw/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -xtarget=generic -xarch=generic¬†¬† -DVERSION=\”1.23\” -DXS_VERSION=\”1.23\” -KPIC “-I/opt/csw/lib/perl/5.8.8/CORE”¬† -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\”\” oci8.c
Running Mkbootstrap for DBD::Oracle ()
chmod 644
rm -f blib/arch/auto/DBD/Oracle/
LD_RUN_PATH=”/opt/instantclient” cc¬† -G -L/opt/csw/bdb44/lib -L/opt/csw/lib -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib -L/lib Oracle.o dbdimp.o oci8.o¬† -o blib/arch/auto/DBD/Oracle/¬† \
           -L/opt/instantclient/ -lclntsh       \

chmod 755 blib/arch/auto/DBD/Oracle/
cp blib/arch/auto/DBD/Oracle/
chmod 644 blib/arch/auto/DBD/Oracle/
/opt/csw/bin/perl “-Iblib/arch” “-Iblib/lib” ora_explain.PL ora_explain
Extracted ora_explain from ora_explain.PL with variable substitutions.
cp ora_explain blib/script/ora_explain
/opt/csw/bin/perl “-MExtUtils::MY” -e “MY->fixin(shift)” blib/script/ora_explain
Manifying blib/man1/ora_explain.1
Manifying blib/man3/DBD::Oracle.3perl
Manifying blib/man3/DBD::Oraperl.3perl
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Writing /opt/csw/lib/perl/site_perl/auto/DBD/Oracle/.packlist
Appending installation info to /opt/csw/lib/perl/5.8.8/perllocal.pod
(TCSUNDEV01:/var/tmp/DBD-Oracle-1.23) sysmgr >

And test:

(TCSUNDEV01:/var/tmp/DBD-Oracle-1.23) sysmgr > perl -MDBD::Oracle -le ‘print $DBD::Oracle::VERSION;’

Finally, lets put togeather a little perl script to query our sample table:


use DBI;

$dbh = DBI->connect(‘dbi:Oracle:’, q{USER/PASSWORD@(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = = 1521))
¬† )},””) or die DBI::errstr;

$dbstr = $dbh->prepare(“SELECT id, username, hostname FROM sm_user_config”);

while (($rdbid, $rdbu, $rdbv) = $dbstr->fetchrow_array()) {
        $~ = TABLEENTRY;

print “\n”;



| ID     |   User          |  VMName        |

| @<<<<< | @<<<<<<<<<<<<   | @<<<<<<<<<<<<< |
 $rdbid,   $rdbu,            $rdbv



Running it, we get:


(TCSUNDEV01:~) sysmgr > perl

| ID | User | VMName |
| 1 | HoustonN | VXPTEST39 |
| 3 | UserTest | VXPTEST2 |
| 2 | TestUser | VXPTEST5 |


(Formatting got a bit messed up when I pasted, but you get the idea =)
Party on!


Get every new post delivered to your Inbox.