卐卍 发表于 2012-11-03 09:36

onpladm迁移数据简单应用

本帖最后由 卐卍 于 2012-11-15 15:46 编辑

运行sh down.sh databasename

卸载.shINFORMIXDIR=/home/informix
PATH=$PATH:$HOME/bin:.:$INFORMIXDIR/bin         
INFORMIXSERVER=test
export INFORMIXDIR PATH INFORMIXSERVER
DBDATE=mdy4
export DBDATE

starttime=`date +%Y%m%d_%H:%M:%S`
printf "Begin time:$starttime\n"
filepath=/home/test/nfsshare/$1

rm -rf $filepath
mkdir $filepath
cd $filepath

dbaccess $1<<!
      unload to $1.unl
      select tabname from systables where tabid>'99' and tabtype='T';
!

onpladm create project p$1
tables=$(cut -d '|' -f1 $PWD/$1.unl)
for tablesname in $tables
do
        onpladm create job $tablesname -p p$1 -d $tablesname.unl -D $1 -t $tablesname -fu
        onpladm run job $tablesname -p p$1 -fu
        onpladm delete job $tablesname -p p$1 -fu
done
onpladm delete project p$1


chmod 777 *.unl
endrun=`date +%Y%m%d_%H:%M:%S`
printf "End time:$endrun\n"
装载.shINFORMIXDIR=/home/informix
PATH=$PATH:$HOME/bin:.:$INFORMIXDIR/bin         
INFORMIXSERVER=test
export INFORMIXDIR PATH INFORMIXSERVER
DBDATE=mdy4
export DBDATE

starttime=`date +%Y%m%d_%H:%M:%S`
printf "Begin time:$starttime\n"
filepath=/nfsshare/$1

cd $filepath


onpladm create project p$1
tables=$(cut -d '|' -f1 $PWD/$1.unl)
for tablesname in $tables
do
        onpladm create job $tablesname -p p$1 -d $tablesname.unl -D $1 -t $tablesname -fl
        onpladm run job $tablesname -p p$1 -fl
        onpladm delete job $tablesname -p p$1 -fl
done
onpladm delete project p$1

cd /tmp

onpladm create project pi$1
tables=$(grep "16110" *.log | cut -d '.' -f1)
cd $filepath
for tablesname in $tables
do
      onpladm create job $tablesname -p pi$1 -d $tablesname.unl -D $1 -t $tablesname -flc
      onpladm run job $tablesname -p pi$1 -flc
      onpladm delete job $tablesname -p pi$1 -flc
done
onpladm delete project pi$1


endrun=`date +%Y%m%d_%H:%M:%S`
printf "End time:$endrun\n"
页: [1]
查看完整版本: onpladm迁移数据简单应用