SQL*Loader-500: Unable to open file (v1x-access_log_20120916.dat)

perfychi發表於2012-09-18
情景:SQL*Loader-500: Unable to open file (v1x-access_log_20120916.dat)

具體如下:
[oracle@yitai sqlldr]$ ls v1x-access_log_20120916*
v1x-access_log_20120916

[oracle@yitai sqlldr]$ sqlldr scott/oracle data=v1x-access_log_20120916   control=insert_log.ctl

SQL*Loader: Release 10.2.0.1.0 - Production on Tue Sep 18 02:22:09 2012

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL*Loader-500: Unable to open file (v1x-access_log_20120916.dat)
SQL*Loader-553: file not found
SQL*Loader-509: System error: No such file or directory
SQL*Loader-2026: the load was aborted because SQL Loader cannot continue.


原因分析:(在檔名中有“.”時,sqlldr會尋找本身;  否則的話會預設尋找.dat,這時候會認為這個dat檔案不存在)

解決方法(檔名中加點):
[oracle@yitai sqlldr]$ mv v1x-access_log_20120916  v1.x-access_log_20120916 
[oracle@yitai sqlldr]$ sqlldr scott/oracle data=v1.x-access_log_20120916   control=insert_log.ctl

SQL*Loader: Release 10.2.0.1.0 - Production on Tue Sep 18 02:25:01 2012

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Commit point reached - logical record count 64
Commit point reached - logical record count 128
Commit point reached - logical record count 192
Commit point reached - logical record count 256
Commit point reached - logical record count 320
Commit point reached - logical record count 384

可以看到加點以後的檔名這時候就不報錯了。所以為了避免這種無厘頭的報錯,最好在 sqlldr的文字檔案命名中給他加字尾.dat, 避免特殊情況下找不到檔案這種情形發生。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27042095/viewspace-743850/,如需轉載,請註明出處,否則將追究法律責任。

相關文章