bueno, en mi trabajo diario me encontré con que voy a programar unas tareas en un servidor linux, y que mejor que un crontab para eso "gracias al ingeniero Amezquita que me dejó la espinita en pregrado", bueno al menos sabia algo del tema, entonces pues... me puse manos a la obra y tengo que poner a correr el siguiente script:
#!/bin/bash
# First check if there is already a restart running
#LOCKFILE=/home/celu/run/restart_new.lock;
#if [ -f $LOCKFILE ]; then
# echo "A restart is already running, or there is a stale lock file";
# exit 1;
#fi
#**************************************************************
# use:
#**************************************************************
if [ "$2" = "KILLING" ]; then
/usr/bin/killall -q -r _57_Movistar.php
fi
# /usr/bin/touch $LOCKFILE;
HOUR=$(date +"%-H");
MINS=$(date +"%-M");
# Demons Control Process (over the date next)
NUMDAEMONS=1;
COUNTER=0;
while [ $COUNTER -lt $NUMDAEMONS ]; do
PROCESO=$(ps x |grep "/home/jvasquezgiraldo/Framework/daemons/Users/UsersCommunities57Movistar.php $NUMDAEMONS $COUNTER" |grep -vw 'grep');
if [ ! "$PROCESO" ]; then
/usr/bin/php /home/jvasquezgiraldo/Framework/daemons/Users/UsersCommunities57Movistar.php $NUMDAEMONS $COUNTER &
sleep 1;
fi
COUNTER=$((COUNTER+1))
done
# Movistar Colombia billing
NUMDAEMONS=7;
COUNTER=0;
while [ $COUNTER -lt $NUMDAEMONS ]; do
PROCESO=$(ps x |grep "/home/jvasquezgiraldo/Framework/daemons/Billing/BillingCommunities57Movistar.php $NUMDAEMONS $COUNTER" |grep -vw 'grep');
if [ ! "$PROCESO" ]; then
/usr/bin/php /home/jvasquezgiraldo/Framework/daemons/Billing/BillingCommunities57Movistar.php $NUMDAEMONS $COUNTER &
sleep 1;
fi
COUNTER=$((COUNTER+1))
done
# Comcel Colombia Rebilling
NUMDAEMONS=12;
COUNTER=0;
while [ $COUNTER -lt $NUMDAEMONS ]; do
PROCESO=$(ps x |grep "/home/jvasquezgiraldo/Framework/daemons/Billing/RebillingCommunities57Movistar.php $NUMDAEMONS $COUNTER" |grep -vw 'grep');
if [ ! "$PROCESO" ]; then
/usr/bin/php /home/jvasquezgiraldo/Framework/daemons/Billing/RebillingCommunities57Movistar.php $NUMDAEMONS $COUNTER &
sleep 1;
fi
COUNTER=$((COUNTER+1))
done
####### DELIVERY PROCCESS
#Control Moderation
NUMDAEMONS=1;
COUNTER=0;
while [ $COUNTER -lt $NUMDAEMONS ]; do
PROCESO=$(ps x |grep "/home/jvasquezgiraldo/Framework/daemons/Delivery/ControlModeration57Movistar.php $NUMDAEMONS $COUNTER" |grep -vw 'grep');
if [ ! "$PROCESO" ]; then
/usr/bin/php /home/jvasquezgiraldo/Framework/daemons/Delivery/ControlModeration57Movistar.php $NUMDAEMONS $COUNTER &
sleep 1;
fi
COUNTER=$((COUNTER+1))
done
#Look for Message in queu
NUMDAEMONS=1;
COUNTER=0;
while [ $COUNTER -lt $NUMDAEMONS ]; do
PROCESO=$(ps x |grep "/home/jvasquezgiraldo/Framework/daemons/Delivery/LookForAlreadyModerates57Movistar.php $NUMDAEMONS $COUNTER" |grep -vw 'grep');
if [ ! "$PROCESO" ]; then
/usr/bin/php /home/jvasquezgiraldo/Framework/daemons/Delivery/LookForAlreadyModerates57Movistar.php $NUMDAEMONS $COUNTER &
sleep 1;
fi
COUNTER=$((COUNTER+1))
done
#Execute the active moderations
NUMDAEMONS=2;
COUNTER=0;
while [ $COUNTER -lt $NUMDAEMONS ]; do
PROCESO=$(ps x |grep "/home/jvasquezgiraldo/Framework/daemons/Delivery/SendModeration57Movistar.php $NUMDAEMONS $COUNTER" |grep -vw 'grep');
if [ ! "$PROCESO" ]; then
/usr/bin/php /home/jvasquezgiraldo/Framework/daemons/Delivery/SendModeration57Movistar.php $NUMDAEMONS $COUNTER &
sleep 1;
fi
COUNTER=$((COUNTER+1))
done
####### FREE CONTENT PROCCESS
#FREE CONTENT
NUMDAEMONS=1;
COUNTER=0;
while [ $COUNTER -lt $NUMDAEMONS ]; do
PROCESO=$(ps x |grep "/home/jvasquezgiraldo/Framework/daemons/Delivery/ControlFreeContent57Movistar.php $NUMDAEMONS $COUNTER" |grep -vw 'grep');
if [ ! "$PROCESO" ]; then
/usr/bin/php /home/jvasquezgiraldo/Framework/daemons/Delivery/ControlFreeContent57Movistar.php $NUMDAEMONS $COUNTER &
sleep 1;
fi
COUNTER=$((COUNTER+1))
done
#####CREDITS
NUMDAEMONS=1;
COUNTER=0;
while [ $COUNTER -lt $NUMDAEMONS ]; do
PROCESO=$(ps x |grep "/home/jvasquezgiraldo/Framework/daemons/Users/UsersCreditsCommunities57Movistar.php $NUMDAEMONS $COUNTER" |grep -vw 'grep');
if [ ! "$PROCESO" ]; then
/usr/bin/php /home/jvasquezgiraldo/Framework/daemons/Users/UsersCreditsCommunities57Movistar.php $NUMDAEMONS $COUNTER &
sleep 1;
fi
COUNTER=$((COUNTER+1))
done
NUMDAEMONS=1;
COUNTER=0;
while [ $COUNTER -lt $NUMDAEMONS ]; do
PROCESO=$(ps x |grep "/home/jvasquezgiraldo/Framework/daemons/Users/UsersPostpaidCommunities57Movistar.php $NUMDAEMONS $COUNTER" |grep -vw 'grep');
if [ ! "$PROCESO" ]; then
# /usr/bin/php /home/jvasquezgiraldo/Framework/daemons/Users/UsersPostpaidCommunities57Movistar.php $NUMDAEMONS $COUNTER &
sleep 1;
fi
COUNTER=$((COUNTER+1))
done
#tesp daemons Negative Credits
NUMDAEMONS=1;
COUNTER=0;
while [ $COUNTER -lt $NUMDAEMONS ]; do
PROCESO=$(ps x |grep "/home/jvasquezgiraldo/Framework/daemons/Users/UsersCreditsCommunities57MovistarNegative.php $NUMDAEMONS $COUNTER" |grep -vw 'grep');
if [ ! "$PROCESO" ]; then
/usr/bin/php /home/jvasquezgiraldo/Framework/daemons/Users/UsersCreditsCommunities57MovistarNegative.php $NUMDAEMONS $COUNTER &
sleep 1;
fi
COUNTER=$((COUNTER+1))
done
llamado communities57Movistar.sh el cual he renombrado a communities57Movistar sin el punto por que he leido que a veces suele poner problemas por el uso de puntos o simbolos en el nombre del archivo.
Las lineas siguientes se deben agregar en el crontab del usuario, eso es lo muy facil, se digita:
crontab -e
y en el editor se pega lo siguiente:
*/15 * * * * sh
/home/celu/bin/communities/communities57Movistar
2 1,18 * * * /usr/bin/php
/home/celu/Framework/daemons/Users/UpdateSigned57Movistar.php
42 2 * * * /usr/bin/php
/home/celu/Framework/daemons/Reports/Reports57Movistar.php
en las lineas anteriores se evidencia que se va a ejecutar una tarea cada 15 minutos "ejecucion del archivo communities57Movistar" el / es para indicar que va a realizarce repetidamente.
Un enlace muy bueno y documentación al respecto se puede encontrar en:
http://www.telefonica.net/web2/dinsalpa/crontab/crontab.htm
o en
http://www.linuxtotal.com.mx/index.php?cont=info_admon_006
espero le sirva a alguien... jejeje, me despido..
Este blog se crea con el objetivo primordial de realizar aportes en el area informatica, acumular y publicar información correspondiente al area del conocimiento de la computacion y realizar debates sanos en cuanto a opiniones fundamentadas.
martes, 15 de mayo de 2012
jueves, 12 de abril de 2012
Instalando Oracle en centos
Proceso Instalación
Base de Datos Oracle Entorno Beta
la forma facil es seguir esta guia que está enla documentacion de oracle DB:
http://www.oracle.com/technetwork/articles/servers-storage-admin/ginnydbinstallonlinux-488779.html
por si acaso el enlace no está disponible en el futuro copio la informacion desde esa fuente, para problemas frecuentes sugiero revisar las rutas asignadas a las variables de entorno creadas:
PATH=$PATH:$HOME/bin
export ORACLE_BASE=/home/oracle/app/oracle
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=prod
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:/usr/lib64
export ORACLE_HOME_LISTNER=$ORACLE_HOME
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME_LISTNER:$PATH
Introducing the
Before installing Oracle Database 12c or 11g
on a system, you need to preconfigure the operating environment since
the database requires certain software packages, package versions, and
tweaks to kernel parameters. (Be sure to review the appropriate Oracle
Database installation guide to familiarize yourself with hardware,
software, and operating system requirements.)
Note: This article applies to Oracle Linux 6. A previous article, "How I Simplified Oracle Database Installation on Oracle Linux," covered performing a similar task on versions of Oracle Linux 5.
On Oracle Linux, I discovered that there is a remarkably easy way to address these installation prerequisites: First, depending on your database version, install either the RPM package called
The
Installing the
The remainder of this article steps through the procedure that I used for installing
Here are the steps for preconfiguring a system for Oracle Database installation using
Also see the blog entry "Oracle RDBMS Server 11gR2 Pre-Install RPM for Oracle Linux 6 has been released": https://blogs.oracle.com/linux/entry/oracle_rdbms_server_11gr2_pre
1. Prerrequisitos
por si acaso el enlace no está disponible en el futuro copio la informacion desde esa fuente, para problemas frecuentes sugiero revisar las rutas asignadas a las variables de entorno creadas:
PATH=$PATH:$HOME/bin
export ORACLE_BASE=/home/oracle/app/oracle
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=prod
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:/usr/lib64
export ORACLE_HOME_LISTNER=$ORACLE_HOME
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME_LISTNER:$PATH
Introducing the oracle-rdbms-server-12cR1-preinstall
and oracle-rdbms-server-11gR2-preinstall
RPM for Oracle Linux
Before installing Oracle Database 12c or 11g
on a system, you need to preconfigure the operating environment since
the database requires certain software packages, package versions, and
tweaks to kernel parameters. (Be sure to review the appropriate Oracle
Database installation guide to familiarize yourself with hardware,
software, and operating system requirements.)
|
On Oracle Linux, I discovered that there is a remarkably easy way to address these installation prerequisites: First, depending on your database version, install either the RPM package called
oracle-rdbms-server-12cR1-preinstall
or oracle-rdbms-server-11gR2-preinstall
. This RPM performs a number of preconfiguration steps, including the following:- Automatically
downloading and installing any additional software packages and
specific package versions needed for installing Oracle Grid
Infrastructure and Oracle Database 12 c Release 1 (12.1) or 11g Release 2 (11.2.0.3), with package dependencies resolved via
yum
orup2date
capabilities. - Creating the user
oracle
and the groupsoinstall
(forOraInventory
) anddba
(forOSDBA
), which are used during database installation. (For security purposes, this user has no password by default and cannot log in remotely. To enable remote login, please set a password using thepasswd
tool.) - Modifying kernel parameters in
/etc/sysctl.conf
to change settings for shared memory, semaphores, the maximum number of file descriptors, and so on. - Setting hard and soft shell resource limits in
/etc/security/limits.conf
, such as the locked-in memory address space, the number of open files, the number of processes, and core file size. - Setting
numa=off
in the kernel for x86_64 machines.
oracle-rdbms-server-12cR1-preinstall
and oracle-rdbms-server-11gR2-preinstall
parses the existing /etc/sysctl.conf
and /etc/security/limits.conf
files and updates values only as needed for database installation. Any
precustomized settings not related to database installation are left as
is.The
oracle-rdbms-server-12cR1-preinstall
and oracle-rdbms-server-11gR2-preinstall
RPM packages are accessible through the Oracle Unbreakable Linux Network (ULN, which requires a support contract), from the Oracle Linux distribution media, or from the Oracle public yum repository. Thus, whether or not your system is registered with ULN to access Oracle patches and support, you can use oracle-rdbms-server-12cR1-preinstall
and oracle-rdbms-server-11gR2-preinstall
to simplify database installation on Oracle Linux. In addition, the
Oracle public yum repository now includes all security and bug errata,
ensuring systems are secured and stable with the latest security updates
and bug fixes.
Installing the oracle-rdbms-server-12cR1-preinstall
or oracle-rdbms-server-11gR2-preinstall
RPM
The remainder of this article steps through the procedure that I used for installing oracle-rdbms-server-11gR2-preinstall
on Oracle Linux via the Oracle public yum repository. The same steps
outlined in the following section can be used for either version of the
preinstall RPM package. I started with a system running Oracle Linux
Release 6 Update 4 for x86_64, a 64-bit version of Oracle Linux that I
downloaded from the Oracle software delivery cloud (requires registration or login). First, I set up a yum
configuration file that pointed to the correct repository, and then I installed the oracle-rdbms-server-11gR2-preinstall
RPM from that repository.Here are the steps for preconfiguring a system for Oracle Database installation using
oracle-rdbms-server-11gR2-preinstall
. Remember, the steps are the same when using the oracle-rdbms-server-12cR1-preinstall
package; you simply need to change the name of the RPM package during the yum installation step.- As an authorized user (for example,
root
), retrieve the file that configures repository locations:
# cd /etc/yum.repos.d # wget http://public-yum.oracle.com/public-yum-ol6.repo
- Using a text editor, modify the file, changing the field
enabled=0
toenabled=1
to reflect repositories that correspond to the machine's operating system release.
Here is an excerpt ofpublic-yum-old6.repo
with the changed lines in boldface.
[ol6_latest] name=Oracle Linux $releasever Latest ($basearch) baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/$basearch/ gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 gpgcheck=1 enabled=1 [ol6_UEK_latest] name=Latest Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch) baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/UEK/latest/$basearch/ gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 gpgcheck=1 enabled=1
Because the target system is running Oracle Linux Release 6 Update 4 for x86_64, which installs the Oracle Unbreakable Enterprise Kernel by default, there are two repositories to enable,[ol6_latest]
and[ol6_UEK_latest]
. - Next, install the
oracle-rdbms-server-11gR2-preinstall
RPM using theyum install
command. If you are using Oracle Database 12c, then you would typeyum install
.
The output in Listing 1 shows how the installation checks dependencies and then downloads and installs the required packages.
# yum install oracle-rdbms-server-11gR2-preinstall Loaded plugins: refresh-packagekit, rhnplugin, security Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-6.el6 will be installed --> Processing Dependency: gcc-c++ for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: gcc for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: libaio-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: libstdc++-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: glibc-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: compat-libstdc++-33 for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: ksh for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: compat-libcap1 for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Running transaction check ---> Package compat-libcap1.x86_64 0:1.10-1 will be installed ---> Package compat-libstdc++-33.x86_64 0:3.2.3-69.el6 will be installed ---> Package gcc.x86_64 0:4.4.6-4.el6 will be installed --> Processing Dependency: cpp = 4.4.6-4.el6 for package: gcc-4.4.6-4.el6.x86_64 --> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.6-4.el6.x86_64 ---> Package gcc-c++.x86_64 0:4.4.6-4.el6 will be installed --> Processing Dependency: libmpfr.so.1()(64bit) for package: gcc-c++-4.4.6-4.el6.x86_64 ---> Package glibc-devel.x86_64 0:2.12-1.80.el6_3.4 will be installed --> Processing Dependency: glibc-headers = 2.12-1.80.el6_3.4 for package: glibc-devel-2.12-1.80.el6_3.4.x86_64 --> Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.80.el6_3.4.x86_64 ---> Package ksh.x86_64 0:20100621-16.el6 will be installed ---> Package libaio-devel.x86_64 0:0.3.107-10.el6 will be installed ---> Package libstdc++-devel.x86_64 0:4.4.6-4.el6 will be installed --> Running transaction check ---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed --> Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64 --> Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64 ---> Package cpp.x86_64 0:4.4.6-4.el6 will be installed ---> Package glibc-headers.x86_64 0:2.12-1.80.el6_3.4 will be installed --> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.12-1.80.el6_3.4.x86_64 --> Processing Dependency: kernel-headers for package: glibc-headers-2.12-1.80.el6_3.4.x86_64 ---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed --> Running transaction check ---> Package kernel-uek-headers.x86_64 0:2.6.32-300.32.1.el6uek will be installed ---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: oracle-rdbms-server-11gR2-preinstall x86_64 1.0-6.el6 ol6_latest 15 k Installing for dependencies: cloog-ppl x86_64 0.15.7-1.2.el6 ol6_latest 93 k compat-libcap1 x86_64 1.10-1 ol6_latest 17 k compat-libstdc++-33 x86_64 3.2.3-69.el6 ol6_latest 183 k cpp x86_64 4.4.6-4.el6 ol6_latest 3.7 M gcc x86_64 4.4.6-4.el6 ol6_latest 10 M gcc-c++ x86_64 4.4.6-4.el6 ol6_latest 4.7 M glibc-devel x86_64 2.12-1.80.el6_3.4 ol6_latest 970 k glibc-headers x86_64 2.12-1.80.el6_3.4 ol6_latest 600 k kernel-uek-headers x86_64 2.6.32-300.32.1.el6uek ol6_latest 713 k ksh x86_64 20100621-16.el6 ol6_latest 684 k libaio-devel x86_64 0.3.107-10.el6 ol6_latest 13 k libstdc++-devel x86_64 4.4.6-4.el6 ol6_latest 1.5 M mpfr x86_64 2.4.1-6.el6 ol6_latest 156 k ppl x86_64 0.10.2-11.el6 ol6_latest 1.3 M Transaction Summary ================================================================================ Install 15 Package(s) Total download size: 25 M Installed size: 61 M Is this ok [y/N]: Downloading Packages: -------------------------------------------------------------------------------- Total 710 kB/s | 25 MB 00:35 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : mpfr-2.4.1-6.el6.x86_64 1/15 Installing : libstdc++-devel-4.4.6-4.el6.x86_64 2/15 Installing : cpp-4.4.6-4.el6.x86_64 3/15 Installing : ppl-0.10.2-11.el6.x86_64 4/15 Installing : cloog-ppl-0.15.7-1.2.el6.x86_64 5/15 Installing : kernel-uek-headers-2.6.32-300.32.1.el6uek.x86_64 6/15 Installing : glibc-headers-2.12-1.80.el6_3.4.x86_64 7/15 Installing : glibc-devel-2.12-1.80.el6_3.4.x86_64 8/15 Installing : gcc-4.4.6-4.el6.x86_64 9/15 Installing : gcc-c++-4.4.6-4.el6.x86_64 10/15 Installing : compat-libstdc++-33-3.2.3-69.el6.x86_64 11/15 Installing : libaio-devel-0.3.107-10.el6.x86_64 12/15 Installing : ksh-20100621-16.el6.x86_64 13/15 Installing : compat-libcap1-1.10-1.x86_64 14/15 Installing : oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 15/15 Verifying : gcc-4.4.6-4.el6.x86_64 1/15 Verifying : compat-libcap1-1.10-1.x86_64 2/15 Verifying : ksh-20100621-16.el6.x86_64 3/15 Verifying : glibc-devel-2.12-1.80.el6_3.4.x86_64 4/15 Verifying : libaio-devel-0.3.107-10.el6.x86_64 5/15 Verifying : oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 6/15 Verifying : gcc-c++-4.4.6-4.el6.x86_64 7/15 Verifying : glibc-headers-2.12-1.80.el6_3.4.x86_64 8/15 Verifying : libstdc++-devel-4.4.6-4.el6.x86_64 9/15 Verifying : compat-libstdc++-33-3.2.3-69.el6.x86_64 10/15 Verifying : mpfr-2.4.1-6.el6.x86_64 11/15 Verifying : kernel-uek-headers-2.6.32-300.32.1.el6uek.x86_64 12/15 Verifying : cpp-4.4.6-4.el6.x86_64 13/15 Verifying : ppl-0.10.2-11.el6.x86_64 14/15 Verifying : cloog-ppl-0.15.7-1.2.el6.x86_64 15/15 Installed: oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-6.el6 Dependency Installed: cloog-ppl.x86_64 0:0.15.7-1.2.el6 compat-libcap1.x86_64 0:1.10-1 compat-libstdc++-33.x86_64 0:3.2.3-69.el6 cpp.x86_64 0:4.4.6-4.el6 gcc.x86_64 0:4.4.6-4.el6 gcc-c++.x86_64 0:4.4.6-4.el6 glibc-devel.x86_64 0:2.12-1.80.el6_3.4 glibc-headers.x86_64 0:2.12-1.80.el6_3.4 kernel-uek-headers.x86_64 0:2.6.32-300.32.1.el6uek ksh.x86_64 0:20100621-16.el6 libaio-devel.x86_64 0:0.3.107-10.el6 libstdc++-devel.x86_64 0:4.4.6-4.el6 mpfr.x86_64 0:2.4.1-6.el6 ppl.x86_64 0:0.10.2-11.el6 Complete!
Listing 1: Installing theoracle-rdbms-server-11gR2-preinstall
RPM
The yum installation logs messages about kernel changes in the file/var/log/oracle-rdbms-server-11gR2-preinstall/results/orakernel.log
, and it makes backups of current system settings in the directory/var/log/oracle-rdbms-server-11gR2-preinstall/backup
. - At this point, the system is ready for the installation of Oracle Database. For example, to install Oracle Database 11g Release 2, follow the directions in Chapter 4, "Installing Oracle Database," of the Database Installation Guide for Linux."
Here are the steps I followed while installing Oracle Database 11g Release 2 in my test environment. Make sure you review all documentation and follow recommended best practices before installing into your production environment.
- As
root
, create a parent directory in a file system that has sufficient space to be the target location for the downloaded files:
# mkdir /home/OraDB11g # cd /home/OraDB11g
The amount of disk space needed in the file system varies according to the specific installation type, but roughly twice the size of the zip archives, or 5 GB, is enough to house the software and data files. - Into this target directory, download the installation media files from the Oracle Database Software Downloads page on Oracle Technology Network.
- Extract the files:
# unzip linux.x64_11gR2_database_1of2.zip # unzip linux.x64_11gR2_database_2of2.zip
- Log in as the user
oracle
. Change directory to thedatabase
directory and enter the following command to run the Oracle Universal Installer:
$ cd /home/OraDB11g/database $ ./runInstaller
oracle-rdbms-server-11gR2-preinstall
installation. During the kernel settings check, the installer might flag a few settings as "failed," and you should investigate these failures. In some cases, you still might be able to continue with the database installation. If you check kernel settings in/etc/sysctl.conf
, you'll see thatoracle-rdbms-server-11gR2-preinstall
has modified and added the necessary settings to ensure the minimum requirements are met, as defined in section 2.10.1, "Displaying and Changing Kernel Parameter Values," in Chapter 2, "Oracle Database Preinstallation Requirements," of the Oracle Database Installation Guide 11g Release2 (11.2) for Linux. Below is the list of requirements:
fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 4294967295 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576
If necessary, you can (asroot
) edit the file/etc/sysctl.conf
to specify a setting manually, for example:
# vi /etc/sysctl.conf # /sbin/sysctl -p
The Oracle Universal Installer performs additional checks, such as verifying theglibc
version, sufficient disk space, environmental variable and path settings, and sufficient physical memory and swap space. Generally, installingoracle-rdbms-server-11gR2-preinstall
takes care of the prerequisites so that you can proceed directly with installing the database. - As
Final Thoughts
Installing theoracle-rdbms-server-12cR1-preinstall
and oracle-rdbms-server-11gR2-preinstall
RPMs can save time when installing Oracle Database 12c and 11g
on Oracle Linux. These RPMs address most Oracle Database installation
prerequisites and greatly simplify the installation process.See Also
Here are the resources referenced earlier in this document:- Oracle Unbreakable Linux Network: https://linux.oracle.com
- Oracle public yum repository: http://public-yum.oracle.com/
- Oracle software delivery cloud (requires registration or login): https://edelivery.oracle.com/linux
- Chapter 4, "Installing Oracle Database," of the Database Installation Guide for Linux: http://docs.oracle.com/cd/E11882_01/install.112/e24321/inst_task.htm#BABBBHJH
- Oracle Database Software Downloads page on Oracle Technology Network: http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
- "About the Oracle RDBMS Pre-Install and Oracle Validated RPMs" from Chapter 1, "Overview of Oracle Database Installation": http://download.oracle.com/docs/cd/E11882_01/install.112/e16763/install_overview.htm#BABDBHCJ
- Chapter 2, "Oracle Database Preinstallation Requirements": http://download.oracle.com/docs/cd/E11882_01/install.112/e16763/pre_install.htm#BABFDGHJ
- "Downloading Oracle Software" from Chapter 4, "Installing Oracle Database," which describes how to download installation files from the Oracle Technology Network Website: http://docs.oracle.com/cd/E11882_01/install.112/e16763/inst_task.htm#autoId6
Also see the blog entry "Oracle RDBMS Server 11gR2 Pre-Install RPM for Oracle Linux 6 has been released": https://blogs.oracle.com/linux/entry/oracle_rdbms_server_11gr2_pre
1. Prerrequisitos
a.
En Servidor
i.
Sistema Operativo CentOS 6.2.
ii.
Window
Manager for X (KDE).
iii.
Configuración de la tarjeta de
red.
iv.
Copiar instaladores de la base
de datos Oracle.
v.
Configurar acceso remoto SSH.
para el archivo .bash_profile del usuario oracle se recomienda seguir o tomar como base el siguiente:
cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
## Changes by Oracle Database Team, Rackspace
export ORACLE_SID=habitat
RAC=NO
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_BASE=/u01/app/oracle
## Change below only, if you know what your doing
export EDITOR=vi
PATH=$ORACLE_HOME/bin:$PATH:/usr/local/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
SORACLE_SID=`echo $ORACLE_SID | tr '[:upper:]' '[:lower:]'`
if [ $RAC = 'NO' ] ; then
SDBNAME=$SORACLE_SID
ORACLE_UNQNAME=$ORACLE_SID
else
SDBNAME=`echo $SORACLE_SID | sed s/.$//`
ORACLE_UNQNAME=`echo $ORACLE_SID | sed s/.$//`
fi
export ORACLE_UNQNAME
alias cdo='cd $ORACLE_HOME'
alias cdb='cd $ORACLE_BASE'
alias bdump='cd $ORACLE_BASE/diag/rdbms/$SDBNAME/$ORACLE_SID/trace'
alias udump='cd $ORACLE_BASE/diag/rdbms/$SDBNAME/$ORACLE_SID/trace'
alias alert='tail -f -n100 $ORACLE_BASE/diag/rdbms/$SDBNAME/$ORACLE_SID/trace/alert_$ORACLE_SID.log'
## End
para el archivo .bash_profile del usuario oracle se recomienda seguir o tomar como base el siguiente:
cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
## Changes by Oracle Database Team, Rackspace
export ORACLE_SID=habitat
RAC=NO
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_BASE=/u01/app/oracle
## Change below only, if you know what your doing
export EDITOR=vi
PATH=$ORACLE_HOME/bin:$PATH:/usr/local/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
SORACLE_SID=`echo $ORACLE_SID | tr '[:upper:]' '[:lower:]'`
if [ $RAC = 'NO' ] ; then
SDBNAME=$SORACLE_SID
ORACLE_UNQNAME=$ORACLE_SID
else
SDBNAME=`echo $SORACLE_SID | sed s/.$//`
ORACLE_UNQNAME=`echo $ORACLE_SID | sed s/.$//`
fi
export ORACLE_UNQNAME
alias cdo='cd $ORACLE_HOME'
alias cdb='cd $ORACLE_BASE'
alias bdump='cd $ORACLE_BASE/diag/rdbms/$SDBNAME/$ORACLE_SID/trace'
alias udump='cd $ORACLE_BASE/diag/rdbms/$SDBNAME/$ORACLE_SID/trace'
alias alert='tail -f -n100 $ORACLE_BASE/diag/rdbms/$SDBNAME/$ORACLE_SID/trace/alert_$ORACLE_SID.log'
## End
b. En Cliente (Maquina remota desde donde se hará la instalación)
i.
Instalar la Herramienta “MobaXterm”
(http://mobaxterm.mobatek.net/download-home-edition.html)
, la cual se utilizara para realizar la conexión SSH.
2.
Configuración VNC
a. Seguir los pasos 1 - 2 de la siguiente guía :
b. Habilitar los puertos de VNC en el archivo /etc/sysconfig/iptables :
# Firewall configuration written by
system-config-firewall
# Manual customization of this file is not
recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j
ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22
-j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with
icmp-host-prohibited
-A INPUT -m state --state NEW -m tcp -p tcp --dport
5801 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport
5901 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport
6001 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport
5802 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport
5902 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport
6002 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport
5800 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport
5900 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport
6000 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport
1521 -j ACCEPT
COMMIT
3.
Configuración del Sistema Operativo
a. Seguir los pasos 1 - 14 de la guía “Instalacion Oracle 11G R2 / Fedora 14 X64”:
4.
Instalación de la Base de Datos
a. Seguir los pasos iniciales para creación de grupos y usuario para
instalar Oracle de la guía Instalacion
Oracle 11G R2 / Fedora 14 X64:
b. Seguir los pasos 13 - 14 de la guía “Step-by-step installing an
Oracle-ready CentOS 6.2 Server”:
c. Seguir todos los pasos de la guía “How to install Oracle 11g
Database Server on CentOS 6.2” :
NOTA: Toda la
instalación se realizo con el usuario root
5.
Configuración del Listener
a. Configurar el hostname en archivo /etc/hosts (HOSTNAME =
cable)
127.0.0.1 cable localhost localhost.localdomain localhost4
localhost4.localdomain4
::1 localhost localhost.localdomain
localhost6 localhost6.localdomain6
b. Seguir todos los pasos de la guía “Configuring a network listener
for Oracle on CentOS 6.2” :
NOTAS:
En caso de
tener problemas con el listener o la conexión desde una maquina externa bajar
las iptables con:
/usr/sbin/service
iptables stop
Lo anterior
con el objetivo de bajar las reglas (firewall) para probar por que en un buen
numero de casos molesta el firewall para realizar la conexión.
O se puede
abrir el puerto 1521 en el archivo iptables (/etc/sysconfig/iptables) como
root, para esto se debe:
CREAR REGLA DE ACCESO IP PARA
ORACLE:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT
Guardar y salir
Y por
ultimo:
/sbin/service
iptables stop
/sbin/service
iptables start
Y en caso
de no subir el servicio para ser usado por el listener entonces se deben usar
los comandos:
Dbca (y crear una nueva base de datos y así normalmente se crean los
2 servicios, la bd debe tener un nombre diferente de la actual)
lsnrctl stop
lsnrctl start (y ya con esto
se pueden ver ya arriba los servicios)
y se puede intentar conectar a la base de datos por medio de las
diferentes SID que se hayan creado para cada BD.
problemas con IP windows
Cuando existan problemas con direcciones IP mal asignadas en Windows se puede usar lo siguiente:
ipconfig /release
ipconfig /renew
y probablemente se arreglen los problemas de conectividad.
ipconfig /release
ipconfig /renew
y probablemente se arreglen los problemas de conectividad.
miércoles, 11 de abril de 2012
Kannel sms gateway
INSTRUCTIVO
DE INSTALACIÓN DE KANNEL
INTRODUCCIÓN
En este
documento se tratará la instalación del SMS Gateway Kannel, en el documento se
podrán encontrar tanto los requisitos como los pasos para la instalación del
mismo.
Tabla de Contenido
Instructivo de Instalación
de Kannel
1.1
Se requieren 2 servidores
(aunque se puede solo en uno), la instalación se realizó sobre 2 servidores con
Sistema operativo Linux CENTOS 6.2. x86_64
1.2
En uno de los servidores se debe instalar
MySQL en su versión 5.1.61 y para la correcta instalación se deben instalar los
siguientes como usuario root paquetes
(se puede encontrar una guía detallada en: http://www.alcancelibre.org/staticpages/index.php/como-mysql-quickstart):
mysql y mysql-server
1.2.1
El Comando de instalación es:
yum -y install mysql mysql-server libssl-dev openssl
(las ultimas 2 librerias es por si se desea agregar soporte para ssl)
1.3
Para que SELinux permita el inicio del servicio se usa:
setsebool -P mysqld_disable_trans 1
1.4
Para poder iniciar el cliente se usa:
setsebool -P allow_user_mysql_connect 1
1.5
Se debe comprobar el manejo del servicio
con:
/sbin/service mysqld start
/sbin/service mysqld restart
/sbin/service mysqld stop
1.6
Para agregar el inicio de MySQL al arranque
del sistema se usa:
/sbin/chkconfig mysqld on
1.7
Ahora para configurar la clave de usuario root
(se debe tener el iniciado el servidor de MySQL “paso 1.5 de esta guia”) se
usa:
mysqladmin
-u root password nueva-clave-de-acceso
1.8.1 Posterior
a la asignación de clave se debe
comprobar el ingreso del usuario root con el comando:
mysql
–u root –p
(clave)
Aparecerá
el promt de mysql y para efectos de pruebas se usará:
show tables;
1.8.2
Se debe crear la base de
datos (kannel) junto con la tabla necesaria (dlr) y sus campos, las sentencias
SQL serán incluidas a continuación:
CREATE DATABASE kannel;
USE kannel;
CREATE TABLE dlr (
smsc varchar(40),
ts varchar(40),
destination varchar(40),
source varchar(40),
service varchar(40),
url varchar(255),
mask int(10),
status int(10),
boxc varchar(40)
);
1.8.3
Se debe crear un usuario y otorgar resposabilidades sobre la tabla (dlr)
para eso se usa:
Aclaraciones:
El campo (xxx.xxx.xxx.xxx) es la ip del servidor donde quedarán los scripts de
kannel (el servidor que se configurará en el siguiente paso de la guía).
CREATE USER 'usuario_kannel'@'xxx.xxx.xxx.xxx' IDENTIFIED BY 'Clave';
GRANT ALL PRIVILEGES ON kannel.dlr TO 'usuario_kannel'@'xx.xx.xx.xx' WITH GRANT OPTION;
exit;
1.8.4
Ahora se debe abrir el puerto en el firewall editando el archivo
(iptables) con el siguiente comando:
vi
/etc/sysconfig/iptables
1.8.4.1
Se debe agregar la siguiente línea(preferiblemente después de la regla
de apertura del puerto de 22 “ssh”):
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
“Se
presiona la tecla (Esc) y se escribe (wq) sin los () o sea wq que quiere decir escribir
y salir. Cabe aclarar que todos los pasos anteriores se deben realizar o
desarrollar como usuario root.”
1.8.5
Se
debe reiniciar el firewall (como usuario root)
con el objetivo de poner en funcionamiento la regla anteriormente creada en el
archivo (iptables), para eso se usa:
/sbin/service iptables restart
Con
lo anterior se da por terminada la parte de instalación y configuración de
MySQL. Creo que aun se preguntarán para que se está haciendo esto, bueno pues
en la base de datos anterior es donde se realiza el registro de las “delivery”
entregas de los mensajes.
1.10
Se debe ingresar al otro
servidor (o sea donde no esté
instalado mysql, se debe ingresar como root)
y se deben instalar los paquetes necesarios para poder proceder a instalar
kannel, para eso se usa:
yum install libxml2 libxml2-devel make posix bison
zlib zlib-devel wget gcc mysql-devel
1.11
Para mayor orden se debe
crear un usuario (kannel), se le debe asignar una clave y se debe ingresar a su
directorio, para eso se usa:
useradd kannel123
passwd kannel123
cd /home/kannel
1.12
Se debe crear la
estructura de directorios para poder almacenar el spool y los logs, para eso se
usa:
mkdir
logs
mkdir
spool
cd
spool
mkdir destino
1.13
Se debe descargar la
version de kannel, para eso se usa:
wget
http://www.kannel.org/download/kannel-snapshot.tar.gz
1.13.1
Se debe descomprimir el
archive descargado y se debe ingresar a la nueva carpeta, para eso se usa:
tar xzf kannel-snapshot.tar.gz
cd kannel-snapshot
1.14
En este momento se
comienza la configuración e instalación de kannel, para eso se usa:
./configure --disable-wap --prefix=/home/kannel
--with-suffix="-test" --with-mysql
make
chmod 0755
gw-config
make install
1.15
Se debe ingresar al
directorio donde están los ejecutables de kannel (bearerbox, smsbox) para eso
se usa:
cd
..
cd
sbin
1.16.1
Para crear smpp.conn se
usa: si se desa agregar el soporte para ssl, se deben agregar las siguientes lineas (
group = core
...
ssl-server-cert-file = "path/filename" ssl-server-key-file = "path/filename" group = smsbox ... sendsms-port-ssl = true)
vi
smpp.conn
Pegar
el siguiente contenido:
group = core
admin-port = 42424
smsbox-port = 42425
admin-password = xyxyxyx
status-password = algo
#admin-deny-ip = ""
#admin-allow-ip = ""
log-level = 0
box-deny-ip = "*.*.*.*"
box-allow-ip = "127.0.0.1"
access-log =
"/home/kannel/logs/access-destino.log"
store-type = "spool"
store-location = "/home/kannel/spool/destino"
dlr-storage = mysql
include = "/home/kannel/sbin/mysql-dlr.conf"
group = smsc
smsc = smpp
smsc-id = CARLOSCAV
host = 109.239.230.44
receive-port = 12586
port = 12586
smsc-username = usuarioxxx
smsc-password = XXXXXXXX (Solicitar la clave de conexion)
#smsc-username =
"usuario"
#smsc-password = "yyyyyyy"
system-type = "premium"
enquire-link-interval = 120
throughput = 80
msg-id-type = 1
log-file =
"/home/kannel/logs/smpp-destino.log"
log-level = 0
# MO routing towards smppbox
#group = smsbox-route
#smsbox-id = "CELUSMSC"
#shortcode = "4242"
# SMSBOX SETUP
group = smsbox
#smsbox-id = "UDO_HTTP"
bearerbox-host = localhost
sendsms-port = 14243
immediate-sendsms-reply = true
sendsms-chars = "0123456789
+-"
log-file = "/home/kannel/logs/smsbox-destino.log"
log-level = 0
http-request-retry = 10
http-queue-delay = 60
# SEND-SMS USERS
group = sendsms-user
username = usuario_lejos
password = password_lejos
user-deny-ip = "*"
user-allow-ip =
"127.0.0.1;190.71.190.100;190.71.190.50;100.230.230.40"
max-messages = 5
concatenation = true
# SERVICES
# there should be default always
group = sms-service
keyword = nop
text = "You asked nothing and I did
it!"
#group = sms-service
#keyword = default
#post-url="http://ustele.semefue.com/la/ruta.php?sms=%a&mobilnummer=%p&konto=%P&operator=500-molestar&land=500"
#max-messages = 5
#concatenation = true
#accept-x-kannel-headers = true
#omit-empty = true
“Se
presiona la tecla (Esc) y se escribe (wq) sin los () o sea wq que quiere decir
escribir y salir. Cabe aclarar que todos los pasos anteriores se deben realizar
o desarrollar como usuario root.”
1.16.2
Ahora se debe crear el
archivo mysql-dlr.conf (recuerde que los archivos deben estar ubicados en el
direcorio /home/kannel/sbin ) para eso se usa:
vi
mysql-dlr.conf
1.16.2.1
Se debe incluir el
contenido, (se debe tener especial cuidado en el cambio de la ip del servidor a
donde se va a conectar) el que es el siguiente:
group = mysql-connection
id = mydlr
host = 102.138.0.25
port=3306
username = usuario_kannel
password = usuario_kannel
database = kannel
max-connections = 1
group = dlr-db
id = mydlr
table = dlr
field-smsc = smsc
field-timestamp = ts
field-destination = destination
field-source = source
field-service = service
field-url = url
field-mask = mask
field-status = status
field-boxc-id = boxc
cualquier duda adicional, ir a:
http://www.kannel.org/download/kannel-userguide-snapshot/userguide.html#SSL-ENABLING
“Se
presiona la tecla (Esc) y se escribe (wq) sin los () o sea wq que quiere decir
escribir y salir. Cabe aclarar que todos los pasos anteriores se deben realizar
o desarrollar como usuario root.”
1.17
Ahora se debe abrir el puerto en el firewall editando el archivo
(iptables) con el siguiente comando:
vi
/etc/sysconfig/iptables
1.17.1
Se debe agregar la siguiente línea(preferiblemente después de la regla
de apertura del puerto de 22 “ssh”):
-A INPUT -m state
--state NEW -m tcp -p tcp --dport 14243 -j ACCEPT
“Se
presiona la tecla (Esc) y se escribe (wq) sin los () o sea wq que quiere decir
escribir y salir. Cabe aclarar que todos los pasos anteriores se deben realizar
o desarrollar como usuario root.”
1.17.2
Se
debe reiniciar el firewall (como usuario root)
con el objetivo de poner en funcionamiento la regla anteriormente creada en el
archivo (iptables), para eso se usa:
/sbin/service
iptables restart
1.18.1 Ahora se pone correr el bearerbox, para eso
se usa:
/home/kannel/sbin/bearerbox-test
-P /home/kannel/sbin/smpp.conn &
1.18.2 Ahora se pone correr el smsbox, para eso se
usa:
/home/kannel/sbin/smsbox-test
-P /home/kannel/sbin/smpp.conn &
Suscribirse a:
Entradas (Atom)