DB2 10.5 for Linux, UNIX, and Windows

Ingesting data

You can use the ingest utility to continuously pump data into DB2® tables using SQL array inserts, updates, and deletes until sources are exhausted.

Before you begin

Before invoking the ingest utility, you must be connected to the database into which the data will be imported.

By default, failed INGEST commands are restartable from the last commit point; however you must first create a restart table, otherwise you receive an error message notifying you that the command you issued is not restartable. The ingest utility uses this table to store information needed to resume an incomplete INGEST command from the last commit point. For more information about this, see Creating the restart table.

About this task

For a list of the required privileges and authorities, see INGEST command authorization.

Restrictions

For a comprehensive list of restrictions for the ingest utility, see Ingest utility restrictions and limitations.

Procedure

Issue the INGEST command specifying, at a minimum, a source, the format, and the target table as in the following example:
INGEST FROM FILE <source_file>      
    FORMAT DELIMITED      
    INSERT INTO <table-name>; 
It is recommended that you also specify a string with the RESTART NEW parameter on the INGEST command:
INGEST FROM FILE <source_file> 
   FORMAT DELIMITED      
   RESTART NEW 'CDIjob001'
   INSERT INTO <table-name>; 
The string you specify can be up to 128 bytes. Because the string uniquely identifies the INGEST command, it must be unique across all INGEST commands in the current database that specified the RESTART NEW option and are not yet complete.

Example

For an extensive list of examples, see Examples.

What to do next

If the INGEST command completes successfully, you can reuse the string specified with the RESTART NEW parameter.

If the INGEST command fails and you want to restart it, you must specify the RESTART CONTINUE option with the string you specified in the original command.

If you do not plan to restart the failed INGEST command and you want to clean up the entries in the restart table, rerun the INGEST command, specifying the RESTART TERMINATE option.