Specify insert process parameters

An insert or load request is required to restore data from each archive file. You can list several insert or load requests, and provide criteria to match each restored archive file with the appropriate request. In the Restore Request Editor, select Insert as the Restore Process option.

Specify Request Selection Mode

Use the Request Selection Mode options to specify the type of criteria.

During processing, each archive file is compared with the listed insert or load requests, according to the Request Selection Mode criteria. The first request that matches the criteria is used to restore the data in that file. If no match is found, data from the file is not restored, and an error occurs.

Use the Request Selection Mode box to select a mode and provide criteria for each listed insert or load request, as follows:

Data Model

When you select Data Model, each archive file is compared to the file specified as the source in each listed insert or load request until a match is found. The file referenced in the insert or load request must exist. The two files match if:

  • They contain the same number of tables with the same names, and
  • If the table map references a column map, the corresponding archive file and database tables match exactly, containing the same number of columns with the same names, and compatible data types.

The first listed insert or load request that meets these conditions is used to restore data in the archive file. The data model is the only criteria for this selection mode. The description associated with each listed insert or load request is displayed for reference.

Date

When you specify Date as the selection mode, you must enter a start date and an end date for each listed request. Click the down arrow to select a date from a calendar. The creation date of each archive file is compared with the date criteria you specify for an insert or load request. If the date falls within the range, the request is used to restore data in the file.

Description

When you specify Description as the selection mode, you must enter a description for each listed insert or load request. The description contained in each archive file is compared with the description you specify for each insert or load request. If the description matches, the request is run to restore the data in the file. If the data model does not match, the result of using the request to restore the archive file is unpredictable.

Group

When you specify Group as the selection mode, you must enter a group name for each listed insert or load Request. The group name contained in each archive file is compared with the group name you specify for each insert or load request. If the group name matches, the request is run to restore the data in the file. If the data model does not match, the result of using the request to restore the archive file is unpredictable.

For this scenario, select Data Model as the request selection mode.

Add insert request

You can use an existing insert request, or create a new request. A named request is stored in the directory and can be used in other processes; a local request is stored with the restore request and is not available to other processes.

To list an existing insert request, right-click the Insert Request(s) grid and click Add Insert Request > Existing to open the Select an Insert Request dialog. The submenu also provides selections that open the Insert Request Editor, populated with the most recent entries, to allow you to create a new insert request. For this scenario, however, you are creating a local insert request, based on the archive file listed on the restore request.

Create local insert request

In the Archive Files grid, right-click the file name and click Create Insert Request > Local to open the Insert Request Editor.

Insert Request Editor

You use the Insert Request Editor to create and edit insert requests. In the Description box, you can enter text that describes the purpose or function of the insert request. For this scenario, type Restore Order for Customer.

Source File

The name of the selected archive file is inserted as the Source File. Other controls and options on the Insert Request Editor are populated with the most recent entries. The source file serves several purposes:

  • When creating a new insert or load request, the source file serves as the model for building the table map used with the insert request.

  • If the Insert Request Selection Mode is Data Model, the source file provides the data model used to match the insert or load request with the archive file to restore.

  • When the Insert Request Selection Mode for the restore process is Data Model, each archive file to be restored is compared to the source file in listed insert or load requests until a match is found. If the Insert Request Selection Mode is not Data Model, the date, description, or group for the archive file is compared to that for listed requests until a match is found. If the data model does not match, the result of using the request to restore the archive file is unpredictable.

  • When you restore an archive file using the selected request, the source file name is overridden with the name of the matching archive file.

Control File

The control file records the success or failure of insert processing for each row. In this scenario, select the name of the control file used in the delete process. A confirmation dialog will prompt you to overwrite the file when you run the restore process.

Table Map Options

A table map directs the placement of restored data by identifying and matching tables in the source, or archive file, with those in the database. In addition, you can use a table map to exclude tables from processing. Use Table Map Options to select or create a named table map that is saved and can be used with other process requests, or to create a local table map saved as part of the insert request. For this scenario, select Local to create a local table map.

Delete Options

Use Delete Options to delete rows from all or specified destination tables or retain all rows in destination tables for processing (no delete). For this scenario, use the default setting No Tables to retain rows already in the database.

Process Options

Use Process Options to select the type of insert processing and specify parameters used in processing. You can insert new rows only; insert new rows and update existing rows; or update existing rows only. You can apply these options globally, or on a table-by-table basis.

You can also lock each table until all rows are processed, process a specified number of rows before committing the changes to the database, and discard rows until a particular number is reached and then stop the process. See Delete Options for additional information about these options.

For this scenario, ensure that Insert is selected, clear Lock Tables, clear Commit Frequency to use the maximum product options limit, and specify 0 for Discard Row Limit.

The remaining options do not apply to this scenario. Retain the default settings.

Edit the Table Map

At this point in the scenario, edit the table map to indicate how data is placed within the destination tables. A table map matches the source tables in the archive file to the destination tables in the database. You can also use a table map to exclude tables from the process.

In the Insert Request Editor, click Tools > Edit Table Map to open the Table Map Editor.

Table Map Editor

The source archive file name and the qualifier for tables in the file are displayed. You must provide a destination qualifier to identify the destination tables. To prefix the table names in the table map, enter the dbalias and creatorid that correspond to the sample database tables. Also, a description can be a useful way to identify a table map. For this scenario, type Map ORDERS and DETAILS.

Tables tab

Using the grid on the Tables tab, you can match source tables in the archive file to destination tables in the database. The Destination Table column is initially populated with names of tables for which Delete Rows after Archive is selected in the access definition used to create the source archive file.

To restore archived rows to the ORDERS and DETAILS database tables, verify that the table map matches:

  • Source table ORDERS to destination table ORDERS.
  • Source table DETAILS to destination table DETAILS.

To exclude the ITEMS and CUSTOMERS tables from processing, verify that the destination table cells for source tables ITEMS and CUSTOMERS are blank.

When finished, click File > Update and Return to return to the Insert Request Editor. Then click File > Update and Return on the Insert Request Editor to return to the Restore Request Editor.



Feedback