I use Oracle 12c Spatial and Graph and I need to load a N-QUAD file with large literals.
To do so I first create a directory and a source external table
SQL> CREATE DIRECTORY DATA_DIR AS '/tmp';
SQL> EXECUTE sem_apis.create_source_external_table(source_table => 'STAGE_TABLE_SOURCE', def_directory => 'DATA_DIR', bad_file => 'CLOBrows.bad');
SQL> ALTER TABLE "STAGE_TABLE_SOURCE" LOCATION ('data.nq');
then I change the READSIZE parameter of the external table (because the literals of the file are more than 512KB).
SQL> ALTER TABLE STAGE_TABLE_SOURCE DEFAULT DIRECTORY DATA_DIR ACCESS PARAMETERS (READSIZE 1048576);
the I try to load data into the staging table
SQL> EXECUTE SEM_APIS.LOAD_INTO_STAGING_TABLE(staging_table => 'STAGE_TABLE', source_table => 'STAGE_TABLE_SOURCE', input_format => 'N-QUAD');
but I get the following error:
ERROR at line 1:
ORA-13199: During LST: SQLERRM=ORA-29913: error in executing ODCIEXTTABLEOPEN
ORA-29400: data cartridge error
(Arguments: staging_table=STAGE_TABLE source_table=STAGE_TABLE_SOURCE
input_format=N-QUAD parallel= source_table_owner= staging_table_owner= flags=)
[ORA-06512: at "MDSYS.SDO_RDF", line 884
ORA-06512: at "MDSYS.MD", line 1723
ORA-06512: at "MDSYS.MDERR", line 17
ORA-06512: at "MDSYS.SDO_RDF", line 906
ORA-06512: at "MDSYS.RDF_APIS", line 883
ORA-06512: at line 1
I could not find any information about error KUP-03154.
Any hint about how to solve this problem will be very appreciated.
Yes all privileges and permissions seem to be OK.
To be more specific, the linux user (oracle) that executes sqlpls has both read and write permissions both on data directory and the input N-QUAD file.
The SQL user is the owner of the directory object and it has also been granted the SELECT privilege on external table and SELECT, UPDATE on staging table.
I think that the problem is something about the external table and the large literals of my input file (e.g., a literal consists 658KB). Because after changing the location of the external table to this file, even a simple query like counting its tuples causes the same error. On the other hand if I use a file with smaller literals everything works fine.