четверг, 10 октября 2013 г.

Asterisk convert sounds

ls -1| awk -F. ' {print $1}'| xargs -n 1 --replace=$ sox -r 6000 $.vox -r 8000 $.gsm resample -ql
ls -1| awk -F. ' {print $1}'| xargs -n 1 --replace=$ astconv /usr/lib64/asterisk/modules/codec_g729.so -e 160  $.alaw $.g729

суббота, 28 сентября 2013 г.

monit and qmail

Usualy monit use pid file to monitoring process, for example
check process postfix with pidfile /var/spool/postfix/pid/master.pid
I don't find qmail pid file and use new feature in 5.2.4 - procmatch
Epel repo(6 version) have 5.1.1 version that don't support this feature
Therefore, you have to download binary from http://mmonit.com/monit/download/
and use it.

#Example
check process qmaild matching "qmail-snmpd"
   alert xxx@yyy.com but not on {pid, ppid, uptime}
   group qmail
   start program = "/etc/init.d/qmail start"
   stop  program = "/etc/init.d/qmail stop"
   if failed port 25 protocol smtp then restart
   if 5 restarts within 5 cycles then timeout


You can use monit wrapper method as well.
#Example 
/etc/monit.d/qmailwrap:

check process qmailwrap with pidfile /var/run/qmailwrap.pid
    alert xxx@yyy.com 
    start program = "/var/qmail/qmailwrap.sh start"
    stop  program = "/var/qmail/qmailwrap.sh stop"
    if failed host a.b.c.d port 25 type tcp then alert
    if 5 restarts within 5 cycles then timeout

/var/qmail/qmailwrap.sh:

#!/bin/bash
case $1 in
    start)
       echo $$ > /var/run/qmailwrap.pid;
       exec 2>&1 /var/qmail/supervise/qmail-smtpd/run   1>/var/log/qmailwrap.log
       ;;
     stop)
       kill `cat /var/run/qmailwrap.pid` ;;
     *)
       echo "usage: qmailwrap {start|stop}" ;;
 esac
 exit 0

/var/qmail/supervise/qmail-smtpd/run:
#!/bin/sh

QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
LOCAL=`head -1 /var/qmail/control/me`

if [ -z "$QMAILDUID" -o -z "$NOFILESGID" -o -z "$MAXSMTPD" -o -z "$LOCAL" ]; then
    echo QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset in
    echo /var/qmail/supervise/qmail-smtpd/run
    exit 1
fi

if [ ! -f /var/qmail/control/rcpthosts ]; then
    echo "No /var/qmail/control/rcpthosts!"
    echo "Refusing to start SMTP listener because it'll create an open relay"
    exit 1
fi

exec /usr/local/bin/softlimit -m 40000000 \
 /usr/local/bin/tcpserver -v -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \ -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp /var/qmail/bin/qmail-smtpd 2>&1


http://cr.yp.to/qmail.html
http://www.lifewithqmail.org/lwq.html


четверг, 12 сентября 2013 г.

DataPump Import With Object Types Fails With Errors ORA-31693 ORA-2354 ORA-39779 ORA-00600

Error:
ORA-31693: "AAA"."BBB"
ORA-00600:  [kpudpxcs_getCol_ref_4], [Imgver=8 InputStrmVer=9 Name=XXX], [], [], [], [], [], [], [], [], [], []
 or
ORA-39779:

Solution:
Please pre-create the object type(in collumn XXX table "AAA"."BBB" ) in the target database and then retry the DataPump import with the following additional parameter:
TRANSFORM=oid:n

https://support.oracle.com/epmos/faces/DocumentDisplay?id=404234.1

понедельник, 15 апреля 2013 г.

dbv script for ASM datastore


select 'dbv file='''||file_name||''' blocksize='||df2.BLOCK_SIZE||' userid=sys/xxx logfile=dbv-'||tablespace_name||'.log' from dba_data_files df,v$datafile df2
where  df.file_id = df2.FILE#

среда, 10 апреля 2013 г.

minimum size oracle bigfile tablespace


for normal tablespace:
Metalink ID 153869.1
CREATE TABLESPACE minimum_data DATAFILE '/u00/minimum_data.dbf' SIZE 88k LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO


for bigfile tablespace:
CREATE BIGFILE TABLESPACE minimum_data DATAFILE '/u00/minimum_data.dbf' SIZE 145k LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO


четверг, 28 марта 2013 г.

RDAC and Oracle Linux 6.4 boot from SAN DS35xx


Check  kernel-uek-devel package
# rpm -qa| grep kernel-uek-devel
kernel-uek-devel-2.6.39-400.17.2.el6uek.x86_64

Download latest driver from:
RDAC driver homepage

Compile driver:
make
make install

Use mpp-2.6.39-400.17.2.el6uek.x86_64.img in catalog /boot
or
Make initramfs(before make backup of original initramfs):
dracut -f

Check it.

/boot/efi/EFI/redhat/grub.conf:

title Oracle Linux Server (2.6.39-400.17.2.el6uek.x86_64)
        root (hd0,1)
        kernel /vmlinuz-2.6.39-400.17.2.el6uek.x86_64 ro root=/dev/mapper/vg_db06-lv_root rd_NO_LUKS rd_LVM_LV=vg_db06/lv_root LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16   KEYBOARDTYPE=pc KEYTABLE=u
s rd_NO_DM rhgb quiet
        initrd /mpp-2.6.39-400.17.2.el6uek.x86_64.img

or

title Oracle Linux Server (2.6.39-400.17.2.el6uek.x86_64)
        root (hd0,1)
        kernel /vmlinuz-2.6.39-400.17.2.el6uek.x86_64 ro root=/dev/mapper/vg_db06-lv_root rd_NO_LUKS rd_LVM_LV=vg_db06/lv_root LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16   KEYBOARDTYPE=pc KEYTABLE=u
s rd_NO_DM rhgb quiet


        initrd /initramfs-2.6.39-400.17.2.el6uek.x86_64.img

Note: Modifying the /etc/modprobe.conf file to configure the HBA driver to be a
non-failover driver as explained previously is not necessary if you plan to use RDAC as the
multipathing driver. The reason is that RDAC will put and activate the same parameter into
the file /opt/mpp/modprobe.conf.mppappend during the RDAC installation to force the
QLogic driver to load the non-failover mode.


If any changes are made to the MPP configuration file (/etc/mpp.conf) or persistent binding
file (/var/mpp/devicemapping), then the mppUpdate executable can be used to rebuild the
RAMdisk.



After reboot:

[root@db06 ~]# lsmod| grep mpp
mppVhba               139668  3
mppUpper              157843  1 mppVhba
[root@db06 ~]# modinfo mppVhba
filename:       /lib/modules/2.6.39-400.17.2.el6uek.x86_64/kernel/drivers/scsi/mppVhba.ko
supported:      yes
version:        09.03.0C05.0642
license:        GPL
description:    MPP Virtual HBA Driver
author:         NetApp, Inc.
srcversion:     8FA0CDD56E4F43D69A5FB7A
depends:        mppUpper
vermagic:       2.6.39-400.17.2.el6uek.x86_64 SMP mod_unload modversions
[root@db06 ~]# modinfo mppUpper
filename:       /lib/modules/2.6.39-400.17.2.el6uek.x86_64/kernel/drivers/scsi/mppUpper.ko
supported:      yes
version:        09.03.0C05.0642
license:        GPL
description:    MPP Upper Level Driver
author:         NetApp, Inc.
srcversion:     A44FFC021138064A26E1CC7
depends:
vermagic:       2.6.39-400.17.2.el6uek.x86_64 SMP mod_unload modversions


[root@db06 /]# ls -lR /proc/mpp
/proc/mpp:
total 0
dr-xr-xr-x 4 root root 0 Mar 28 16:12 ds3524

/proc/mpp/ds3524:
total 0
dr-xr-xr-x 3 root root 0 Mar 28 16:12 controllerA
dr-xr-xr-x 3 root root 0 Mar 28 16:12 controllerB
-rw-r--r-- 1 root root 0 Mar 28 16:12 virtualLun0
-rw-r--r-- 1 root root 0 Mar 28 16:12 virtualLun1

/proc/mpp/ds3524/controllerA:
total 0
dr-xr-xr-x 2 root root 0 Mar 28 16:12 qla2xxx_h1c0t0

/proc/mpp/ds3524/controllerA/qla2xxx_h1c0t0:
total 0
-rw-r--r-- 1 root root 0 Mar 28 16:12 LUN0
-rw-r--r-- 1 root root 0 Mar 28 16:12 LUN1

/proc/mpp/ds3524/controllerB:
total 0
dr-xr-xr-x 2 root root 0 Mar 28 16:12 qla2xxx_h0c0t0

/proc/mpp/ds3524/controllerB/qla2xxx_h0c0t0:
total 0
-rw-r--r-- 1 root root 0 Mar 28 16:12 LUN0
-rw-r--r-- 1 root root 0 Mar 28 16:12 LUN1


[root@db06 /]# mppUtil -a

Hostname    = db06.core.kran
Domainname  = (none)
Time        = GMT 03/28/2013 08:20:49

---------------------------------------------------------------
Info of Array Module's seen by this Host.
---------------------------------------------------------------
ID              WWN                      Type     Name
---------------------------------------------------------------
 0      60080e50002f084800000000510057b6 FC     ds3524
---------------------------------------------------------------
[root@db06 /]# /opt/mpp/lsvdev
        Array Name      Lun    sd device
        -------------------------------------
        ds3524          0     -> /dev/sda
        ds3524          1     -> /dev/sdb