IBM Books

Replication Guide and Reference


Customizing and Running Replication SQL Files

You have the option to run a replication task immediately or save the SQL generated by a replication action in an SQL file to be updated and run at a later time. The SQL files can be customized for large scale replication actions such as defining subscriptions, or customized for the application beyond implementations supported by the Control Center.

SQL files allow you to customize the replication tasks for your site or application and give you flexibility as to when and how you run the files. You can:

If you save the definitions of a large replication subscription in an SQL file, you can replay the definitions as necessary.

Types of customizing that you might do include:

After completing a replication task, such as defining a replication source, the Run Now or Save SQL window opens, giving you a choice to run the SQL for the task now, or save it so you can edit it and run it later.

To defer the replication action SQL files:

  1. Select the Save SQL to file and run later check box in the Run Now or Save SQL window.

  2. Click on OK. The Save SQL File window opens.

  3. Type the name and file path for the file.

  4. Click on OK to close the window and save the SQL file. A confirmation window indicates that the file has been saved.

After you defer the SQL file, you can customize the file for your application.

To customize a replication action SQL file:

  1. Open the SQL file that you saved as ASCII in an editor.

  2. Edit the file for your site or application.

  3. Click on OK to close and save the file.

You can run deferred files from the Control Center.

To run deferred replication action SQL files:

  1. In the Control Center, select the replication folder for the object type that you are running the SQL file for. For example, if you saved and customized an SQL file to define a replication source, select the Replication Sources folder.

  2. Click mouse button 2 to display the pop-up menu for the folder and select the Run SQL files menu choice. The Run SQL File window opens (Figure 16).

    Figure 16. The Run SQL files menu choice. The Run SQL files menu choice is used to run deferred SQL files for the replication object you select.
    * Figure ASNV2105 not displayed.


  3. Select the directory path and file name of the SQL file.

  4. Click on OK to run the file. A confirmation window opens indicating when the SQL file has run successfully.

You can also run the SQL file from the DB2 Universal Database Command Line Processor (CLP) or the DB2 Universal Database Command Center.


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

[ DB2 List of Books | Search the DB2 Books ]