首页 > 解决方案 > 29283. 00000 - “无效的文件操作”

问题描述

我想使用 UTL_FILE 从 CSV 文件加载数据,但发生错误(见下文),请注意我正在远程连接到数据库,并且 CSV 文件在我的本地计算机中。

29283. 00000 -  "invalid file operation"
*Cause:    An attempt was made to read from a file or directory that does
           not exist, or file or directory access was denied by the
           operating system.
*Action:   Verify file and directory access privileges on the file system,
           and if reading, verify that the file exists.

是否有必要将 CSV 文件放在安装数据库的位置?

标签: oracleplsqloracle11gplsql-package

解决方案


如果文件是您机器的本地文件,您的选项是:

  • 将文件传输到服务器,或
  • 使服务器上的位置可见/可安装,或者
  • 使用客户端工具将数据从您的机器加载到服务器

假设我们将使用最后一个,您可以这样做:

SQL Developer - 展开“表”选项卡,右键单击您的表并选择导入

SQL Loader - SQL Loader 可以在本地运行(假设你有 Oracle 客户端)安装在你的机器上

https://asktom.oracle.com上的大量 SQL 加载器示例,或通过标准文档

https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sutil/oracle-sql-loader.html


推荐阅读