Realizar export

Hola
me podrian ayudar a realizar un export en oracle 8i y en una maquina solaris, pero quiero que la maquina solaris lo realice cada determinado tiempo.
como se podria realizar esa sentencia.
garcias anton
Respuesta
1
Creas un shell script y montas un cron en tu sistema operativo anexo te envio los pasos:
El archivo export. Sh:
#!/bin/sh
# export.sh - version: 1.0
# Script para exportar bases de datos ORACLE
#
[ $# -eq 1 ] || {
echo "Usage: $0 ORACLE_SID"; exit 2
}
# Set up the Oracle variables:
export ORACLE_HOME=/home/ora9i/product/9i2
export ORACLE_SID=$1
# Set up the Oracle Lenguage variables:
export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
# Set up the search paths:
export PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:/usr/lib:/$ORACLE_HOME/lib
# Set up the local variables and Export directory:
dir_sid=`echo ${ORACLE_SID}|tr A-Z a-z`
dir_exp=/u3/export/${dir_sid}
gzip=/bin/gzip
hecho()
{
mail oracle <<!
$*
!
}
error()
{
mail oracle <<!
$*
!
exit 1
}
cd ${dir_exp}
for userpasswd in `cat ../.userpasswd`
do
user=`echo ${userpasswd}|cut -d/ -f1`
exp ${userpasswd} \
FILE=${dir_exp}/${user}.dmp \
FEEDBACK=50000 \
LOG=${dir_exp}/${user}.log
$gzip ${dir_exp}/${user}.dmp || error "${user}.dmp.gz Can't Create"
$gzip ${dir_exp}/${user}.log || error "${user}.log.gz Can't Create"
done
cd ..
fecha=`date +'%Y%m%d%H%M'`
/bin/tar cvf ${dir_exp}/${ORACLE_SID}_${fecha}.tar ${dir_sid}/*.gz &&
hecho "${ORACLE_SID}_${fecha}.tar Created" ||
error "${ORACLE_SID}_${fecha}.tar Can't Create"
# Remove temporary files
rm -f ${dir_exp}/*.dmp ${dir_exp}/*.log ${dir_exp}/*.gz
# EOF
El archivo de usuarios a exportar .userpasswd:
ADM/ADM
BM/BM
CAT/CAT
CNT/CNT
PRE/PRE
RH/RH
RM/RM
RST/RST
SIS/SIS
Y configuras el cron en las fechas que quieras!

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas