Shell脚本从oracle应用程序运行时访问DB目录文件夹的程序

时间:2018-06-05 14:44:25

标签: shell unix

程序应该转到 DB目录文件夹 / u01 / app / oracle / admin / ibmcp1 / inbound / 并使用 IBM.SOURCE.INVE.xml 的文件名编写 OUTBOUND.txt 文件。

但是日志文件如下所示:我是从应用程序服务器上的oracle应用程序concurrernt manager运行这个shell script.prog 它正在尝试搜索DB目录,但此DB目录位于DB节点中。

你可以告诉我如何解决这个问题。

===========================
#!/bin/ksh
p_login_info=`echo $1`
PATH_PREFIX=/u01/app/oracle/admin/
PATH_SUFIX=/cfs_ipp_interface/file_repository/inbound/
FILE_PREFIX=IBM.SOURCE.INVE
table="v\$instance"
echo "Change Directory"
INSTANCE=`sqlplus -s $p_login_info <<-EOSQL1
set heading off
SELECT instance_name FROM $table;
EXIT;
/
EOSQL1`
echo "Instance="$INSTANCE
INSTANCE=$(echo $INSTANCE |sed 's/ no/no/g' )
FILE_PATH=$PATH_PREFIX$INSTANCE$PATH_SUFIX
echo "File Path= "$FILE_PATH
cd $FILE_PATH
LOGFILE=$FILE_PATH/OUTPUT.txt 
>$LOGFILE

 for i in ` ls ${FILE_PREFIX}* `
 do
   FILE=`basename $i`
         echo $FILE >> $LOGFILE
 done

 echo "Processing Completed"

=============================================== = lOG FILE:

Change Directory
Instance= ibmcp1
File Path= /u01/app/oracle/admin/ibmcp1/inbound/
/apps/ibmgr12/apps/apps_st/appl/xxibm/12.0.0/bin/xxibm_file_names.prog[19]: cd: /u01/app/oracle/admin/ibmcp1/inbound/: [No such file or directory]
/apps/ibmgr12/apps/apps_st/appl/xxibm/12.0.0/bin/xxibm_file_names.prog.prog[21]: /u01/app/oracle/admin/ibmcp1/inbound//OUTBOUND.txt: cannot create [No such file or directory]
ls: cannot access IBM.SOURCE.INVE*: No such file or directory
Processing Completed

由于

0 个答案:

没有答案