ogg中logdump使用自动输入执行

#!/bin/bash

now_time=$(date "+%Y%m%d%H%M%S")
cd /u02/goldengate/dirrpt
cp repep.dsc /home/oracle/dirrpt/repep${now_time}.dsc
cp REPEP.rpt /home/oracle/dirrpt/REPEP${now_time}.rpt
rpt_file=/home/oracle/dirrpt/REPEP${now_time}.rpt

error_rba=`cat $rpt_file|grep "RBA:"|sed s/[[:space:]]//g|cut -d ":" -f 2`
rba_file=`cat $rpt_file|grep "FILE:"|sed s/[[:space:]]//g|cut -d ":" -f 2`

echo 'error_rba='$error_rba
echo 'rba_file='$rba_file

echo>/u02/goldengate/dirrpt/repep.dsc

echo -e "open /u01/ogg/dirdat/ep000000000;pos 1340188;n;n"|/u01/ogg/logdump|grep "RBA"|awk 'END {print}'|awk '{print $NF}'

你可能感兴趣的:(ogg中logdump使用自动输入执行)