Entering content frame

Background documentation FASTLOAD Command Locate the document in its SAP Library structure

With this Loader command, you can control how the application data is loaded to the specified table.

Prerequisites

·        The target table exists in the database instance. Otherwise, the table can be created using an appropriate SQL statement before the FASTLOAD command is executed.

·        You have logged on to the Loader with the user who is the owner of the target table.

·        The data in the data stream to be imported is sorted in ascending order in the sequence of the primary key.

·        The target table does not have an index.

·        If the target table already contains application data, only those data records whose key values are greater than the largest key value in the target table can be inserted.

·        The data that you want to load does not contain LONG columns.

Syntax

<fastload_command> ::=
FASTLOAD [<usage_spec>] TABLE <
table_spec> [<load_column_spec_mlt>] <instream_spec>

<usage_spec> ::=
  WITH <valUSAGE> % USAGE
| WITH <valUSAGE> ROWS USAGE

valUSAGE

Positive integer

For a percentage, this number must be between 50 and 100.

When specifying the number of rows, the length of individual table records is important.

Explanation

FASTLOAD commands are processed while the database is running.

Note

When application data is loaded using FASTLOAD, it is entered directly in the pages of the database instance. This command loads data more quickly than the DATALOAD command. However, because it does not write any log entries, you must back up the new data after you have loaded it. You can either back up the appropriate pages (incremental data backup) or all the data (complete data backup). The table is write-protected until you back up the new application data.

Process Flow

When a FASTLOAD command is started, the target table of the load operation in the database instance is locked so other users cannot write to it. The target table can, however, still be read.

All other tables can be read and written to, without any restrictions.

Once a FASTLOAD command has been processed, other write operations triggered with FASTLOAD can be performed in this table by the same user. Once the load operation with FASTLOAD has been completed, all users only have read access to the table.

A backup of the database instance must be created before this table is released again for write operations from other users.

<usage_spec>

You can use the syntax rule usage_spec to define to what extent a page in a table is to be filled with data records.

To do so, you can specify a percentage between 50 and 100 or define the number of rows (data records) that you want to load to each table page. If you specify a number of rows that exceeds the actual number possible, the Loader displays an error message during the load operation, indicating the maximum number of rows permitted for each table page.

The default setting in the Loader is 80 %.

·        If the table is not modified at all, or only slightly, it is a good idea to utilize the occupied memory by more than 80%.

·        If considerable dynamic growth is anticipated for the table, it is a good idea to utilize the occupied memory by less than 80%.

Note

Specifying the desired memory utilization does not guarantee that it will actually be achieved. Use the Database Manager program to check the current memory utilization for the relevant table.

Example

You want to specify a memory utilization of 100% to FASTLOAD data from the data stream customer.data to the customer table.

FASTLOAD WITH 100 % USAGE
TABLE customer
  cno           1
  title         2
  firstname     3
  name          4
  zip           5
  address       6
INSTREAM 'customer.data'

Example

You want to enter 25 data records in each table page in the database instance.

FASTLOAD WITH 25 ROWS USAGE
TABLE customer
  cno           1
  title         2
  firstname     3
  name          4
  zip           5
  address       6
INSTREAM 'customer.data'

Result

The data from the source table has been loaded from the data stream to the target table.

Errors

If the load operation cannot be ended successfully, the Loader logs the last row that was inserted successfully in the table, the number of rows inserted, and the number of rows rejected in the log file.

 

Leaving content frame