IBM Books

Data Movement Utilities Guide and Reference


Using Export to Move DB2 Data Links Manager Data

Since table data resides in the database, and the files referred to by DATALINK columns reside on Data Links servers, the export utility must move both the database data, and the data files on the corresponding Data Links servers (see Figure 8). To do this, the export utility produces one control file per Data Links server. The name of the control file is the same as the name of the Data Links server. The control files are created in a new directory that has the name dlfm/YYYYMMDD/HHMMSS, where YYYYMMDD represents YearMonthDay, and HHMMSS represents HourMinuteSecond. This directory is created under the same directory in which the export data file is created. A control file lists the names of the corresponding DB2 Data Links Manager files that are referenced by the DATALINK columns of the rows that are exported.

On the WINDOWS NT operating system, the export utility produces only one control file for all Data Links servers. The name of this control file is ctrlfile.lst. It is created in a new directory that has the name dlfm\YYYYMMDD\HHMMSS. This directory is created under the same directory in which the export data file is created. The control file lists the URLs of all DB2 Data Links Manager files that are referenced by the DATALINK columns of the rows that are exported.

DATALINK values that have the NO LINK CONTROL property are not placed in the control file.

The control files must be transported to their respective Data Links servers. On the Windows NT operating system, the single control file must be transported to all referenced Data Links servers. The dlfm_export utility should be run at each Data Links server, specifying the control file name. This utility produces an archive of the files listed in the control file for that Data Links server.

To ensure that a consistent copy of the table and the corresponding files that are referenced by the DATALINK columns are copied, perform the following steps:

  1. Ensure that no update transactions are in progress when the export operation is running by issuing the following command:
       db2 quiesce tablespaces for table tablename share
    

  2. Invoke the export utility.

  3. Run the dlfm_export utility with root authority at each Data Links server; this will successfully archive files to which the Data Links File Manager administrator may not have access. As input to dlfm_export, specify the name of the control file that was generated by the export utility.

  4. Make the table available for updates by issuing the following command:
       db2 quiesce tablespaces for table tablename reset
    

The export utility executes as an SQL application. The rows and columns that satisfy the conditions of the SELECT statement are extracted from the database. For DATALINK columns, the SELECT statement should not specify any scalar functions.

The export utility generates the following files:

Use the dlfm_export utility to export files from a Data Links server as follows:

   dlfm_export control-file-name archive-file-name

where control-file-name is the name of the control file generated by running the export utility on the DB2 client, and archive-file-name is the name of the archive file that will be generated. The default archive-file-name is export.tar, located in the current working directory.

A complementary utility called dlfm_import is provided to retrieve and restore files from the archive that dlfm_export generates. This utility must be used whether the archived files are being restored on the same, or a different, Data Links server.

Use the dlfm_import utility to retrieve files from the archive as follows:

   dlfm_import archive-file-name

where archive-file-name is the name of the archive file that will be used to restore the files. The default archive-file-name is export.tar. Run the dlfm_import utility with root authority at each Data Links server, because you may want to restore the archived files on a different Data Links server, which may not have the same directory structure and user IDs as the Data Links server on which the dlfm_export utility was run.

Notes:

  1. The DB2 Data Links Manager does not have to be running when you invoke these utilities.

  2. When running the dlfm_import utility on a Data Links server other than the one on which the dlfm_export utility was run, the files will be restored in the correct paths. The files will be owned by root in case some of the user IDs do not exist on the importing machine. Before inserting these files into a database, ensure that all files have the correct permissions and belong to the correct user IDs.

The following table shows how to export the DB2 data and the files that are referenced by the database called SystemA to the database called SystemB. SystemA uses the Data Links servers DLFM1 and DLFM2. SystemB uses the Data Links servers DLFMX and DLFMY. The files on DLFM1 will be exported to DLFMX, and the files on DLFM2 will be exported to DLFMY.
Database SystemA with Data Links Servers DLFM1 and DLFM2 Step
DB2 data on File File1 with file names for DLFM1 File2 with file names for DLFM2 1) Run the dlfm_export command (as root) on both Data Links servers. This will produce an archive on both Data Links servers.
Database SystemB with Data Links Servers DLFMX and DLFMY

On DLFMX, restore from archive On DLFMY, restore from archive 2) Run dlfm_import (as root) on both Data Links servers.



3) Run the IMPORT command on SystemB, using the parameter DL_URL_REPLACE_PREFIX to specify the appropriate Data Links server for each exported file.
When you run the IMPORT command on SystemB, the SystemA data and all files referenced by DATALINK columns are imported.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]