You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Oracle 12c中SQL Loader加载数据报错,请求协助排查解决

解决SQL*Loader加载数据时的“文件未找到”错误

Hey there, let's get this SQL*Loader issue sorted out for you. First, let's look at the error you're running into:

C:\Users\Raghu>sqlldr hr/hrschema control=D:\sql\1.csv
SQL*Loader: Release 12.2.0.1.0 - Production on Sun Sep 29 09:03:41 2019
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
SQL*Loader-500: 无法打开文件(D:\sql\1.csv)
SQL*Loader-553: 文件未找到
SQL*Loader-509: 系统错误: 系统找不到指定的文件。
C:\Users\Raghu>

From the control file and data file content you shared:

你的控制文件内容

load data
infile 'd:\sql\1.csv'
TRUNCATE
into table students
fields terminated by "|"
(SID,CNAME)

你的数据文件内容

SID|CNAME
10|Java
20|UNIX
30|SQL
40|PLSQL
50|AI
60|PEGA
70|RPA
80|C
90|C++
100|Python

问题根源

The main mistake here is that you're passing your data file (1.csv) as the value for the control parameter in your sqlldr command! SQL*Loader expects the control argument to point to your .ctl control file, not the CSV data file.

解决步骤

Follow these steps to fix the issue:

  1. Create/verify your control file
    Make sure you've saved the control file content you shared as a separate file (e.g., student_load.ctl) in the D:\sql directory. Control files should have a .ctl extension to avoid confusion with data files.

  2. Run the correct sqlldr command
    Update your command to point to the actual control file instead of the CSV. The correct command should look like this:

    sqlldr hr/hrschema control=D:\sql\student_load.ctl
    
  3. Double-check file paths

    • Confirm that D:\sql\1.csv actually exists. Open File Explorer and navigate to that directory to ensure the file is there, with no typos in the name (watch out for hidden extensions like .txt that might make it appear as 1.csv but actually be 1.csv.txt).
    • Ensure the control file path in your command matches where you saved the .ctl file.

额外小技巧

If you want to simplify the command, you can switch to the directory containing your files first:

D:
cd sql
sqlldr hr/hrschema control=student_load.ctl

内容的提问来源于stack exchange,提问作者Raghuram Swaminthan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 07:44:55