Jumat, 30 Desember 2011

Using Centos DVD as Yum Repository

Centos coming with dvd/cd as installation media, in some case you want to use it as yum repository. In this tech tips posting, I used centos 6.1 DVD#1. 

1. Mount your dvd media under one of this directory as default :
 a. /media/CentOS/
 b. /media/cdrom/
 c. /media/cdrecorder/

2. edit the configuration : # vi /etc/yum.repos.d/CentOS-Media.repo
      make sure enabled = 1
3. Test # yum --disablerepo=\* --enablerepo=c5-media install groupinstall "X Window System" "GNOME Desktop Environment"

Sabtu, 17 Desember 2011

create directory at the same time command 1 of 12

create directory /oracle/oradata 1 of 12


bash>perl -e 'for (1..12) {system("mkdir -p /oracle/oradata$_")};'

create directory {/oraindex } {redolog} {ctl} 1 of 12

bash>perl -e 'for (1..12) {system("mkdir oraindex$_")};'
bash>perl -e 'for (1..12) {system("mkdir redolog$_")};'
bash>perl -e 'for (1..3) {system("mkdir ctl$_")};'


remove directory /oraindex12 of 71 


bash>perl -e 'for (12..71) {system("rm -rf  oraindex$_")};'

SVM standarisasi ku

prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2


usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk/dev/rdsk/c0t1d0s2


metadb -a -f -c 3 c0t0d0s7
metadb -a -f -c 3 c0t1d0s7


echo set md:mirrored_root_flag=1 >> /etc/system

for /
===============================
metainit -f d0 1 1 c0t0d0s0
metainit -f d1 1 1 c0t1d0s0
metainit d2 -m d0
metaroot d2
init 6
metattach d2 d1
metastat d2

===============================

for swap
===============================
metainit -f d3 1 1 c0t0d0s1
metainit -f d4 1 1 c0t1d0s1
metainit d5 -m d3
metattach d5 d4
metastat d5

for /var
===============================
metainit -f d6 1 1 c0t0d0s3
metainit -f d7 1 1 c0t1d0s3
metainit d8 -m d6
metattach d8 d7
metastat d8

for /opt
===============================
metainit -f d9 1 1 c0t0d0s4
metainit -f d10 1 1 c0t1d0s4
metainit d11 -m d9
metattach d11 d10
metastat d11


for /usr/openv
===============================
metainit -f d12 1 1 c0t0d0s5
metainit -f d13 1 1 c0t1d0s5
metainit d14 -m d12
metattach d14 d13
metastat d14

for /data
===============================
metainit -f d15 1 1 c0t0d0s6
metainit -f d16 1 1 c0t1d0s6
metainit d17 -m d15
metattach d17 d16
metastat d17


# metastat | grep progress
# while true;  do metastat | grep progress;  sleep 5;  done
EDIT
/etc/vfstab

CHECK eeprom
#ls -l /dev/dsk/c0t0d0s0 -> ../../devices/pci@1e,600000/ide@d/sd@0,0:a
#ls -l /dev/dsk/c0t1d0s0 -> ../../devices/pci@1e,600000/ide@d/sd@1,0:a

You will need to update the bold part above, with your output. You will then run the following command from the OS

# eeprom "nvramrc=devalias rootdisk /pci@1e,600000/ide@d/disk@0,0:a devalias rootmirr /pci@1e,600000/ide@d/disk@1,0:a"
# eeprom boot-device="rootdisk rootmirr"
# eeprom "use-nvramrc?=true"

Boot archive error or corrupt


A few weeks ago, I got a little problem with my solaris box, namely solaris won't boot because the boot archive was corrupt, *sigh*. Anyway the boot archive in solaris 10 was contain kernel module and configuration file was needed for solaris to startup the system.
Error:
module /platform/i86pc/boot_archive error 3 bad or corrupt data while decompressing file
Workaround:
Boot up your solaris in "solaris failsafe mode", next solaris image will mount with writeable mode on "/a" mount point

ok> boot -F failsafe

bash> rm -f /a/platform/`uname -i`/boot_archive
bash> bootadm update-archive -R /a
bash> reboot

Kill Many* Jobs

When I want to shutdown the oracle database.

I must kill many session client who connect to the database and running in background Os...

bash> ps -ef|grep -i local=no
oracle 19027     1  0   Sep 07 ?        0:01 oracleSERVER (LOCAL=NO)
oracle 25918     1  0   Sep 07 ?        0:03 oracleSERVER (LOCAL=NO)
oracle 16403     1  0   Sep 07 ?        0:00 oracleSERVER (LOCAL=NO)
oracle 18858     1  0   Sep 06 ?        0:01 oracleSERVER (LOCAL=NO)
oracle  7836     1  0   Sep 07 ?        0:02 oracleSERVER (LOCAL=NO)
oracle  9021     1  0   Sep 07 ?        0:00 oracleSERVER (LOCAL=NO)

Show this the trick (when Nobody give up..:D)

bash> ps -ef|grep LOCAL|awk '{print $2'}|xargs kill -9