I have two servers with KVM running, on both I use preseeding to install the guests. It's amazing to watch a guest install automatically by using virt-install and passing some parameters on command line. Basically you need to pass further preseeding parameters in a file. When converting this script to wheezy I ran into a problem. In squeeze, the parameter that defines the disk was named vda (why vda??? however) in wheezy its sda now (more like its in every debian install). Means I had to change the config parameter from

d-i partman-auto/disk string /dev/vda
to
d-i partman-auto/disk string /dev/sda

Still not finished with my Gnome-Desktop, what I can say that there are some great features that I really missed on Windows for years, however I want to use my Thunderbird and Windows parallel and decided to use dual-boot with the same thunderbird-profile-directory. Wheezy still has a 3.x icedove (=thunderbird) client, and my Windows installation already has a 7.0.1, so I needed a new client, and could not find any distribution out there. Means I was forced to build it by myself. There were two guides that helped my with that topic the one was from Mozilla, the other one for an Ubuntu-build. Here is my step-by-step guide:

get sourcecode

get sourcecode from mozilla, in this case for building 7.0.1

wget ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/7.0.1/source/thunderbird-7.0.1.source.tar.bz2

unpack file

tar -vxfj thunderbird-7.0.1.source.tar.bz2

change to direcotry

cd comm-releases

get build-backages

apt-get install build-essential libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13 yasm

and dependencies from the icedove (debian version of thunderbird) package

apt-get build-dep icedove

create .mozconfig file

This file controls what is built and is specific for the mozilla project. In the first line I let the build put the new files in a new directory “thunderbird-7.0.1”

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/thunderbird-7.0.1
ac_add_options --enable-application=mail
mk_add_options MOZ_CO_PROJECT=mail
ac_add_options --enable-optimize
ac_add_options --enable-calendar
ac_add_options --disable-crashreporter

Here I disabled the crashreporter, because you run into a problem with deprecated headers on wheezy, a known bug of the mozilla build.

workaround for bug with 3.0 kernel

A workaround for another open bug with the mozilla build, on 3.0 kernels, just needed if you really are on a 3.0 kernel.

cd mozilla/security/coreconf
cp Linux2.6.mk Linux3.0.mk

start the build

make -f client.mk

after the build finished change to the build-directory

cd thunderbird-7.0.1

create the deb-package

make -j4

there is already a metapackage “thunderbird” on debian so we need to give it another name checkinstall also asks you for some stuff for naming and describing the package

checkinstall -D --install=no --pkgname=´thunderbird-fairtec´ --pkgversion=´7.0.1´

install the package

dpkg -i thunderbird-fairtec_7.0.1-1_amd64.deb
!If there is interest in the pre-built file, let me know, I will take a look if we can find a suitable hosting solution for that!

Last week I setup dual boot on my Laptop for giving Gnome on Debian a try. Worked without any problems, except the sound, the driver was installed correctly, but still had no sound. After reading loads of docs I found the hint of using the Realtek Code-Software here. Here step-by-step what I needed to make it working:

get_build_packages

apt-get install linux-source linux-headers-3.0.0-1-all-amd64 build-essential

get file from realtek - choose your kernel

become root

su root

uncompress file (example!)

tar -vxjf LinuxPkg_5.17Beta.tar.bz2

change to new dir (example!)

cd realtek-linux-audiopack-5.17

do the installation and reboot

./install
reboot


Today I tried to restore a full backup of an old DB to a new database with

RESTORE DATABASE FROM TAG = 'LASTDEV'
what resulted in
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 6 found to restore
After looking for the solution for hours I found out that there is a 5-year!!! old bug open that makes it impossible for RMAN to restore a backuppiece if it's read-only.
The BUG# is "5412531 - RMAN FAILS RESTORING READONLY BACKUPS: ORA-19870 ORA-19587 ORA-27091 ORA-27067"

I am using sqlplus and rman on linux a lot, and one very annoying thing is that there is no history (key-up) as it is on windows. Reason is that in sqlplus/rman is running in a dosbox and the dosbox has the "key-up-history" feature implemented automatically.

But also in Linux it's easy to achieve. The tool you need is "rlwrap". Just install it (example for Debian)

apt-get install rlwrap

and call sqlplus with "rlwrap sqlplus" or rman with "rlwrap rman".

Nothing more to make it run? No, nothing more!

Have fun!

If you are using UTL_MAIL you will soon come to some limits of this package.

  •  it does not support SMTP authentication
  •  it does not support attachments (not provided here)

Last week I needed the authentication part for a project.
I decided to take something that's already stable ready to be used, and free.
It's Apache Commons Mail part. Basically these class makes handling in Java much easier than provided by SUN/ORACLE.
es, it's a Java-class. But Java is really easy to use in Oracle, you will see.

Basically you get the jar, say "loadjava myjar.jar", create a simple java-class in oracle, create a simple pl/sql wrapper.
This cooking recipe is on Linux, but except the unpacking it's almost the same on windows.
And don't forget to take the most current and stable jar-files!

get the mail.jar from here http://www.oracle.com/technetwork/java/javamail/index.html

get the commons-email-xxx.jar from here http://commons.apache.org/email/

unzip both in a directory on your database server and use following statements to load it into the database (REPLACE USER/PW!!!):

 

1
2
3
loadjava -u myuser/MYPW -resolve mail.jar
loadjava -u myuser/MYPW -resolve commons-email-xxx.jar
 

 

Now we need some Java and PL/SQL programming. I did the design so that it can be basically used instead of UTL_MAIL, means same parameter names and default-values.

Just some more parameters were added for using the authentication.
You can download the files from the download-sections here. Just install them with SQL/PLUS or whatever tool you like.

After compiling the programs into the databse give it a try. You need to set some permissions, so keep DBMS-Output enabled, in the output you find the statements that needs to be executed. It will look like similar to this:

1
2
3
dbms_java.grant_permission( 'yippie', 'SYS:java.lang.RuntimePermission', 'accessDeclaredMembers', '' );
dbms_java.grant_permission( 'XYA', 'SYS:java.util.PropertyPermission', '*', 'read,write' );
begin dbms_java.grant_permission( 'XYA', 'SYS:java.net.SocketPermission', '123...', 'connect,resolve' ); 

 

Ok for testing we need a testscript:

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
BEGIN

dbms_output.enable(10000);
dbms_java.set_output(1000000); std_mail.send(
sender => This email address is being protected from spambots. You need JavaScript enabled to view it.',
recipients => This email address is being protected from spambots. You need JavaScript enabled to view it.', subject => 'subjective', message => 'messagemessagemessage', smtphostname => 'mail.mytestdomain.com', smtpport => '587', smtpuser => 'myuser', smptpassword => 'mypw', useTls => false); END; /

That's it!

The programs here are released under the GNU/GPL2.

Have fun!

Feedback appreciated, please comment!

If you are running into a ORA-07445 or ORA-00600 error something you should fix immediately happened on your Database. You should do following things before opening a TAR on Metalink:

  • get the exact error-message including the things in the square brackets from the alert-log
  • logon to metalink and search for the document 153788.1 that's the Error-Lookup-Tool from Oracle for these errors and open that document
  • choose if it is a ORA-00600 or a ORA-07445 and enter the things in the first square brackets into the field "Error Code First Argument" and press "Lookup Error"

If you are lucky and find informations/patches (what pretty often happens -> good stuff Oracle) you can probably fix it by yourself. If not you have to open a Metalink-TAR.

androidCurrently I reinstalled my Samsung Galaxy S (with insanity 6.3) and came across "an error occured while downloading your recovery." when trying to flash clockworkmod recovery. With installing a superuser version from the market and reinstalling clockworkmod my problem seems to be solved. There seems to be a bug in the superuser app I was using previously.

kvm I recently installed a usb-harddisk on my server and mounted it on a guest with virt-manager. The performance was very bad, i had 50Kbyte when testing with hdparm.

I remounted it in virt-manager as IDE drive instead of USB-Drive and voila i had full performance again. It seems that the USB-drive mounting is a bit bugged.

kvm I am using KVM for a while now and reinstalled my XEN-Server. I have to mention it's not the same hardware. XEN was on a 2 year old Server with 4G memory and Debian Lenny32, KVM is on a 6 months old 8G memory Server with Debian Squeeze. So i have a bit better hardware and a 64bit System on KVM.

I like that KVM is out-of-the-box working with virsh/virt-manager the performance improvement is enormous, especially with 64MB-RAM systems like I use for my wiki. I use LVM for the guest-disks (I did it even for the XEN-guests) and compared to use files it's even a huge performance improvement.

The only thing that's easier in XEN is that you can mount the guest-partitions and can access them directly in KVM you need to use kpartx (not hard but one step more) to achieve this.

I started to move to KVM because it seems as XEN development slowed down and there is much more development activity and support for KVM. I think that was a good decision.

debian3

 

oralogo_small

I recently needed to install a Oracle 11g Database on Debian, and wrote down the notes here. Please send me a message

if i missed a step or something is easier to achieve than I did.

install mandatory packages

some packages are probably not necessary, I put them together from old notes from me and several weblinks if you know which are not necessary send me a list and i will correct it

apt-get install binutils autoconf automake bzip2 gcc less libc6-dev make libstdc++5 unzip zlibc build-essentials libaio1

!!!doxygen reported as not needed by Tobia, tx for this! Also watch his comment if you use OpenVZ!

x-terminal

I chose fluxbox but you can also take anything else like xterm, gnome, kde….

apt-get install fluxbox

prepare user and groups

groupadd oinstall
groupadd dba
useradd oracle -m -d /home/oracle -g oinstall -G dba -s /bin/bash
passwd oracle

check environment

there are several kernel parametersw that have to be changed to succesfully install the database, here is a script that helps you to determine them

echo "sem: ";echo "min 250 32000 100 128"; echo "is " `cat /proc/sys/kernel/sem`; echo; \
echo "shmall: ";echo "min 2097152"; echo "is " `cat /proc/sys/kernel/shmall`; echo; \
echo "shmmax - should be able to hold the SGA - max 4G-1byte: ";echo "is " `cat /proc/sys/kernel/shmmax`; echo; \
echo "shmmni: ";echo "min 4096"; echo "is " `cat /proc/sys/kernel/shmmni`; echo; \
echo "file-max: ";echo "min 6815744"; echo "is " `cat /proc/sys/fs/file-max`; echo; \
echo "ip_local_port_range: ";echo "min/max 9000  65500"; echo "is     " `cat /proc/sys/net/ipv4/ip_local_port_range`; echo; \
echo "rmem_default: ";echo "min 262144"; echo "is " `cat /proc/sys/net/core/rmem_default`; echo; \
echo "rmem_max: ";echo "min 4194304"; echo "is " `cat /proc/sys/net/core/rmem_max`; echo; \
echo "wmem_default: ";echo "min 262144"; echo "is " `cat /proc/sys/net/core/wmem_default`; echo; \
echo "wmem_max: ";echo "min 1048576"; echo "is " `cat /proc/sys/net/core/wmem_max`; echo; \
echo "aio-max-nr: ";echo "max 1048576"; echo "is " `cat /proc/sys/fs/aio-max-nr`; echo;

change necessary parameters

you have just to change the parameters that don't fit, but feel free to set them all to the minimum with this script

echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf
echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
# !!!! needs to fit YOUR SGA (=main memory for database, be sure to have enough ram for PGA etc.)!!!!
echo "kernel.shmmax = 1200000000" >> /etc/sysctl.conf
#echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
echo "fs.file-max = 6815744" >> /etc/sysctl.conf
#echo "net.ipv4.ip_local_port_range = 1024 65000" >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304" >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048576" >> /etc/sysctl.conf
echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf

change some limits

also some limits have to be set

echo "oracle soft nproc 2047" >> /etc/security/limits.conf
echo "oracle hard nproc 16384" >> /etc/security/limits.conf
echo "oracle soft nofile 1024" >> /etc/security/limits.conf
echo "oracle hard nofile 65536" >> /etc/security/limits.conf

create directories

I prefer to separate software, database files and recovery files so i put them in /u01 /u02 /u03

mkdir -p /u01/app/oracle
mkdir -p /u02/oradata
mkdir -p /u03/flash_recovery_area
chown -R oracle:oinstall /u01 /u02 /u03
chmod -R 775 /u01 /u02 /u03

NOTE: seems they just say “recovery_area” or even “fast_recovery_area” now to the “flash_recovery_area”
additional steps

These steps prevent errors when the installer links some libraries

ln -s /usr/bin/awk /bin/awk
ln -s /usr/bin/basename /bin/basename

finish preparations

reboot

== call the installer But before calling the installer check with above script if the kernel parameters are fine now

su oracle
/pathtoinstallfileshere/database/runInstaller -ignoreSysPrereqs

installer

The installer should guide you through each step in simple and advanced mode. When the requirements are checked you can savely bypass the warnings, because not everything can be checked on an unsupported ;-) environment.

!!!I really want to keep this up-to-date so please send me a note if i missed something or something is easier to handle than i did it!!!

Errors that can happen and how to bypass them

Added at 30.12.2010 including some more install packages some of the errors below did not happen when i wrote this article, it seems some new library versions etc. changed recently

java exception when calling the installer

happened at my side because I installed it over vnc This should help:

xhost localhost

Error in invoking target 'install' of makefile ins_ctx.mk

seems to be a problem with a newer? glibc version in the make.log file you should find something like

warning: libstdc++.so.5, needed by /u01/app/oracle/product/11.2.0/dbhome_1/ctx/lib//libsc_fa.so, not found

simply install libstdc++5 apt-get install libstdc++5

android"The type R is already defined"
That's the message you get in Eclipse if you try to build the Funambol Android Sync Client.
Reason is that you have checked two Builders that try to generate the same class.
You just have to uncheck the Java-Builder from Project->Properties->Builders.
Then the application even works fine in the Emulator.

funambolbuilderr