2008年8月26日星期二

Two stress test tools for oracle DBMS

Keyword:
test,stress

1)Orabm:an Open Source suite to test CPU Performance under a CPU-intensive Oracle workload.
http://www.linxcel.co.uk/orabm/orabm.tar
2)Orastess!:a tool to generate a multi-session, multi-instance, multi-mode workload from a single command line.
http://www.linxcel.co.uk/orabm/orastress.zip

2008年8月22日星期五

The Linux Boot Process

Keywords
loading GRUB initrd init

Booting Process
1.GRUB booting

+-----------------------+
| +---------+ |---------------+
| | V V V
+|+++++++++++++++++++++|++++++++++++++++++++++++++++++++
= ===================== ================================
| | ha1 | | hda2 |
| | | stage2/Linux
| | stage1.5/Boot sector of second partition
| Dos/Boot sector of first partition
GRUB stage1/LILO/MBR

Stage 1 is what is present in the main boot record and merely loads the next stage.Stage 1.5 is also quite sall, but is able to understand filesystems.Depending what filesystem contains the Stage 2 loader, a different stage 1.5 is used and is even optional in some circumstances.
Stage 2 is the meat of the loader and contains many features and options that can be explored. Because GRUB understands partitions and filesystem,it can load a kernel that it wasn't told about previously.

2.Follow up booting Kernel(kernel and initrd)

kernel
+->setup
+->switch to Protected Mode(PM)
+->decompress_kernel()
+->start_kernel() <- PID 0
+->kernel_thread()
+->init <- PID 1

kernel: base booting code,all kinds of hardware driver in initrd(boot loader initalized RAM disk).If booting not appointed initrd.img file,booting failed:"Kernel panic:VFS: Unable to mount root fs on 08:06". initrd.img is guzip -9 zip and ramdisk file. gunzip initrd.img ,You can see /bin/nash command and init script. nash(not a sheel)?nash is a very simple script interpretor designed to be as small as possible. init file is booting script.It's command see man nash.Line mkrootdev /dev/root,root is a GRUB root=,mount filesystem root.Next process init process can read /etc/inittab ,wreate syslog ...... See screen Outcome:Switching to new root. kernel booting end.

3.
init
It's run under the kernel.This program is always process 1.The kernel can be told which program to use as init by passing the "init=" boot parameter. If this paramenter is not specified, then the kernel will try to execute '/sbin/init','/etc/init','/bin/init' or '/bin/sh' in that order.
The init program read it's configuration from the '/etc/inittab'.

4.Runlevel Scripts
Read '/etc/inittab'.The inittab file describes which processes are started at bootup and during normal operation (e.g./etc/init.d/boot, /etc/init.d/rc, gettys...). Init(8) distinguishes multiple runlevels, each of which can have its own set of processes that are started. Valid runlevels are 0-6 plus A, B, and C for ondemand entries.


2008年8月20日星期三

Linux Booting: init (/sbin/init) failed !!!: 2

Title:
Linux booting fail (init failed!!!:2) rescue.
Keywords:
init sh rpm faile
Problem:
exec of init (/sbin/init) failed !!!: 2
umount /initrd/dev failed: 2
Kernel panic - not syncing: Attempted to kill init!

I entered the rescue mode and attempted
chroot /mnt/sysimage
It spitted an error

"chroot : cannot execute /bin/sh: Accessing a corrupted shared library."
Solution:
On a working machine:
# ldd /sbin/init
/usr/lib/libcwait.so (0x00eba000)
libsepol.so.1 => /lib/libsepol.so.1 (0x005f9000)
libselinux.so.1 => /lib/libselinux.so.1 (0x00a11000)
libc.so.6 => /lib/tls/libc.so.6 (0x004cd000)
/lib/ld-linux.so.2 (0x004b0000)

# ldd /bin/sh
/usr/lib/libcwait.so (0x00b6d000)
libtermcap.so.2 => /lib/libtermcap.so.2 (0x00831000)
libdl.so.2 => /lib/libdl.so.2 (0x0061e000)
libc.so.6 => /lib/tls/libc.so.6 (0x004cd000)
/lib/ld-linux.so.2 (0x004b0000)
S1:
If working machine and fail machine kernel version same,you can:
#rsync -ave ssh root@WorkingMachineIP:/usr/lib /mnt/sysimage/usr/.
#rsync -ave ssh root@WorkingMachineIP:/lib /mnt/sysimage/.
snyc command and exit reboot machine,check other error.
S2:
You shoud try to check these package :
# rpm -V --root /mnt/sysimage libtermcap glibc
and be ready to resinstall them if required
# rpm -ivh --force --root /mnt/sysimage /yoursource/libtermcap-*.rpm /yoursource/glibc-*.rpm
Then you should be able to make your chroot
In anyway identify all your corrupted files using
# rpm -Va
And reinstall the corrupted packages