主要利用pmrep的objectimport命令,该命令执行时需要配置control file(xml文件,配置导入的一些参数和设置)
script:
#!/bin/bash
# -----------------------------------------------------------------------
# Script Name: inf_impobj.sh
# Purpose: To batch import mappings or workflows into repository
# Created by: Indifferent_to
# Date: 2014-09-30
# ----------------------------------------------------------------------
function usage {
cat <<EOUSAGE
Usage:
inf_impobj.sh -d <folder> <user_name>
This scirpt will import the file in specified directory.It has a control
file import_Infa_Objects_Control.txt and a log Infa_import.log.txt. If file
import into repository successfully, script wil delete the file. If not,
the file will be moved to infa_shared/scripts/xml_dir/imp_dir.
Options:
-m xml files location
Example:
inf_impobj.sh -m mluo
EOUSAGE
exit 1
}
# -----------------------------------------------------------------------
case $1 in
-d)
IMP_PATH=$2/*.xml
shift 1
;;
*)
usage;;
esac
USE_NAME=$2
i=0
j=0
repository="repository name"
domain="repository domain"
host="informatica server host name"
port="informatica server port number"
pmrep connect -r $