Reputation: 111
Having an issue with external tables in Oracle 11g. I'm currently using DB Artisan to run my query. The CREATE and ORGANIZATION code executes successfully, but when I run the select statement is where I am getting the error. My .csv file is set up the same way as the layout for the EXTERNAL_TABLE with the header as such.
CREATE TABLE EXTERNAL_TABLE
(
COL1 NUMBER(14),
COL2 VARCHAR2(10),
COL3 VARCHAR2(3),
COL4 VARCHAR2(3),
COL4 VARCHAR2(4),
COL6 NUMBER(4,0),
COL7 VARCHAR2(20),
COL8 VARCHAR2(20),
COL9 NUMBER(3)
)
ORGANIZATION EXTERNAL
(
TYPE ORACLE_LOADER
DEFAULT DIRECTORY FOLDER1
ACCESS PARAMETERS
(
RECORDS DELIMITED BY NEWLINE
FIELDS TERMINATED BY ','
MISSING FIELD VALUES ARE NULL
(COL1 CHAR(14),
COL2 CHAR(10),
COL3 CHAR(3),
COL4 CHAR(3),
COL4 CHAR(4),
COL6 CHAR(4),
COL7 CHAR(20),
COL8 CHAR(20),
COL9 CHAR(3)
)
)
LOCATION ('FILENAME.csv') --Name of flat file.
)
REJECT LIMIT 0;
Running:
SELECT * FROM EXTERNAL_TABLE
gives this error:
ORA-29913:error in executing ODCIEXTTABLEOPEN callout ORA-29400:data cartridge error KUP-04027:file name check failed: A:\job\job\FILENAME_1234_5566.log
Upvotes: 1
Views: 6575
Reputation: 5935
If you're in RAC and the file in inside of an ACFS then use:
DISABLE_DIRECTORY_LINK_CHECK
Fixes it!
see https://www.realdbamagic.com/using-external-table-windows-rac-acfs/
Upvotes: 0
Reputation: 1075
Ok, this question was asked a long time ago, but I have encountered this issue myself recently.
Problem is dat Oracle External tables does not completely support hard links that refer to remote network locations.
What I did to make it work was to create a directory object that specifically uses UNC paths (like '\remoteserver\proxy' to point to the remote network location. That magically worked for me.
Upvotes: 2
Reputation: 146239
KUP-04027:file name check failed
means the file location is not valid.
So, given this file name ...
A:\job\job\FILENAME_1234_5566.log
... several thoughts occur:
job
with a sub-directory called job
? Or is that a typo in the path of your DIRECTORY object folder1
?KUP-04027
are specific to the operating system, because file naming conventions are peculiar to each OS. My guess is that your database really resides on a remote Unix server but you're trying to read a file from your local Windows PC. If that is your scenario it won't work: you'll need to upload the file to the database server.Upvotes: 4