I installed a simple external Oracle external test, which I (along with the DBA and Unix administrator) cannot work.
The following describes Oracle Concepts on external tables . The database we use is 11 g.
This is the definition of the external table:
drop table emp_load; CREATE TABLE emp_load (employee_number CHAR(5), employee_dob DATE, employee_last_name CHAR(20), employee_first_name CHAR(15), employee_middle_name CHAR(15), employee_hire_date DATE) ORGANIZATION EXTERNAL (TYPE ORACLE_LOADER DEFAULT DIRECTORY defaultdir ACCESS PARAMETERS (RECORDS DELIMITED BY NEWLINE FIELDS (employee_number CHAR(2), employee_dob CHAR(20), employee_last_name CHAR(18), employee_first_name CHAR(11), employee_middle_name CHAR(11), employee_hire_date CHAR(10) date_format DATE mask "mm/dd/yyyy" ) ) LOCATION ('external_table_test.dat') );
This is the contents of "external_table_test.dat":
56november, 15, 1980 baker mary alice 09/01/2004 87december, 20, 1970 roper lisa marie 01/01/1999
I can run a script that creates "emp_load" without any problems. I can also describe the table perfectly. When I try to "select * from emp_load", I get the following errors:
SQL> select * from emp_load; select * from emp_load * ERROR at line 1: ORA-29913: error in executing ODCIEXTTABLEOPEN callout ORA-29400: data cartridge error error opening file /defaultdir/EMP_LOAD_29305.log
EDIT 1
oracle has read / write permissions to the directory.
EDIT 2
I managed to pass this error using the following external table definition:
CREATE TABLE emp_load (employee_number CHAR(3), employee_last_name CHAR(20), employee_middle_name CHAR(15), employee_first_name CHAR(15) ) ORGANIZATION EXTERNAL (TYPE ORACLE_LOADER DEFAULT DIRECTORY defaultdir ACCESS PARAMETERS (RECORDS DELIMITED BY NEWLINE BADFILE DHHSMAPSIS:'EMP.BAD' LOGFILE DHHSMAPSIS:'EMP.LOG' FIELDS TERMINATED BY ',' ) LOCATION ('external_table_test2.dat') ) REJECT LIMIT UNLIMITED;
My .dat file looks like this:
056,baker,beth,mary 057,smith,teddy,john
I needed to set permissions on "EMP.BAD", "EMP.LOG" and "external_table_test2.dat" to 777 to make it work. The oracle user does not own these files, but is in the same group as the files.
Any idea why I can't get this to work when I set the permissions for these files to 770? Again, the oracle is in the same group as these files, so I decided 770 would be ok for permissions ...