sábado, 7 de julio de 2007

Oracle 10gR2 on Ubuntu Server 7.04

Introduction
Oracle is one of the most (if not the most) famous DMBS, in many places you are going to be asked to develop using Oracle for the persistence.
But the installation of oracle is big, and also slow, I have installed Oracle on my Linux box every time I install a fresh Linux Version and its fine, if you don't start the enterprise manager it can moderate on resources, so to resolve the problem I am going to install Oracle 10gR2 on a Ubuntu Server 7.04 on a VMware virtual machine.
I have choose Ubuntu Server because of it size and the package manager that makes install the minimal X requirements easy.

Installation of Ubuntu Server 7.04
I am going to install ubuntu from the ubuntu dvd, this dvd can install a command line system, a sever and the default ubuntu.
change your language hitting F2, and your keyboard with F3, after hitting on the option "Install a server", the installation for the server is console based, the steps are:
  1. Selection of the language for the installation process
  2. Selection of a country
  3. Enter a hostname
  4. Partition of the disk: you can do this step in 3 ways
    1. Guided (take all disk)
    2. Guided and use LVM
    3. Manual
  5. After you setup your partition layout the installer ask you about your timezone
  6. Select if your time its set to UTC or not.
  7. Enter the full name of the default user, this is not the login name but the full name.
  8. Enter the login name, the one that you are going to be asked for in the login of the system
  9. Enter the user password
  10. Re-enter the user password
  11. After 7 minutes of software installation, the installer told me that only the base system was installed, that if I want to install ubuntu desktop, lamp server or dns, I didn't choose anything and hit enter
  12. After the reboot, in the first boot you will need to install x packages to install oracle, I choose fluxbox because of it's size and footprint.
    $sudo apt-get install fluxbox xserver-xorg xfonts-base fluxbox xterm
    this will give you a very lightweight server
  13. you can start the X environment with startx now.
note: if you are working on vmware, you may want to make a clone of your ubuntu server, so may do clones of this virtual machine if you want to use a lightweight server later.

Installation of Oracle 10gR2
note: this process installation is highly based on Akshay Mehta's tutorial
now it's time for the installation of oracle, but for a perfect installation it will be necessary to do some previous steps:
  1. update package repository
    $sudo apt-get update
  2. install some necesary packages
    $sudo apt-get install build-essential libaio rpm lesstif2-dev alien libstdc++6-dev
  3. Create the users and groups oracle needs:
    $sudo groupadd oinstall
    $sudo groupadd dba
    $sudo groupadd nobody
    $sudo useradd -g oinstall -G dba,nobody -d /opt/oracle -m -s /bin/bash oracle
  4. Set oracle user’s password
    $sudo passwd oracle
  5. Append user oracle’s .bashrc with PATH and ORACLE:BASE,HOME and SID information as oracle user
    $sudo su oracle
    $nano .bashrc
    and append to the file
    export ORACLE_BASE=/opt/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/10gR2
    export ORACLE_SID=orcl
    export PATH=$PATH:$ORACLE_HOME/bin
    return to your normal user
    $exit
  6. Make sure the correct kernel parmeters are appended to /etc/sysctl.conf
    kernel.shmall = 2097152
    kernel.shmmax = 2147483648
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.core.rmem_default = 262144
    net.core.rmem_max = 262144
    net.core.wmem_default = 262144
    net.core.wmem_max = 262144
    fs.file-max = 65536
    net.ipv4.ip_local_port_range = 1024 65000
  7. Set the kernel parameters or reboot
    $sudo /sbin/sysctl -p
    1. Set /etc/security/limits.conf
      $sudo nano /etc/security/limits.conf
      and append to the file
      * soft nproc 2047
      * hard nproc 16384
      * soft nofile 1024
      * hard nofile 65536
  8. Create symbolic links this is because the location of some commands are hard codded on oracle scripts, so ubuntu would look more like an enterprise rpm based distro.
    $sudo ln -s /usr/bin/awk /bin/awk
    $sudo ln -s /usr/bin/rpm /bin/rpm
    $sudo ln -s /lib/libgcc_s.so.1 /lib/libgcc_s.so
    $sudo ln -s /usr/lib/libstdc++.so.6 /lib/libstdc++.so.5
    $sudo ln -s /usr/bin/basename /bin/basename
  9. Mount the Oracle10g CD and run the installer
    /runInstaller -ignoreSysPrereqs
    note: I have had problems running the installer as another user than oracle, if you have kde installed, you can try with sudo, or start a konsole with kdesudo -u oracle konsole, or log as oracle user and run the installer from there.
    Installation of oracle is: next, next, next..... only take care of assign a password when you are prompted to.
  10. Enable the orcl database to start when you call dbstart
    $sudo nano /etc/oratab

    and change :N to :Y
  11. to start the services as oracle user do:
    $dbstart
    $lsnrctl start
    if you want to start the isqlplus web console do:
    $isqlplusctl start
    if you want to start the enterprise web console do:
    $emctl start dbconsole
  12. remember to stop the services before shut down the machine.

miércoles, 4 de julio de 2007

Slackware 12 Review

Introduction
I'm big fan of Slackware Linux, I have used it since the 9.0 version, and I am very happy with this distribution, in the beginning was challenging to setup mostly because I was a newbie, today I am installing and reviewing the recently released version 12 in my toshiba l35-sp1011

  • Celeron M 1.6Ghz 1Mb cache L2
  • 1.5 Gb DDR2 Ram
  • 40GB 5400rpm sata HDD
  • ATI mobility radeon X300, 128 Mb Ram (shared)
  • ATI chipset

this release of slackware comes with many changes, from the release announcement:

  • Kernel 2.6.21!!!
  • XFCE 4.4.1 for the lovers of this lightweight desktop
  • KDE 3.5.7 latest release of the beautiful and customizable K Desktop Environment
and many others, you can check the change log here, now from what has been my experience, this is a very overhauled release of slackware, when you insert your DVD or CD to install the distro there is only the hugesmp option, after you hit enter the installation is pretty straightforward and typically Slackware you must:

Installation
  1. hit 1 after the kernel messages end to select your keyboard layout, default is qwerty us.map (English US) or hit enter if you don't want to change it.
  2. login as root, there is no password
  3. Setup your hard disk partition layout with fdisk or the more easier cfdisk
  4. type setup to start the setup program
  5. in the installation program you can change the keyboard layout again
  6. addswap: this step set up your swap partition so it can be used if you don't have enough ram
  7. target: configure your / partition, the installer is going to ask you if you want to format the partition, or keep the existing filesystem, if you want to format the partition you can use ext2, ext3, reiserfs, jfs and xfs for the root partition.
  8. after this if you have fat or ntfs partition is going to ask you if you want to mount then in the file system, I have a document partition in ntfs, so I am select it and define a mount point for the partition.
  9. after this the installer let you choose the medium for the installation, you can use a DVD or cd for the installation, mount an existing partition that contains the files for the installation, install from a premounted partition or from a nfs directory, I select the first one, install from a cd or dvd.
  10. next step is to let the program search automatically for the cdrom or set it yourself, I chose automatically.
  11. After the program detects the cdrom it show you a list of categories of software, you can choose here what groups of software you want to install, you can chose here to install everything or only some groups
  12. next step is to sellect the method of installation, you can select to install everything from the categories you selected, select the programs from every categorie (menu or expert) or newbie, I select the expert and select my own selection of software, you can select the full as this is going to give you a fully functional system and surely not problematic, its the best option.
    You can also choose to use a custom tagfile for a personalized installation, look for the section custom installation in this page.

    after this you must wait to the programs to install, the process is very very fast, my installation was 2.1GB and was pretty fast.
    Some observations are that now in the cd the categories for setup a develop machine or a server, there are no desktops in this cd, this make it a perfect option for setup a server if you need to.
    in the cd 2 comes the X server, kde, xfce and the X programs, and the internalization packages for kde.
    cd 3 is the extras and source for the extras cd, if you download the dvd version then all this is going to come in the dvd plus the sources for all the program
    in the A series you now select if you want to install the hugesmp, huge non smp or generic kernel, this is a change, in previous releases you selected this after the installation of the packages end.

  13. when the installation of the packages end, the setup is going to ask you to make a USB boot disk (a change, before was a floppy setup), I choose to skip the creation of the usb disk.
  14. Modem configuration, I skipped this one
  15. Installation of LILO, I choose simple, have always worked
    1. Selection of the resolution for LILO configuration, the default one is 1024x768x256
    2. Optional LILO append parameters for the kernel: blank
    3. LILO Destination: you can choose between Root, Floppy and MBR: MBR has worked for me always.
  16. Setup ask you to configure the network, choose Yes to configure
    1. Hostname: enter the name of your machine
    2. Domain: domain for the machine
    3. IP Address setup, you can choose between static ip, DHCP and loopback, I choose DHCP, my internet router give the IP address in my network
    4. DHCP hostname: in some cases you need to provide this.
  17. Services to Run: select the services that you want to start when the machine boot.
  18. Console font configuration: skipped
  19. Configure hardware clock: choose if the hardware clock is set to local time or UTC, in my case the machine is dual booted with M$ XP so I choose local time
  20. TimeZone Configuration: select your country
  21. Select default window manager for X: KDE!!!
  22. Set root password: you can skip this step if you dont want password for your root account, I choose to put one.
  23. Setup Complete: you can press ctrl+alt+delete to restart to your fresh new shiny and beautifully simple Slackware12!!! :P :D :) ;)
first boot
after the reboot you are welcomed to your new and shiny new Slackware 12 (oh yeah!!!!) linux, I login as root to make some changes to my system:

  1. change the default runlevel to 4, so when my machine start you are welcomed by the kdm instead of the console, if you want to keep the console at the start, you can start the x environment anytime by writing
    #startx
    to do this you need to edit the file /etc/inittab, to do this use the command
    #nano /etc/inittab
    you need to edit the line that says
    id:3:initdefault:
    to this
    id:4:initdefault:
  2. add a new system user to use as everyday account
    #useradd -g users -G audio,video,cdrom -d /home/usuario/ -s /bin/bash -m usuario
  3. add a password for my user
    #passwd usuario
  4. add usuario to the sudoers file so I can make super user actions using sudo, this is done by editing the file /etc/sudoers with the command
    #nano /etc/sudoers

    in the file I add the line
    usuario ALL=(ALL) NOPASSWD: ALL
    this allow me to make changes without having to provide my password.
  5. you can choose some global personalizations, to make them edit the file /etc/profile, in my case I like colors for ls, and see hidden archives with l
    #nano /etc/profile
    add to the end of the file
    alias ls="ls -sh --color=always" alias l="ls -shal --color=always"
    if you want to add personalization only to your account, add them to ~/.bashrc instead.

X11 configuration
to edit X11 configuration i edit the file /etc/X11/xorg.conf with the command
#nano /etc/X11/xorg.conf
the changes are:
  • change the layout of my keyboard to spanish, to do this I add the line
    Option "XkbLayout" "es"
  • I'm using a ATI graphics card so I change the driver to radeon instead of defaults vesa.
    to do this find the section "Device" and and change the driver.
    Section "Device" Identifier "VESA Framebuffer" Driver "ati" #VideoRam 4096 # Insert Clocks lines here if appropriate EndSection
  • Enable 1280x800 resolution of my laptop: to do this you need to add the line
    Modeline "1280x800@75" 83.91 1280 1312 1624 1656 800 816 824 841
    to the section "Monitor" and change to multisync by commenting a line and commenting off another, have to look like this
    # HorizSync 31.5 - 50.0 HorizSync 30-64 # multisync
    after this change the resolution in the file /etc/X11/xorg.conf, find the section "Screen", in the subsection "Display" change so it looks like:
    Subsection "Display"
    Depth 24
    Modes "1280x1024" "1024x768" "800x600" "640x480"
    EndSubsection
And of course the obligatory default desktop screenshot jajaja (scaled to 640x400 from 1280x1024)



ATI Graphics Driver
OFFICIAL ATI SUPPORT IN LINUX SUCKS!!!
The official driver complaints about the X release and die.

Custom Installation
Slackware come with so many packages, And now that X is modular there is a Gazzillion of packages, and I have to machines, so select the packages for both machines is a slow process, so I have decided to create my own personalized installation dvd.
In my case I started by copying the content of the 2 cds isos of slackware and store the result in another directory that I am going to use to create the personalized iso

$mkdir slackD1 $mkdir slackD2 $mkdir mySlack $sudo mount -o loop slack12Disc1.iso slackD1 $sudo mount -o loop slack12Disc2.iso slackD2 $cd myslack $cp ../slackD1/* . -r $cp ../slackD2/* . -r
for the installation process in slackware, the installer seeks in the series directory for a file called tagfile, this is the file that the installer read to know which packages install by default, and wich ones ask for installation in newbie mode and menu.
you can make your custom tagfile and add a 3 letters MS-DOS extension, so you can select a custom tagfile installation just by supplying the extension.
what I am gonna do is change the tagfile changing the packages that I don't want to be installed to OPT and rebuilding the DVD iso to have a media that always install my prefered packages.
the format of the tagfile is this

cpio:ADD cryptsetup:OPT cups:REC cxxlibs:ADD

you can see that there is the name of the package followed by a colon and a description for obligatory (ADD), optional (OPT), and recommended (REC).
I know most of the packages, so it can be quick the process, but in slackare 12 there are so many new packages, if you don't know what is some package for you can read the description in the directory, for example if we want to know what the package cpio-2.5-i486-3.tgz does we can read cpio-2.5-i486-3.txt, it says:

cpio: cpio (backup and archiving utility) cpio: cpio: This is GNU cpio, a program to manage archives of files. This package cpio: also includes mt, a tape drive control program. cpio copies files into cpio: or out of a cpio or tar archive, which is a file that contains other cpio: files plus information about them, such as their pathname, owner, cpio: timestamps, and access permissions. The archive can be another file on cpio: the disk, a magnetic tape, or a pipe.

if you want to see all the descriptions use the command

$for name in *.txt; do less $name; done

after change the file to eliminate the packages that you don't want (4 hours later, X series is soooo Large!!!), go to directory that have the content of the Slackware cds and make a iso image with the command

mkisofs -o ../slackware-dvd.iso \ -R -J -A "Slackware Install" \ -hide-rr-moved \ -v -d -N \ -no-emul-boot -boot-load-size 32 -boot-info-table \ -sort isolinux/iso.sort \ -b isolinux/isolinux.bin \ -c isolinux/isolinux.boot \ -V "SlackDVD" .

then burn with your favorite software, in my case k3b, you can also use nero on windows.
To use your custom tagfiles, when setup ask you for a method of installation, select the option custom tag.

Atheros Wireless
My Laptop is equiped with an Atheros AR5005G 802.11abg NIC (rev 01), to install the support download the driver from atheros, in my case the driver is called madwifi-0.9.3.1.tar.bz2, the steps to set up the driver are:
  1. extract the driver
    $tar -jxf madwifi-0.9.3.1.tar.bz2
  2. enter the directory of the driver
    $cd madwifi-0.9.3.1
  3. make the kernel modules
    $make
  4. install the kernel modules
    $sudo make install
  5. insert the kernel module
    $sudo /sbin/modprobe ath-pci
  6. configure your wireless with kwifimanager :D

VMWARE Workstation/Server
Virtualization is one of those "must have" program, it enables you to to run another OS inside it, it also let you work with multi tier applications, try new software, etc.
To install VMWare on Slackware 12 get the latest version from vmware.com, Version 6 installation is similar to the installation of version 5.5, the steps for the installation are:
  1. get the installer from vmware (the tar.gz version)
  2. unpack the package
    $tar -zxf VMware-whateverVersion-whateverRelease.tar.gz
  3. enter the directory of the unpacked vmware
    $cd vmware-distrib
  4. you will need to patch version 5.x to function properly, to do it get the patch from http://ftp.cvut.cz/vmware
    1. $wget http://ftp.cvut.cz/vmware/vmware-any-any-update109.tar.gz
    2. unpack it on the vmware directory:
    3. $ tar -zxf vmware-any-any-update109.tar.gz
    4. enter the directory of the unpacked patch
      $cd vmware-any-any-update109
    5. run the installer as root
      sudo ./runme.pl
      this is going to patch and then install vmware
    6. end, you dont need to follow next steps
  5. run the installer as root
    sudo ./vmware-install.pl
  6. the installer is going to ask a lot of questions, just press enter and say yes to everything jajaja
note: you may need to start the vmware services when the machine start, to start the services run:

$sudo /etc/init.d/vmware start

and the obligatory screenshot (linux mint bea running in vmware over slackware 12 of course).



Open Office
Damn M$ and its formats!.
Open office is the most capable office suit over linux, and its free.
Slackware Doesn't come with it but install it its a breeze
  1. get the rpm from openoffice.org
  2. unpack it
    $tar -zxf OOo_2.2.0_LinuxIntel_install_en-US.tar.gz
  3. Enter the open office unpack directory
    $cd OOF680_m14_native_packed-1_en-US.9134/RPMS
  4. install it as root:
    $rpm -i --nodeps --force *.rpm
  5. make it a symbolic link to /usr/bin
    $cd /usr/bin
    $sudo ln -s /opt/Openoffice.org2.2/program/soffice .
  6. run it!
    $soffice
Obligatory screenshot


NTFS-3G
I have a dual boot configuration, and have a "Backup unit" in ntfs, because of the limitations of fat32.
To use ntfs-3g on Slackware we will need to install fuse first, to do download the latest version from fuse.sourceforge.net
  1. get the latest version of fuse from fuse.sourceforge.net
  2. unpack it
    $tar -zxf fuse-2.7.0.tar.gz
  3. enter the directory
    $cd fuse-2.7
  4. compile and install it
    $./configure
    $make
    $sudo make install
and now the installation of ntfs-3g
  1. get the latest version of ntfs-3g from ntfs-3g.org
  2. unpack it
    $tar -zxf ntfs-3g-1.616.tgz
  3. enter the directory
    $cd ntfs-3g-1.616
  4. compile and install it
    $./configure
    $make
    $sudo make install
  5. next is to change the /etc/fstab to indicate what partition you want to load with ntfs-3g
    $sudo nano /etc/fstab
    for example the entry would look like this
    /dev/sda2 /mnt/docs ntfs-3g defaylts 1 0

problems
none of this is because of slackware of course ;)
  • X11 is so modular that you may forgot some package and the desktop manager is not going to start, make sure you have installed the package
    iceauth.
  • Use the last version of madwifi, previous versions may not compile
  • Use only the latest versions of anything you want to install, Slackware is just so new!!!

Updates
  • tnx to raskolnikov for the commentary on groups of my user