Ora 29913 ошибка при выполнении odciexttablefetch callout

Fix Oracle Database ORA 29913 Error

Dealing with the oracle database error ORA-29913 but having no idea of why you are receiving this error? Don’t worry….this tutorial will surely help you out.

This post is completely dedicated to Oracle Database ORA-29913 Error, its causes, and of course ways to fix it.

Without wasting any more time… let’s dive into the post.

The use of External Tables in Oracle is becoming popular these days which has moreover has eliminated the need for an SQL loader for loading tables. However, you may come across many issues while using the external tables in your database one of which is described here in this post.

ORA-29913 is also one such common error which usually comes while working with external tables within the Oracle database.

When you perform the SELECT operation on the external table (the feature is a complement to existing SQL*Loader functionality. It enables you to access data in external sources as if it were in a table in the database) then you may face error those which are similar to the following:

ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04063: unable to open log file EXTERN_17063.log
KUP-04040: file TEST.TXT in TEST_DIR not found
ORA-06512: at “SYS.ORACLE_LOADER”, line 19

What Types Error Messages Appears When ORA- 22913 Error Occurs?

The ORA- 22913 error comes in various forms; let’s have a look over each of them:

  • ora 29913 error in executing odciexttableopen callout windows
  • ora-29913 error in executing odciexttableopen callout ora-29400 data cartridge error kup-04040
  • ora-29913 error in executing odciexttableopen callout impdp
  • ora-29913: error in executing odciexttablefetch callout ora-30653: reject limit reached
  • ora-29913: error in executing odcitabledescribe callout
  • ora-29913: error in executing odciexttablepopulate callout
  • ora-29913: error in executing odciexttablefetch callout ora-01722: invalid number
  • ora-29913: error in executing odciaggregateiterate callout

What Causes Oracle ORA-29913 Error?

The most common ORA-29913 error is caused when the Oracle fails to open the OS files that it needs for opening. These files may or may not include in the input files, output files, and the log and bad or discard files. The reason behind the occurrence of this error is that Oracle execution has not been granted permission for accessing the directory properly or the directory itself does not exist in the database or the files have not been granted the permissions.

You may also come across this error line that the Oracle fails to write the log file then this definitely means that there may be an issue with the directory or with the log files contained in the directory.

How To Fix Oracle ORA-29913 Error?

Fix 1# ORA-29913: error in executing ODCIEXTTABLEOPEN callout

Reason:

Your external file must have assigned with the null values in its last column. Originally it’s a number column. To run the query successfully, you need to change the null to value to number o.

How To Fix:

For loading up the NULL value, you have to include the delimiter ENCLOSED BY within your table definition.

records delimited by newline

fields terminated by ‘,’

optionally enclosed by ‘ ‘ <<<=====

missing field values are null

Fix 2# ORA-29913: error in executing ODCIEXTTABLEFETCH callout

Reason:

If you are receiving the ORA-29913: error in executing ODCIEXTTABLEFETCH callout then the reasons can be the following:

  1. Incorrect or improper data format in the external file
  2. Your external file has some empty lines
  3. You need check the following things in the HEX delimiter and TAB delimiter
  4. TAB delimiter ‘\t’ which is used by Oracle database, is denoted by the HEX value ’09’
  5. HEX value present within the data file must match with the CREATE statement’s HEX value.
  6. HEX specification present in the CREATE statement must be like 0X'<value&

gt;’ or 0x'<value>’

  1. Suppose if a column is added in the external table then the same thing must need to be there within your external file.

How To Fix:

To fix ORA-29913: error in executing ODCIEXTTABLEFETCH callout at first you need to check the error within the log. After that fix the problem consequently.

Fix 3# Check The External Tables

So when you make use of the external tables then you need to perform certain checks that are mentioned below:

  • You need to check the statement carefully that you have used for creating the directory.
  • Check that the directories have been granted the necessary rights or permissions by the Oracle for performing reading and writing.
  • Need to perform special checks of ownership and permissions for the network directories.
  • Also, check that there is no problem associated with the permissions for the files that are in existence.

Some More Quick Fixes To Resolve Ora-29913

You can easily fix this problem by trying out some of the solutions that follow:

  1. You need to build physical directories at all nodes of the cluster and need to copy the data files physically to all the locations.
  2.  When you present the storage of data from SAN or NAS then it gets presented in NFS. You also note that this is mandatory to get a separate license from the storage provider.
  3. You can use the Cluster file system at the OS level which is visible from all the nodes. However, the solution to do so is a bit expensive as you need to purchase some additional licenses to do so.
  4. When you are accessing the external tables then you need to connect to specific instances but you will be not able to take the advantage of this service.

Automated Solution To Fix Ora-29913 Error

If meanwhile performing the above fixes to resolve Ora-29913 error you get into some oracle database corruption issues. In that case, use the Oracle repair tool.

It is a powerful and comprehensive data recovery software that is specially designed for recovering corrupted or damaged Oracle database files and the tables and the contents in it that are exported from the external source.

This software scans and searches all the errors and damages that are induced in the Oracle database in the system and then shows a preview of recoverable database objects.  This software is capable of recovering from both the database and backup files.

Hence the recovered data after going through the process is also gets stored in Transact-SQL script. The recovery tool is very easy to use an even the non-technical people can easily make use of it for recovering their data back from their corrupted and damaged Oracle database.

Steps to Fix Oracle Database ORA-29913 Error

Step 1: Search the initial screen of Oracle repair tool. with a pop-up window showing options to select or search corrupt Oracle databases in your computer.1

Step 2: Click Scan File to initiate the scan process after selecting the oracle database. The recoverable database objects get listed in left-side pane.

2

Step 3: Click an object to see its preview.

3

Step 4: : Click Start Repair in the icon bar to start the repair process. A pop-up window is displayed which show the steps needed to perform further. Click next and continue.

4

Step 5: Give the user name, password and path of the blank database where you want to save the repaired database objects.

5

Step 6: Repairing and restoring various database objects after establishing a connection with blank oracle database.

6

Conclusion:

Oracle Database ORA-29913 Error is a very common error which any user can face while handling the external tables in the Oracle database. But now you all need not worry because you have the fixes to resolve this error easily without affecting the file integrity.

Jacob Martin is a technology enthusiast having experience of more than 4 years with great interest in database administration. He is expertise in related subjects like SQL database, Access, Oracle & others. Jacob has Master of Science (M.S) degree from the University of Dallas. He loves to write and provide solutions to people on database repair. Apart from this, he also loves to visit different countries in free time.

ORA-29913 is one of the common error when working with external tables in Oracle database. We would be looking at various ways the error can be produced and what can be done to resolve the error

ORA-29913

(1) External File not found or permission incorrect

SQL> select * from Scott.example_external_table;
select * from example_external_table
*
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file test1.dat in TEST_DIR not found
ORA-06512: at "SYS.ORACLE_LOADER", line 14
ORA-06512: at line 1

When analyzing the table, you get a similar message:

SQL> execute sys.dbms_stats.gather_table_stats(‘SCOTT’,’EXAMPLE_EXTERNAL_TABLE’);
BEGIN sys.dbms_stats.gather_table_stats(‘SCOTT’,’EXAMPLE_EXTERNAL_TABLE’); END;
*
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file test1.dat in TEST_DIR not found
ORA-06512: at “SYS.DBMS_STATS”, line 7161
ORA-06512: at “SYS.DBMS_STATS”, line 7174
ORA-06512: at line 1

Or in general way

ORA-20011: Approximate NDV failed:

ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file <file_name> in <directory_name> not found

Reason

The external files have been moved from the correct location

SQL> select * from dba_directories ;

OWNER DIRECTORY_NAME DIRECTORY_PATH
------ -------------- -----------------------
SYS TEST_DIR /u01/oradata/external_files

Check the File Names associated with external table

select * from dba_external_locations
where table_name='EXAMPLE_EXTERNAL_TABLE';OWNER TABLE_NAME LOCATION DIRECTORY_OWNER DIRECTORY_NAME
----- ------------- -------- --------------- ---------------
SYS EXAMPLE_EXTERNAL_TABLE test1.dat SYS TEST_DIR
SYS EXAMPLE_EXTERNAL_TABLE test2.dat SYS TEST_DIR

Now checking at the OS level
$ cd /u01/oradata/external_files
$ ls test[1-2]/dat
No such file or directory

So files are not present at the correct location

Both the above queries can be combined as below also

select TABLE_NAME, DIRECTORY_PATH||'/'||LOCATION file_name from DBA_EXTERNAL_LOCATIONS loc, dba_directories dir
where loc.DIRECTORY_OWNER=dir.OWNER
and loc.DIRECTORY_NAME=dir.DIRECTORY_NAME
and loc.OWNER='&1' and loc.TABLE_NAME='&2';

Resolution:
Move back both the files to the original location

$ mv /u02/oradata/external_files/test2.dat /u01/oradata/external_files
$ mv /u02/oradata/external_files/test1.dat /u01/oradata/external_files

Now
Both the below statement will succeed

select * from Scott.example_external_table;
execute sys.dbms_stats.gather_table_stats('SCOTT','EXAMPLE_EXTERNAL_TABLE');

(2) Incorrect data format in external file

ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-30653: reject limit reached
ORA-06512: at “SYS.ORACLE_LOADER”, line 14
ORA-06512: at line 1

Reason

(i) The external file may be having empty lines
(ii) Check the TAB delimiter or the HEX delimiter

a. The TAB delimiter ‘\t’, used by Oracle, is represented by a HEX value ’09’
b. The HEX value in the datafile should match the HEX value specified in the
CREATE statement
c. The HEX specification in the CREATE statement should look like 0X'<value&
gt;’ or 0x'<value>’
(iii) If the column added to the external table,same should be present in the external file

Resolution
Check the error in the log and correct the problem accordingly

(3) Error with Null column

ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04043: table column not found in external source:

Reason
The external file does have null values for the last column which is originally a number column. When we change the null to a number 0,then the query succeeds.

Resolution
To load a NULL value,we need to include ENCLOSED BY delimiter in the table definition.

records delimited by newline
fields terminated by ‘,’
optionally enclosed by ‘ ‘ <<<=====
missing field values are null

(4) ORA-29913 can also occur if Oracle is not able to create the log files also.So check for the permission of the directories

(5) External table directory error
The ORA-29913 error can also happen in external tables when you don’t grant read and write permissions to the directory:

CREATE OR REPLACE DIRECTORY extdir AS ‘/u01/oradata/testdir’;
GRANT READ ON DIRECTORY testdir TO <user name>;
GRANT WRITE ON DIRECTORY testdir TO <user name>;

Here are some good information about External Table,You should  check out

What are EXTERNAL TABLES in Oracle?

(1)External tables are read only tables where the data is stored in flat files outside the database

(2) You can user external table feature to access external files as if they are tables inside the database.

(3)   When you create an external table, you define its structure and location with in oracle. Basically you just store the metadata inside the oracle

(4) When you query the table, oracle reads the external table and returns the results just as if the data had been stored with in the database.

(5) The oracle server provides two major oracle driver to read the flat files

  • Oracle_loader: This is used for the reading the flat files using the oracle loader technology. It basically allows to read the files which can be interpreted using sql loader technology
  • Oracle_datapump: This is used for both importing and exporting of data using platform independent format

Related Articles
Oracle External tables :Check out this post for information on usage of external table in oracle with example, how to create external table, how to use it
Oracle Create table :Tables are the basic unit of data storage in an Oracle Database.we covers how to use Oracle create table command to create table with foreign key /primary key
ORA-00936 missing expression :Learn troubleshooting ORA-00936 missing expression in oracle SQL.what are various solution, how we can avoid it, Oracle bugs for this errors
ORA-01017: invalid username/password; logon denied :Learn the possible resolution of ORA-01017 invalid username/password; logon denied. How to resolve it quickly without muc efforts
ORA-00001 unique constraint violated :Check out this post for the possible solution for oracle error ORA-00001 unique constraint violated. How to resolve and fix it
ORA-00911: invalid character :This post is for common causes of ORA-00911: invalid character in oracle with examples and resolution to help you complete the job
ORA-00900 : This post for the various solutions for ORA-00900 invalid sql statement.Reasons for the error.How to debug and resolve it quickly,
ORA-03113: end-of-file on communication channel :Check out method to resolve ORA-03113: end-of-file on communication channel. This error could happen in database startup, running program
Oracle documentation

Recommended Courses

Here is the nice Udemy Course for Oracle SQL
Oracle-Sql-Step-by-step : This course covers basic sql, joins, Creating Tables and modifying its structure, Create View, Union, Union -all and much other stuff. A great course and must-have course for SQL starter
The Complete Oracle SQL Certification Course : This is a good course for anybody who wants to be Job ready for SQL developer skills. A nice explained course
Oracle SQL Developer: Essentials, Tips and Tricks : Oracle Sql developer tool is being used by many developers. This course gives us tricks and lessons on how to effectively use it and become a productive sql developer
Oracle SQL Performance Tuning Masterclass 2020 : Performance tuning is one of the critical and most sought skills. This is a good course to learn about it and start doing sql performance tuning

I’m trying to execute this code in PL/SQL:

create or replace directory ext_tab_dir as 'C:/mydir';
GRANT READ,WRITE ON DIRECTORY ext_tab_dir TO PUBLIC;
DROP TABLE emp_load;
CREATE TABLE emp_load (v1 VARCHAR2(4000), 
                        v2 VARCHAR2(4000) 
                        )
   ORGANIZATION EXTERNAL (
     TYPE ORACLE_LOADER DEFAULT DIRECTORY ext_tab_dir
     ACCESS PARAMETERS (
     RECORDS DELIMITED BY NEWLINE
     BADFILE ext_tab_dir:'bad.bad'
     LOGFILE ext_tab_dir:'log.log'
     FIELDS TERMINATED BY ','         
     )
     LOCATION ('testfile.csv')
   ); 
--   INSERT INTO tablename(v1,v2)
   SELECT * From emp_load    

and then getting next errors:

ORA-29913: error in executing ODCIEXTTABLEOPEN callout    
ORA-29400: data cartridge error error opening file C:/mydir/log.log

I do get that it has to do something with permissions, but I’m the one who created that directory, so how do I grant priveleges to myself if it is set like this by default? Is there any way to perform that sort of operation from PL/SQL?

ORA-29913 is one of the common error when working with external tables in Oracle database. We would be looking at various ways the error can be produced and what can be done to resolve the error

ORA-29913

(1) External File not found or permission incorrect

SQL> select * from Scott.example_external_table;
select * from example_external_table
*
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file test1.dat in TEST_DIR not found
ORA-06512: at "SYS.ORACLE_LOADER", line 14
ORA-06512: at line 1

When analyzing the table, you get a similar message:

SQL> execute sys.dbms_stats.gather_table_stats(‘SCOTT’,’EXAMPLE_EXTERNAL_TABLE’);
BEGIN sys.dbms_stats.gather_table_stats(‘SCOTT’,’EXAMPLE_EXTERNAL_TABLE’); END;
*
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file test1.dat in TEST_DIR not found
ORA-06512: at “SYS.DBMS_STATS”, line 7161
ORA-06512: at “SYS.DBMS_STATS”, line 7174
ORA-06512: at line 1

Or in general way

ORA-20011: Approximate NDV failed:

ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file <file_name> in <directory_name> not found

Reason

The external files have been moved from the correct location

SQL> select * from dba_directories ;

OWNER DIRECTORY_NAME DIRECTORY_PATH
------ -------------- -----------------------
SYS TEST_DIR /u01/oradata/external_files

Check the File Names associated with external table

select * from dba_external_locations
where table_name='EXAMPLE_EXTERNAL_TABLE';OWNER TABLE_NAME LOCATION DIRECTORY_OWNER DIRECTORY_NAME
----- ------------- -------- --------------- ---------------
SYS EXAMPLE_EXTERNAL_TABLE test1.dat SYS TEST_DIR
SYS EXAMPLE_EXTERNAL_TABLE test2.dat SYS TEST_DIR

Now checking at the OS level
$ cd /u01/oradata/external_files
$ ls test[1-2]/dat
No such file or directory

So files are not present at the correct location

Both the above queries can be combined as below also

select TABLE_NAME, DIRECTORY_PATH||'/'||LOCATION file_name from DBA_EXTERNAL_LOCATIONS loc, dba_directories dir
where loc.DIRECTORY_OWNER=dir.OWNER
and loc.DIRECTORY_NAME=dir.DIRECTORY_NAME
and loc.OWNER='&1' and loc.TABLE_NAME='&2';

Resolution:
Move back both the files to the original location

$ mv /u02/oradata/external_files/test2.dat /u01/oradata/external_files
$ mv /u02/oradata/external_files/test1.dat /u01/oradata/external_files

Now
Both the below statement will succeed

select * from Scott.example_external_table;
execute sys.dbms_stats.gather_table_stats('SCOTT','EXAMPLE_EXTERNAL_TABLE');

(2) Incorrect data format in external file

ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-30653: reject limit reached
ORA-06512: at “SYS.ORACLE_LOADER”, line 14
ORA-06512: at line 1

Reason

(i) The external file may be having empty lines
(ii) Check the TAB delimiter or the HEX delimiter

a. The TAB delimiter ‘t’, used by Oracle, is represented by a HEX value ’09’
b. The HEX value in the datafile should match the HEX value specified in the
CREATE statement
c. The HEX specification in the CREATE statement should look like 0X'<value&
gt;’ or 0x'<value>’
(iii) If the column added to the external table,same should be present in the external file

Resolution
Check the error in the log and correct the problem accordingly

(3) Error with Null column

ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04043: table column not found in external source:

Reason
The external file does have null values for the last column which is originally a number column. When we change the null to a number 0,then the query succeeds.

Resolution
To load a NULL value,we need to include ENCLOSED BY delimiter in the table definition.

records delimited by newline
fields terminated by ‘,’
optionally enclosed by ‘ ‘ <<<=====
missing field values are null

(4) ORA-29913 can also occur if Oracle is not able to create the log files also.So check for the permission of the directories

(5) External table directory error
The ORA-29913 error can also happen in external tables when you don’t grant read and write permissions to the directory:

CREATE OR REPLACE DIRECTORY extdir AS ‘/u01/oradata/testdir’;
GRANT READ ON DIRECTORY testdir TO <user name>;
GRANT WRITE ON DIRECTORY testdir TO <user name>;

Here are some good information about External Table,You should  check out

What are EXTERNAL TABLES in Oracle?

(1)External tables are read only tables where the data is stored in flat files outside the database

(2) You can user external table feature to access external files as if they are tables inside the database.

(3)   When you create an external table, you define its structure and location with in oracle. Basically you just store the metadata inside the oracle

(4) When you query the table, oracle reads the external table and returns the results just as if the data had been stored with in the database.

(5) The oracle server provides two major oracle driver to read the flat files

  • Oracle_loader: This is used for the reading the flat files using the oracle loader technology. It basically allows to read the files which can be interpreted using sql loader technology
  • Oracle_datapump: This is used for both importing and exporting of data using platform independent format

Related Articles
Oracle External tables :Check out this post for information on usage of external table in oracle with example, how to create external table, how to use it
Oracle Create table :Tables are the basic unit of data storage in an Oracle Database.we covers how to use Oracle create table command to create table with foreign key /primary key
ORA-00936 missing expression :Learn troubleshooting ORA-00936 missing expression in oracle SQL.what are various solution, how we can avoid it, Oracle bugs for this errors
ORA-01017: invalid username/password; logon denied :Learn the possible resolution of ORA-01017 invalid username/password; logon denied. How to resolve it quickly without muc efforts
ORA-00001 unique constraint violated :Check out this post for the possible solution for oracle error ORA-00001 unique constraint violated. How to resolve and fix it
ORA-00911: invalid character :This post is for common causes of ORA-00911: invalid character in oracle with examples and resolution to help you complete the job
ORA-00900 : This post for the various solutions for ORA-00900 invalid sql statement.Reasons for the error.How to debug and resolve it quickly,
ORA-03113: end-of-file on communication channel :Check out method to resolve ORA-03113: end-of-file on communication channel. This error could happen in database startup, running program
Oracle documentation

Recommended Courses

Here is the nice Udemy Course for Oracle SQL
Oracle-Sql-Step-by-step : This course covers basic sql, joins, Creating Tables and modifying its structure, Create View, Union, Union -all and much other stuff. A great course and must-have course for SQL starter
The Complete Oracle SQL Certification Course : This is a good course for anybody who wants to be Job ready for SQL developer skills. A nice explained course
Oracle SQL Developer: Essentials, Tips and Tricks : Oracle Sql developer tool is being used by many developers. This course gives us tricks and lessons on how to effectively use it and become a productive sql developer
Oracle SQL Performance Tuning Masterclass 2020 : Performance tuning is one of the critical and most sought skills. This is a good course to learn about it and start doing sql performance tuning

Fix Oracle Database ORA 29913 Error

Dealing with the oracle database error ORA-29913 but having no idea of why you are receiving this error? Don’t worry….this tutorial will surely help you out.

This post is completely dedicated to Oracle Database ORA-29913 Error, its causes, and of course ways to fix it.

Without wasting any more time… let’s dive into the post.

The use of External Tables in Oracle is becoming popular these days which has moreover has eliminated the need for an SQL loader for loading tables. However, you may come across many issues while using the external tables in your database one of which is described here in this post.

ORA-29913 is also one such common error which usually comes while working with external tables within the Oracle database.

When you perform the SELECT operation on the external table (the feature is a complement to existing SQL*Loader functionality. It enables you to access data in external sources as if it were in a table in the database) then you may face error those which are similar to the following:

ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04063: unable to open log file EXTERN_17063.log
KUP-04040: file TEST.TXT in TEST_DIR not found
ORA-06512: at “SYS.ORACLE_LOADER”, line 19

What Types Error Messages Appears When ORA- 22913 Error Occurs?

The ORA- 22913 error comes in various forms; let’s have a look over each of them:

  • ora 29913 error in executing odciexttableopen callout windows
  • ora-29913 error in executing odciexttableopen callout ora-29400 data cartridge error kup-04040
  • ora-29913 error in executing odciexttableopen callout impdp
  • ora-29913: error in executing odciexttablefetch callout ora-30653: reject limit reached
  • ora-29913: error in executing odcitabledescribe callout
  • ora-29913: error in executing odciexttablepopulate callout
  • ora-29913: error in executing odciexttablefetch callout ora-01722: invalid number
  • ora-29913: error in executing odciaggregateiterate callout

What Causes Oracle ORA-29913 Error?

The most common ORA-29913 error is caused when the Oracle fails to open the OS files that it needs for opening. These files may or may not include in the input files, output files, and the log and bad or discard files. The reason behind the occurrence of this error is that Oracle execution has not been granted permission for accessing the directory properly or the directory itself does not exist in the database or the files have not been granted the permissions.

You may also come across this error line that the Oracle fails to write the log file then this definitely means that there may be an issue with the directory or with the log files contained in the directory.

How To Fix Oracle ORA-29913 Error?

Fix 1# ORA-29913: error in executing ODCIEXTTABLEOPEN callout

Reason:

Your external file must have assigned with the null values in its last column. Originally it’s a number column. To run the query successfully, you need to change the null to value to number o.

How To Fix:

For loading up the NULL value, you have to include the delimiter ENCLOSED BY within your table definition.

records delimited by newline

fields terminated by ‘,’

optionally enclosed by ‘ ‘ <<<=====

missing field values are null

Fix 2# ORA-29913: error in executing ODCIEXTTABLEFETCH callout

Reason:

If you are receiving the ORA-29913: error in executing ODCIEXTTABLEFETCH callout then the reasons can be the following:

  1. Incorrect or improper data format in the external file
  2. Your external file has some empty lines
  3. You need check the following things in the HEX delimiter and TAB delimiter
  4. TAB delimiter ‘t’ which is used by Oracle database, is denoted by the HEX value ’09’
  5. HEX value present within the data file must match with the CREATE statement’s HEX value.
  6. HEX specification present in the CREATE statement must be like 0X'<value&

gt;’ or 0x'<value>’

  1. Suppose if a column is added in the external table then the same thing must need to be there within your external file.

How To Fix:

To fix ORA-29913: error in executing ODCIEXTTABLEFETCH callout at first you need to check the error within the log. After that fix the problem consequently.

Fix 3# Check The External Tables

So when you make use of the external tables then you need to perform certain checks that are mentioned below:

  • You need to check the statement carefully that you have used for creating the directory.
  • Check that the directories have been granted the necessary rights or permissions by the Oracle for performing reading and writing.
  • Need to perform special checks of ownership and permissions for the network directories.
  • Also, check that there is no problem associated with the permissions for the files that are in existence.

Some More Quick Fixes To Resolve Ora-29913

You can easily fix this problem by trying out some of the solutions that follow:

  1. You need to build physical directories at all nodes of the cluster and need to copy the data files physically to all the locations.
  2.  When you present the storage of data from SAN or NAS then it gets presented in NFS. You also note that this is mandatory to get a separate license from the storage provider.
  3. You can use the Cluster file system at the OS level which is visible from all the nodes. However, the solution to do so is a bit expensive as you need to purchase some additional licenses to do so.
  4. When you are accessing the external tables then you need to connect to specific instances but you will be not able to take the advantage of this service.

Automated Solution To Fix Ora-29913 Error

If meanwhile performing the above fixes to resolve Ora-29913 error you get into some oracle database corruption issues. In that case, use the Oracle repair tool.

It is a powerful and comprehensive data recovery software that is specially designed for recovering corrupted or damaged Oracle database files and the tables and the contents in it that are exported from the external source.

This software scans and searches all the errors and damages that are induced in the Oracle database in the system and then shows a preview of recoverable database objects.  This software is capable of recovering from both the database and backup files.

Hence the recovered data after going through the process is also gets stored in Transact-SQL script. The recovery tool is very easy to use an even the non-technical people can easily make use of it for recovering their data back from their corrupted and damaged Oracle database.

Steps to Fix Oracle Database ORA-29913 Error

Step 1: Search the initial screen of Oracle repair tool. with a pop-up window showing options to select or search corrupt Oracle databases in your computer.1

Step 2: Click Scan File to initiate the scan process after selecting the oracle database. The recoverable database objects get listed in left-side pane.

2

Step 3: Click an object to see its preview.

3

Step 4: : Click Start Repair in the icon bar to start the repair process. A pop-up window is displayed which show the steps needed to perform further. Click next and continue.

4

Step 5: Give the user name, password and path of the blank database where you want to save the repaired database objects.

5

Step 6: Repairing and restoring various database objects after establishing a connection with blank oracle database.

6

Conclusion:

Oracle Database ORA-29913 Error is a very common error which any user can face while handling the external tables in the Oracle database. But now you all need not worry because you have the fixes to resolve this error easily without affecting the file integrity.

Jacob Martin is a technology enthusiast having experience of more than 4 years with great interest in database administration. He is expertise in related subjects like SQL database, Access, Oracle & others. Jacob has Master of Science (M.S) degree from the University of Dallas. He loves to write and provide solutions to people on database repair. Apart from this, he also loves to visit different countries in free time.

I am creating external table using hr schema but i get errors

«ORA-29913: error in executing ODCIEXTTABLEOPEN callout ORA-29400:
data cartridge error KUP-00554: error encountered while parsing access
parameters KUP-01005: syntax error: found «missing»: expecting one of:
«column, (» KUP-01007: at line 4 column 3
29913. 00000 — «error in executing %s callout»
*Cause: The execution of the specified callout caused an error.
*Action: Examine the error messages take appropriate action.»

—————-My Code——————-

create directory ex_tab as 'C:My WorksExternal Table';


create table strecords (
st_id number(4),
st_name varchar(10),
schl_name varchar(5),
st_city varchar(15),
st_year number(4)
)
ORGANIZATION EXTERNAL
(TYPE oracle_loader
 DEFAULT DIRECTORY ex_tab
 ACCESS PARAMETERS
 (
  RECORDS DELIMITED BY newline
  FIELDS TERMINATED BY ',' 
  REJECT ROWS WITH ALL NULL FIELDS
  MISSING FIELDS VALUES ARE NULL
  (
    st_id number(4),
    st_name char(10),
    schl_name char(5),
    st_city char(15),
    st_year number(4)
  )
 )
 LOCATION ('strecords.txt')
);

desc strecords;

select * from strecords;

This is my code, please check it and review it.

ORA-29913: error in executing ODCIEXTTABLEOPEN callout

While running oracle datapatch in 12c, ORA-29913 error raised due to corrupted external table. The error you might see while running the datapatch after patching.

$ ./datapatch -verbose

Connecting to database…OK
Determining current state…
Currently installed SQL Patches: 18522516
DBD::Oracle::st execute failed: ORA-04063: package body «SYS.DBMS_QOPATCH» has errors
ORA-06508: PL/SQL: could not find program unit being called: «SYS.DBMS_QOPATCH»
ORA-06512: at line 4 (DBD ERROR: OCIStmtExecute) [for Statement «DECLARE
x XMLType;
BEGIN
x := dbms_qopatch.get_pending_activity;
? := x.getStringVal();
END;» with ParamValues: :p1=undef] at /u01/app/oracle/product/12.1.0.2/db_1/sqlpatch/sqlpatch.pm line 1293.

or

Connecting to database…OK
catcon: ALL catcon-related output will be written to /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_53150146_2017_05_09_21_37_14/sqlpatch_catcon__catcon_53150146.lst
catcon: See /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_53150146_2017_05_09_21_37_14/sqlpatch_catcon_*.log files for output generated by scripts
catcon: See /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_53150146_2017_05_09_21_37_14/sqlpatch_catcon__*.lst files for spool files, if any
Bootstrapping registry and package to current versions…done
DBD::Oracle::db selectrow_array failed:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
KUP-00600: internal error, arguments [kudmpgnc:badbl] [0] [] [] [] (DBD ERROR: error possibly near <*> indicator at char 7 in ‘SELECT <*>dbms_sqlpatch.verify_queryable_inventory FROM dual’) [for Statement «SELECT dbms_sqlpatch.verify_queryable_inventory FROM dual»] at

Solution:

The issue is caused by corrupted external table SYS.OPATCH_XML_INV or the table does’t exist in database. We tried to query the external table and we received the error ORA-29913.

SQL> select * from OPATCH_XML_INV;
ERROR:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-00554: error encountered while parsing access parameters
KUP-01005: syntax error: found «identifier»: expecting one of: «column,
disable_directory_link_check, fields, file_format, logfile, nologfile,
preprocessor, readsize, records»
KUP-01008: the bad identifier was: ┐┐┐┐┐┐┐┐┐┐
KUP-01007: at line 1 column 1

2.) Drop the table if its already exist.

SQL> drop table OPATCH_XML_INV;

3.) Re-create the external table, do not change any directory or variable.

SQL> CREATE TABLE opatch_xml_inv
(
xml_inventory CLOB
)
ORGANIZATION EXTERNAL
(
TYPE oracle_loader
DEFAULT DIRECTORY opatch_script_dir
ACCESS PARAMETERS
(
RECORDS DELIMITED BY NEWLINE
READSIZE 67108864
preprocessor opatch_script_dir:’qopiprep.bat’
BADFILE opatch_script_dir:’qopatch_bad.bad’
LOGFILE opatch_log_dir:’qopatch_log.log’
FIELDS TERMINATED BY ‘UIJSVTBOEIZBEFFQBL’
MISSING FIELD VALUES ARE NULL
REJECT ROWS WITH ALL NULL FIELDS
(
xml_inventory CHAR(100000000)
)
)
LOCATION(opatch_script_dir:’qopiprep.bat’)
)
PARALLEL 1
REJECT LIMIT UNLIMITED;

Once the above statement is successful, compile the DBMS_QOPATCH and see all the DBMS_QOPATCH objects are valid.

SQL> alter package sys.DBMS_QOPATCH compile body ;

SQL> select owner, object_name,object_type,status FROM dba_objects where object_name in (‘DBMS_QOPATCH’ ,’OPATCH_XML_INV’);

4)Execute the datapatch -verbose again.

  $ ./datapatch -verbose

Note:- Make sure to test the solution in test environment before doing any changes in prod database and also submit the SR# with oracle support. Test!! Test!! TesT!!

April 28, 2021

I got “ORA-29913: Error in Executing ODCIEXTTABLEOPEN Callout” error in Oracle.

ORA-29913: Error in Executing ODCIEXTTABLEOPEN Callout

Details of error are as follows.

ORA-29913: error in executing string callout
Cause: The execution of the specified callout caused an error.
Action: Examine the error messages take appropriate action.


Error in Executing ODCIEXTTABLEOPEN Callout

This ORA-29913 errors are related with the Privileges at the OS level.

To solve this error, Change permissions on the directory to allow the Oracle user to read and write from it.

Let’s go to see on the following example.

create directory meta_data as '/home/oracle/customer/meta_data';
grant read, write on directory meta_data to cartl01;

The foo.dat file was placed in the meta_data directory at the OS level
In this case the file only contained a single line with number ‘100’.

Create the next external table:

CREATE TABLE FOO
(
  NUM  NUMBER(10)
)
ORGANIZATION EXTERNAL
  (  TYPE ORACLE_LOADER
     DEFAULT DIRECTORY META_DATA
     ACCESS PARAMETERS
       ( records delimited by newline
    NOLOGFILE  )
     LOCATION ('foo.dat')
  )
REJECT LIMIT 0
NOPARALLEL
NOMONITORING;

Select from the external table encounters the error:

SQL> show user
USER is "CARTL01"

SQL> select * from foo;
select * from foo
*
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file foo.dat in META_DATA not found
ORA-06512: at "SYS.ORACLE_LOADER", line 19

Privileges at the OS level show that the meta_data directory had only rwx privileges for one user:

> ls -ltr meta_data
drwx------ 2 user1 xyz 4096 Sep 13 17:00 meta_data

Even though the file permissions were set to 777, the Oracle user could not access the file because permissions at the directory level would not allow it.

> ls -ltr meta_data
-rwxrwxrwx 1 user1 xyz    4 Sep 13 17:28 foo.dat

To solve this error, Change permissions on the directory to allow the Oracle user to read and write from it:

> ls -ltr meta_data
drwxrwxrwx 2 user1 xyz 4096 Sep 13 17:38 meta_data

Selecting from the external table no longer encounters an error:

SQL> select * from foo;

NUM
----------
       100

Do you want to learn Oracle Database for Beginners, then read the following articles.

Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )

 1,798 views last month,  1 views today

I was doing import of a table and started noticing the below error. Even though the database was same.


Tried different methods but it didn’t work. In Oracle support it was mentioned that I may be hitting a bug  and i may have to set NLS_LENGTH_SEMANTICS to char at DB level which was set to byte.


I noticed the table carefully and saw it has a dependency on a Oracle TYPE. 


When i saw its script saw that it was varchar2(20)


CREATE OR REPLACE TYPE ORAUSER1.OFFSET_HDR IS VARRAY(50) of VARCHAR2(20); 



SO I created it manually with an option of «char« in datatype.

SQL> CREATE OR REPLACE TYPE ORAUSER2.OFFSET_HDR IS VARRAY(50) of VARCHAR2(20 char)
  2  /


Type created.


Post that the table was imported successfully.



oracle@linux01:/home/oracle(ORADB)$ impdp / directory=DB_EXP_MOUNT dumpfile=exp_365137_2_%U.dmp logfile=imp_365137_2.log remap_schema=ORAUSER1:ORAUSER2 transform=oid:n parallel=4 cluster=no


Import: Release 12.1.0.2.0 — Production on Thu Jul 12 23:14:07 2018


Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 — 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, Oracle Label Security,
OLAP, Advanced Analytics, Oracle Database Vault and Real Application Testin
Master table «OPS$oracle».»SYS_IMPORT_FULL_05″ successfully loaded/unloaded
Starting «OPS$oracle».»SYS_IMPORT_FULL_05″:  /******** directory=DB_EXP_MOUNT dumpfile=exp_365137_2_%U.dmp logfile=imp_365137_2.log remap_schema=ORAUSER1:ORAUSER2 transform=oid:n parallel=4 cluster=no parfile=exclude_procobj.par table_exists_action=truncate
Processing object type TABLE_EXPORT/TABLE/PROCACT_INSTANCE
Processing object type TABLE_EXPORT/TABLE/TABLE
Table «ORAUSER2″.»RBX_CURVES» exists and has been truncated. Data will be loaded but all dependent metadata will be skipped due to table_exists_action of truncate
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
ORA-31693: Table data object «ORAUSER2″.»RBX_CURVES» failed to load/unload and is being skipped due to error:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
ORA-39779: type «ORAUSER2″.»OFFSET_HDR» not found or conversion to latest version is not possible
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Job «OPS$oracle».»SYS_IMPORT_FULL_05″ completed with 1 error(s) at Thu Jul 12 23:14:10 2018 elapsed 0 00:00:02





impdp: error ORA-29913: error in
executing ODCIEXTTABLEOPEN callout with Solution

DB
hit below error from one of my client during import of a schema:

Starting «SYS».»SYS_IMPORT_FULL_02″: 
/******** AS SYSDBA dumpfile=exp_DC_OCM_2tbs_29Jan2015_1150_%U.dmp
directory=DATAPUMP_DIR3 logfile=imp_exp_DC_OCM_2tbs_29Jan2015_1150.log
table_exists_action=replace remap_schema=test:test parallel=24

Processing object type TABLE_EXPORT/TABLE/TABLE

Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

ORA-31693: Table data object
«TEST».»CI_TAB2_T» failed to load/unload and is being
skipped due to error:

ORA-29913: error in executing ODCIEXTTABLEOPEN
callout

. . imported
«TEST».»CI_TAB1_K_T»               
5.003 MB 1241230 rows

Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

Job «SYS».»SYS_IMPORT_FULL_02″ completed with 1
error(s) at 12:04:50

ORA-31693: Table data object «TEST».»CI_TAB2_T»
failed to load/unload and is being skipped due to error:

ORA-29913: error in executing ODCIEXTTABLEOPEN callout


This is because of bug 8393456, and same can be confirmed on the
Oracle Support website.

The problem seems to be related to cases where you use both PARALLEL
(>1)
 and REMAP_SCHEMA at the same time.
Oracle versions affected are 11.2.0.1, 11.1.0.7 and 10.2.0.4.

Workaround 

implemented  by
setting PARALLEL=1  (even you can user remap_schema) clause

Solution:

Do not user PARALLEL >1 with
REMAP_SCHEMA clause in datapump (impdp).

Drop the table (if exists)
BEGIN
EXECUTE IMMEDIATE ‘DROP TABLE EXT_TEST PURGE’;
EXCEPTION WHEN OTHERS THEN IF SQLCODE != -942 THEN RAISE; END IF;
END;
Verify this does not already exist before running this
Create the «Directory» Object
BEGIN
CREATE OR REPLACE DIRECTORY FULL_SCHEMA_BACKUPS as ‘/mnt/dbbkup/Databkup/FULL_SCHEMA_BACKUPS’
END;
grant read,write on directory FULL_SCHEMA_BACKUPS to TEST_SUH;
Create the «External» table

SQL> CREATE TABLE EXT_TEST

  2  (
  3     TEST_Client VARCHAR2(30 BYTE)
  4     ,REQUEST_ID VARCHAR2(20 BYTE)
  5     ,Measure VARCHAR2(200 BYTE)
  6     ,FirstDate VARCHAR2(25 BYTE)
  7     ,LastDate VARCHAR2(25 BYTE)
  8     ,CHANGED_FIELD VARCHAR2(10 BYTE)
  9     ,OLD_VALUE VARCHAR2(100 BYTE)
 10     ,NEW_VALUE VARCHAR2(100 BYTE)
 11  )
 12  ORGANIZATION EXTERNAL
 13  (
 14    TYPE ORACLE_LOADER
 15    DEFAULT DIRECTORY FULL_SCHEMA_BACKUPS
   16  ACCESS PARAMETERS
  17   (
 18     SKIP 1
 19      FIELDS TERMINATED BY ‘|’
 20      RECORDS DELIMITED BY ‘rn’
 21      MISSING FIELD VALUES ARE NULL
  22     NOBADFILE
   23    NODISCARDFILE
   24    NOLOGFILE
 25    )
 26    LOCATION
  27   (
 28      ‘EXT_TEST.txt’
  ) 29
) 30
 31  REJECT LIMIT 0;

Table created.

SQL> select * from EXT_TEST;
select * from EXT_TEST
*
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-00554: error encountered while parsing access parameters
KUP-01005: syntax error: found «skip»: expecting one of: «column, fields,
records»
KUP-01007: at line 1 column 1

Replaced my code as below and it worked. I am able to query from EXT_TEST table.

CREATE TABLE EXT_TEST
(
                HEDIS_Client VARCHAR2(30 BYTE)
                ,REQUEST_ID VARCHAR2(20 BYTE)
                ,Measure VARCHAR2(200 BYTE)
                ,FirstDate VARCHAR2(25 BYTE)
                ,LastDate VARCHAR2(25 BYTE)
                ,CHANGED_FIELD VARCHAR2(10 BYTE)
                ,OLD_VALUE VARCHAR2(100 BYTE)
                ,NEW_VALUE VARCHAR2(100 BYTE)
)
ORGANIZATION EXTERNAL 
(
  TYPE ORACLE_LOADER
  DEFAULT DIRECTORY FULL_SCHEMA_BACKUPS
  ACCESS PARAMETERS
  (
    RECORDS DELIMITED BY NEWLINE
    LOGFILE FULL_SCHEMA_BACKUPS:’EXT_TEST.log’
    BADFILE FULL_SCHEMA_BACKUPS:’EXT_TEST.bad’ 
    SKIP 1
    FIELDS TERMINATED BY ‘|’
    MISSING FIELD VALUES ARE NULL
          )
  LOCATION
  (
    ‘EXT_TEST.txt’
  )
)

REJECT LIMIT 0;

and removed 
NOBADFILE
NODISCARDFILE
NOLOGFILE

I created an external table using a .tbl file and now Im trying to select all rows from that table, using:

select * from users_load;

But Im getting this error:

ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-30653: reject limit reached 

Do you know why this error is happening? This table have millions of rows, I dont know if can be because of this…

asked Mar 4, 2016 at 20:41

johy's user avatar

You can specify the number of rows allowed to be rejected before throwing an error, or you can specify UNLIMITED. I guess you specified a number, but your .tbl file contains rows that the database can’t parse appropriately based on your definition.

enter image description here

If you want to ignore all malformed rows, you can simply change the limit to UNLIMITED:

alter table users_load reject limit unlimited;

create table example:

CREATE TABLE foo_load (
    employee_number CHAR(5)
) ORGANIZATION EXTERNAL (
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY ext_tab_dir
    ACCESS PARAMETERS (
        ...
    )
    LOCATION ('foo.txt')
)
REJECT LIMIT UNLIMITED; --Use limit, not limited

Community's user avatar

answered Mar 4, 2016 at 20:47

Balazs Papp's user avatar

Balazs PappBalazs Papp

39.8k2 gold badges24 silver badges44 bronze badges

0

Понравилась статья? Поделить с друзьями:
  • Ora 28860 неустранимая ошибка ssl
  • Opera twitch ошибка 4000
  • Ora 28040 no matching authentication protocol ошибка
  • Opera installer ошибка
  • Ora 27477 ошибка