我从unix脚本中的oracle包中得到了错误。此错误为"INVALID_FILEHANDLE“,请您帮助解决以下错误。
谢谢和问候,基兰
Erreur ! INVALID_FILEHANDLE
BEGIN p02ik.p02ip('/prep/dst/ins/tmp','/prep/dst/ins/log','PDSDI202.tmp','dstins_p02_202.log'); END;
*
ERROR at line 1:
ORA-20226: C'est le code de retour ==> Erreur Grave
ORA-06512: at "DATASTORE.P02IK", line 710
ORA-06512: at line 1全原木
toracle-exvokkes /prep/dst/ins/prog/scripts $ dstins_p02_202.ksh
+ date
+ echo ******** INTERFACE : p02 ******** Tue Feb 25 13:00:35 GMT 2014
+ 1>> /prep/dst/ins/log/dstins_p02.log
+ RC=0
+ /admin/checkbase.ksh datastore/dtstr@dsprep
La chaine de connexion est datastore/dtstr@dsprep
datastore/dtstr@dsprep
slash trouve
SQL*Plus: Release 9.2.0.5.0 - Production on Tue Feb 25 13:00:36 2014
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected.
SYSDATE
---------
25-FEB-14
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.5.0 - Production
Le code retour SQL est : 0
+ RC=0
+ [ 0 -ne 0 ]
+ cd /prep/dst/ins/ifile
+ + ls PDSDI202 PDSDI202.20140221153315
LIST_FIC=PDSDI202
PDSDI202.20140221153315
+ echo Liste de fichiers a traiter : PDSDI202
PDSDI202.20140221153315
+ 1>> /prep/dst/ins/log/dstins_p02.log
+ ls -l PDSDI202 PDSDI202.20140221153315
+ 1>> /prep/dst/ins/log/dstins_p02.log
+ echo fichier traite : PDSDI202
+ tee -a /prep/dst/ins/log/dstins_p02.log
fichier traite : PDSDI202
+ CONTINUER=N
+ [ N = N ]
+ + awk { print $1 }
+ du -k PDSDI202
TAILLE_1=64
+ echo TAILLE_1=64
+ tee -a /prep/dst/ins/log/dstins_p02.log
TAILLE_1=64
+ sleep 20
+ + du -k PDSDI202
+ awk { print $1 }
TAILLE_2=64
+ tee -a /prep/dst/ins/log/dstins_p02.log
+ echo TAILLE_2=64
TAILLE_2=64
+ [ 64 != 64 ]
+ [ 64 = 64 ]
+ echo la copie du fichier PDSDI202 est terminee
+ tee -a /prep/dst/ins/log/dstins_p02.log
la copie du fichier PDSDI202 est terminee
+ CONTINUER=Y
+ [ Y = N ]
+ mv /prep/dst/ins/ifile/PDSDI202 /prep/dst/ins/ifile/PDSDI202
mv: 0653-405 /prep/dst/ins/ifile/PDSDI202 and /prep/dst/ins/ifile/PDSDI202 are identical.
+ [ -f /prep/dst/ins/ifile/PDSDI202 ]
+ echo LE FICHIER /prep/dst/ins/ifile/PDSDI202 EXISTE
+ 1>> /prep/dst/ins/log/dstins_p02.log
+ ls -l /prep/dst/ins/ifile/PDSDI202
+ 1>> /prep/dst/ins/log/dstins_p02.log
+ [ -s /prep/dst/ins/ifile/PDSDI202 ]
+ echo LE FICHIER /prep/dst/ins/ifile/PDSDI202 N'EST PAS VIDE
+ 1>> /prep/dst/ins/log/dstins_p02.log
+ echo
+ 1>> /prep/dst/ins/log/dstins_p02.log
+ date +%Y%m%d%H%M%S
+ mv /prep/dst/ins/log/dstins_p02_202.log /prep/dst/ins/log/dstins_p02_202.log20140225130058
mv: 0653-401 Cannot rename /prep/dst/ins/log/dstins_p02_202.log to /prep/dst/ins/log/dstins_p02_202.log20140225130058:
A file or directory in the path name does not exist.
+ + echo PDSDI202
+ sed s/\(.*\)/\1\.tmp/
F_FICENT_TMP=PDSDI202.tmp
+ awk {
if (substr($0, 1, 6) == "EDI_DC")
{ print($0); }
else
{ printf("%s\n", substr($0, 1, 55));
printf("%s\n", substr($0, 56, (length($0)-55))); }
}
+ 0< /prep/dst/ins/ifile/PDSDI202 1> /prep/dst/ins/tmp/PDSDI202.tmp
+ [ -f /prep/dst/ins/tmp/PDSDI202.tmp ]
+ :
+ date
+ echo DEBUT CHARGEMENT FICHIER /prep/dst/ins/tmp/PDSDI202 : Tue Feb 25 13:00:58 GMT 2014
+ 1>> /prep/dst/ins/log/dstins_p02.log
+ echo
+ 1>> /prep/dst/ins/log/dstins_p02.log
+ sqlplus -s datastore/dtstr@dsprep
+ 0<<
echo sqlplus
set serverout on
whenever sqlerror exit sql.sqlcode
whenever oserror exit oscode
SELECT 'p02ik.p02ip' from DUAL ;
-- ALTER SESSION SET SQL_TRACE=TRUE ;
EXECUTE p02ik.p02ip('/prep/dst/ins/tmp','/prep/dst/ins/log','PDSDI202.tmp','dstins_p02_202.log');
commit work;
exit sql.sqlcode;
SP2-0734: unknown command beginning "echo sqlpl..." - rest of line ignored.
'P02IK.P02I
-----------
p02ik.p02ip
Starting..
BEGIN1
/prep/dst/ins/log
dstins_p02_202.log
/prep/dst/ins/tmp
PDSDI202.tmp
ENDBEGIN1
Erreur ! INVALID_FILEHANDLE
BEGIN p02ik.p02ip('/prep/dst/ins/tmp','/prep/dst/ins/log','PDSDI202.tmp','dstins_p02_202.log'); END;
*
ERROR at line 1:
ORA-20226: C'est le code de retour ==> Erreur Grave
ORA-06512: at "DATASTORE.P02IK", line 710
ORA-06512: at line 1
+ RC=2
+ echo INTEGRATION DU FICHIER /prep/dst/ins/tmp/PDSDI202 : ERREURS BLOQUANTES
+ 1>> /prep/dst/ins/log/dstins_p02.log
+ echo REGARDER /prep/dst/ins/log/dstins_p02_202.log
+ 1>> /prep/dst/ins/log/dstins_p02.log
+ echo RC=2
+ 1>> /prep/dst/ins/log/dstins_p02.log
+ date
+ 1>> /prep/dst/ins/log/dstins_p02.log
+ echo
+ 1>> /prep/dst/ins/log/dstins_p02.log
+ exit 2发布于 2014-02-25 18:38:00
由于您有一些调用UTL_FILE()方法的包装器,所以很难确定问题的所在。
实际上,UTL_FILE期望输入/输出文件目录是预定义的目录名,如字典表all_directories (列directory_name)中所示。
BEGIN
p02ik.p02ip('/prep/dst/ins/tmp',
'/prep/dst/ins/log',
'PDSDI202.tmp',
'dstins_p02_202.log');
END;我只是想知道您在哪里指定了目录表中可用的目录名。
当手柄处理程序引用无效目录时,将发生UTL_FILE错误,该目录要么不可用,要么可用,但无法被oracle实例访问。
另一个原因是您没有指定all_dictionary表中提到的目录名。
转到。总结,
1)确保不应显式地给出从all_directory间接引用的目录名
2) oracle进程应该读取对上面指定的文件系统的n次写入访问。
3)文件系统中有可用的空间
这里就是一个例子
https://stackoverflow.com/questions/22020466
复制相似问题