|
|
Archives of the TeradataForum
Message Posted: Fri, 09 Mar 2007 @ 13:40:52 GMT
Subj: | | Re: Using FastEXport with Named Pipes |
|
From: | | Bernard, Vincent |
This works for me.
Vincent Bernard
Teradata
Certified
Administrator
------------ starting file-------------------------------------
/usr/bin/bteq < $LOGS/db_table_list_p2d.log
.errorout stdout
.logon $sv1/$sv2,$sv3;
.os cat /dev/null > $LOGS/table_list_p2d
.export file=$LOGS/table_list_p2d
select trim(tablename) (title '')
from dbc.tables
where databasename='$sdatabasename'
and tablekind='t'
order by tablename
;
.export reset
.quit;
!
if test -s $LOGS/table_list_p2d
then
for I in `cat $LOGS/table_list_p2d`
do
export tablename=$I
export logname=`echo $tablename | cut -c 1-30`
. $RUN/tfr_table_m.sh
while ((`ps -ef |grep mload |wc -l` > 4))
do
sleep 20
done
done
else
echo no table found in $sdatabasename
fi
----------------------------call fast exp and mload-------------------
#!/usr/bin/ksh
/usr/bin/fexp <$LOGS/fexp_$tablename.log
#!/usr/bin/ksh
if test -p $AMJ/$tablename.pipe
then
echo $AMJ/$tablename.pipe already exist > /dev/null
else
/sbin/mknod $AMJ/$tablename.pipe p
fi
. $FEXP/fexp_table.sh 2>&1 &
. $MLOAD/ml_table.sh 2>&1 &
-------------------------- fast export -------------------------------
#!/usr/bin/ksh
/usr/bin/fexp <$LOGS/fexp_$tablename.log
.logtable $sdatabasename.fexp_$logname;
.logon $sv1/$sv2,$sv3;
database $sdatabasename;
.begin export ;
.export outfile $AMJ/$tablename.pipe;
lock $tablename access
select * from $tablename;
.end export ;
.logoff;
!
------------------------------- mload -------------------------------
#!/usr/bin/ksh
echo $tdatabasename
export LIB=/usr/lib
/usr/bin/mload <$LOGS/ml_$tablename.log
.logtable $tdatabasename.ml_$logname;
.logon $tv1/$tv2,$tv3;
database $tdatabasename;
.begin import mload tables $tablename
worktables wt_$logname
errortables et_$logname uv_$logname
sessions 8 4
;
.layout transaction indicators;
.table $tablename;
.dml label inserts;
insert into $tablename.*;
.import infile $AMJ/$tablename.pipe
layout transaction
apply inserts ;
.end mload;
logoff;
!
| |