Oracle 12c中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:
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 theD:\sqldirectory. Control files should have a.ctlextension to avoid confusion with data files.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.ctlDouble-check file paths
- Confirm that
D:\sql\1.csvactually 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.txtthat might make it appear as1.csvbut actually be1.csv.txt). - Ensure the control file path in your command matches where you saved the
.ctlfile.
- Confirm that
额外小技巧
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

