Load Copy Operations in a DB2 HADR Environment

The Load Copy Operations are primarily performed on the High Availability Disaster Recovery (HADR) environments. You can use the Commvault library to perform a DB2 load copy operation in a HADR environment.

In a HADR environment, you have a primary server and a standby server on to which you will move the data using the DB2 Load Copy utility. DB2 load copy operation allows you to efficiently move large quantities of data in to the newly created tables or in to the tables that already contain data. The load copy enables you to write the formatted pages directly in to the database rather than using SQL inserts.

When you use the load copy operations, you must take some special considerations because the load copy operation is not replicated to the standby database. If you use the load command to import a table to the primary database, then the same table on the standby database is unavailable because the primary and standby database operations are not synchronized. Use the Load Copy utility with the COPY Yes option.

For additional information, go to the DB2 Knowledge Center, LOAD COPY.

Before You Begin

Best Practice: Configure a persistent pipeline to enhance performance. For more information, see Configuring a Persistent Pipeline for DB2 HADR Operations.

Procedure

Use the following steps to perform a load copy operation in a HADR Environment:

  1. Connect to the primary database.

    Example:

    db2 connect to sample
  2. Run the DB2 command to export the data file.

    Example:

    db2 "export to emp1.del of del select * from employee"
  3. Configure the destination table.

    • If the table exists, then make sure that the table structures match.

    • If you have not already created the table for the copy operation, then from the command line, run the following operation:

      The table structures must match.

      db2 create table empcopy like emp
  4. Run the DB2 command to perform a load copy operation.

    View the db2diag.log to verify whether the load operation is successful on the standby server instance.

    Example:

    db2 "load from /home/db2inst2/emp1.del of del replace into empcopy copy yes load '/opt/commvault/Base/libDb2Sbt.so'"

    A restore operation to restore the load copy image of the last incremental backup will automatically commence on the standby DB2 server.

You can also use the db2diag.log file on the standby server to verify the load copy operations. The following lines are displayed:

Starting to restore a load copy. 
 MESSAGE : Load Copy restore: first media reader started. 
 MESSAGE : Media controller -- all restore files processed 
 MESSAGE : Load copy restored MESSAGE : Load copy restore completed successfully.

Loading...