oracle UTL_FILE、UTL_FILE_DIR 和 DIRECTORY,它们如何影响 UTL_FILE.FREMOVE?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6390594/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 23:59:29  来源:igfitidea点击:

UTL_FILE, UTL_FILE_DIR and DIRECTORY, how do they affect UTL_FILE.FREMOVE?

oracleoracle10gdirectoryutl-file

提问by Cade Roux

FREMOVE is failing with an error "ORA-29280: invalid directory path"

FREMOVE 失败并显示错误“ORA-29280:无效的目录路径”

It works fine when I add the path to the UTL_FILE_DIR and restart the database.

当我将路径添加到 UTL_FILE_DIR 并重新启动数据库时,它工作正常。

This is regardless of having the directory as an Oracle directory with both READ and WRITE granted.

这与将目录作为 Oracle 目录同时授予 READ 和 WRITE 无关。

回答by DCookie

What is the syntax you're using for FREMOVE parameter location? For a directory, you pass in the name of the Oracle Directory object, case significant.

您用于 FREMOVE 参数位置的语法是什么?对于目录,您传入 Oracle Directory 对象的名称,区分大小写。

回答by Joel Slowik

When using UTL_FILE you have one of two options:

使用 UTL_FILE 时,您有两个选项之一:

Option 1: UTL_FILE_DIR must have the directory you want to use in the parameter. If it's not there it will not work. The downside is that anytime you need this parameter changed or added to you need to bounce the database. With this method the first parameter of UTL_FILE.FREMOVE will be passed the actual OS directory.

选项1:UTL_FILE_DIR 参数中必须有你要使用的目录。如果它不存在,它将无法工作。缺点是,无论何时您需要更改或添加此参数,您都需要退回数据库。使用此方法,UTL_FILE.FREMOVE 的第一个参数将被传递到实际的操作系统目录。

Option 2: you alternatively use an oracle Directory object. You would use the directory object name (not the actual OS directory) in the first parameter of UTL_FILE.FREMOVE

选项 2:您也可以使用 oracle Directory 对象。您将在 UTL_FILE.FREMOVE 的第一个参数中使用目录对象名称(不是实际的操作系统目录)

References:

参考:

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm

http://www.sc.ehu.es/siwebso/KZCC/Oracle_10g_Documentacion/server.101/b10755/initparams223.htm

http://www.sc.ehu.es/siwebso/KZCC/Oracle_10g_Documentacion/server.101/b10755/initparams223.htm