Blogia
tecnolakis

Export Modelo

#!/bin/sh
#set -x
## Definicion de variables de ambiente
CORREO_ARCOR="galbarracin@arcor.com,jaranda@arcor.com,cnc_arcor@arcor.com,oractrl@arcor.com,nnano@trimix.com.ar,nicolas.nano@gmail.com,nnosenzo@trimix.com.ar"; export CORREO_ARCOR
ORACLE_BASE=/sacor8/oracle;                      export ORACLE_BASE
ORACLE_HOME=/sacor8/oracle/product/111;     export ORACLE_HOME
NLS_LANG=american_america.WE8ISO8859P1;           export NLS_LANG
PATH=.:$ORACLE_HOME/bin:$PATH;                    export PATH
TNS_ADMIN=$ORACLE_HOME/network/admin;             export TNS_ADMIN
LOGS_HOME=/sacor8/oracle;              export LOGS_HOME
SCRIPTS_HOME=$ORACLE_HOME/SCRIPTS;              export SCRIPTS_HOME

HOST=`hostname|awk ’{print toupper($0)}’`
BACKUP_LOG=$LOGS_HOME/${SID}_STMXDTA_`date +%a`.log;  export BACKUP_LOG
DSMC_LOG=$LOGS_HOME/DSMC_${SID}_STMXDTA_`date +%a`.log; export DSMC_LOG
HORA_INICIO=`date +%d/%m/%Y:%T`

echo "---------------------------------------------------------------------------------------" > $BACKUP_LOG
echo "`date +%Y-%m-%d/%T`                    INICIO EXPORT ${SID}_STMXDTA                   " >> $BACKUP_LOG
echo "---------------------------------------------------------------------------------------" >>$BACKUP_LOG
echo "." >> $BACKUP_LOG

mkfifo /interface/infacor8/TACOR8/DMP/SACOR8/puente_STMXDTA
cat /interface/infacor8/TACOR8/DMP/SACOR8/puente_STMXDTA|gzip > /interface/infacor8/TACOR8/DMP/SACOR8/STMXDTA.dmp.gz &
$ORACLE_HOME/bin/exp backup/exports@${SID} buffer=10000000 file=/interface/infacor8/TACOR8/DMP/SACOR8/puente_STMXDTA log=/interface/infacor8/TACOR8/DMP/SACOR8/STMXDTA.log OWNER=STMXDTA

rm /interface/infacor8/TACOR8/DMP/SACOR8/puente_STMXDTA

tail -1 /interface/infacor8/TACOR8/DMP/SACOR8/STMXDTA.log >> $BACKUP_LOG

echo "." >> $BACKUP_LOG
echo "---------------------------------------------------------------------------------------" >> $BACKUP_LOG
echo "`date +%Y-%m-%d/%T`                  FIN EXPORT ${SID}_STMXDTA                        " >> $BACKUP_LOG
echo "---------------------------------------------------------------------------------------" >> $BACKUP_LOG

HORA_FIN=`date +%d/%m/%Y:%T`
MENSAJE=`tail -1 /interface/infacor8/TACOR8/DMP/SACOR8/STMXDTA.log`
TAMANIO=`ls -l /interface/infacor8/TACOR8/DMP/SACOR8/STMXDTA.dmp.gz|awk ’{print $5/1024/1024/1024}’`


mailx -s "Log Export ${SID}: STMXDTA " ${CORREO_ARCOR} < $BACKUP_LOG
mailx -s "Log Export ${SID}: STMXDTA " ${CORREO_IBM} < $BACKUP_LOG

mailx -s "Log Export ${SID}: ${GRUPO} " ${CORREO_ARCOR} < $BACKUP_LOG

 

 

 

En caso de  utilizar  con  un  archivo  de  parfile   el modelo  cambiaria  a  :

 

$ORACLE_HOME/bin/exp system/mig14@DBTST file=$LOGS_HOME/puente_$GRUPO buffer=60000000 log=$LOGS_HOME/$GRUPO.log STATISTICS=NONE INDEXES=N COMPRESS=N RECORDLENGTH=65535 ROWS=y parfile=/d02/MIGE900.V14/Export/$GRUPO.par
 
 
$GRUPO.par
 
TABLES=E900DTA.F4211

0 comentarios