在sqlplus中可用的命令
INSERT INTO DATA_SM_METRIC(UNIQUE_ID,METRIC_REVIEW_CRITERION_DESC,METRICS_REVIEW_CRITERION_VALUE,ENTITY_TYPE,REVIEWCRITERIATYPE,CREATETIME)
SELECT UNIQUE_ID,METRIC_REVIEW_CRITERION_DESC,METRICS_REVIEW_CRITERION_VALUE,ENTITY_TYPE,REVIEWCRITERIATYPE,CREATETIME FROM DATA_SM_METRIC_STG;
当插入到shell脚本中时,它只是暂停,并且从未执行过。 ... stg表被填充,所有记录都被转移到另一个表中。为什么未将其从登台表填充到另一个表中?
脚本:
DATAFILE=$1
SQLPATH=/u01/app/oracle/product/12.2/db_1/bin
SQLPLUS=$SQLPATH/sqlplus
SQLLOADER=$SQLPATH/sqlldr
echo "Start loading file into staging table ->sqlldr $DATAFILE"
$SQLLOADER userid=system/oracle@127.0.0.1:1521/orcl12c
control=./$DATAFILE.ctl data=./$DATAFILE log=./$DATAFILE.log
bad=./$DATAFILE.bad skip=1 errors=100
echo $?
echo "start inserting records......"
rec=`$SQLPLUS -S system/oracle@127.0.0.1:1521/orcl12c <<EOF | sed 1,3d
INSERT INTO CIBC_DATA_SM_METRIC(UNIQUE_ID,METRIC_REVIEW_CRITERION_DESC,METRICS_REVIEW_CRITERION_VALUE,ENTITY_TYPE,REVIEWCRITERIATYPE,CREATETIME)
SELECT UNIQUE_ID,METRIC_REVIEW_CRITERION_DESC,METRICS_REVIEW_CRITERION_VALUE,ENTITY_TYPE,REVIEWCRITERIATYPE,CREATETIME FROM CIBC_DATA_SM_METRIC_STG;
exit
EOF`