oracle - 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 文件放在安装数据库的位置?
解决方案
如果文件是您机器的本地文件,您的选项是:
- 将文件传输到服务器,或
- 使服务器上的位置可见/可安装,或者
- 使用客户端工具将数据从您的机器加载到服务器
假设我们将使用最后一个,您可以这样做:
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
推荐阅读
- android - 无法解析 EditText 上的 setselection()
- javascript - 单击链接时如何突出显示一行
- java - 一次防止“24”小时值(没有秒)
- nginx - 忽略一组 IP 地址的特定规则
- javascript - 如何将字符串转换为数组内的两个属性?
- ios - 获取要更新的进度视图
- html - 如何在每个字体图标下放置一个文本?
- java - 当 authorizeRequests antMatcher 未设置为根 url 时,Spring Boot OAuth2 SSO 不起作用
- java - 单元测试异步代码和没有外部可见效果的代码
- amazon-web-services - 如何为 Lambda 过滤 AWS 日志以仅查看 console.logs