Use second-pass replication to perform audit data warehouse tasks, and track changes to a table during a time interval for any or all fields.

Second-pass replication creates a copy of the source table in the second-pass database and, inserts a record into this table each time there is a change in the source table (for UPDATE, DELETE, INSERT).

A new record is created in the target (or staging) table every time there is a change in the table, regardless of whether the change happens to the same field. The replicated table holds a new record for every change in the source table. A new property, SECOND_PASS, is added to the predefs.i file. This property supports second-pass replication and the default value of this parameter is set to NO. To start Second Pass Replication for a setup, this property should be set to YES for that specific setup.

Set up second-pass replication

To set up second-pass replication:

  1. Create a copy of the Pro2 setup directory and rename it, appending it with SecondPass. For example, if your setup is in the folder Pro2v61, copy paste that folder and rename it to Pro2v61_SecondPass.
    Note: Copy all folders from the Pro2 setup directory to the second-pass folder except for the db and Pro2Lan folders.
  2. Create a new folder named db in the newly created second-pass folder. This db folder is created for the target database.
  3. Open a Proenv window and enter cd C:\Pro2 second-pass folder\db to navigate to the db folder, for example, cd C:\Pro2v61_SecondPass\db
  4. Create an empty target database from the Proenv window. Enter Prodb target database name empty, for example, Prodb secondtgt empty.
  5. Start the target database from the Proenv window. Enter Proserve target database name -S port number for example, Proserve secondtgt -S 6677.
  6. Load the schema in the target database. In the Proenv window enter Prowin target database name, for example, Prowin secondtgt.

    The Procedure Editor window appears.

  7. Navigate to Tools > Data Administration.

    The Data Administration window appears.

  8. Navigate to Admin > Load Data and Definitions > Data Definitions (.df file).

    The Load Data Definitions window appears.

  9. Select the schema file as the input file, for example, Sports-tgt.df. Click OK.

    A success message appears after the load is complete.

  10. Navigate to C:\Pro2 second pass folder\bprepl\scripts folder, for example, C:\Pro2v61_SecondPass\bprepl\scripts.
  11. Right-click the Pro2 - Editor tool, and select Properties.

    The Pro2 - Editor Properties window appears.

  12. On the Shortcut tab, edit the Start in field to reflect the Pro2 second pass folder, for example, C:\Pro2v61_SecondPass.
  13. Edit the Pro2_env.bat file to set the value of the Pro2 setup location to the second-pass directory.
  14. Open the replProc.pf file from C:/Pro2v61_SecondPass/bprepl/scripts folder, and modify the replication database section to point to the Pro2 setup.
    Note: This is not the second-pass directory. Use the Pro2 setup directory.
  15. Save the contents of the replProc.pf file.
  16. Edit the sports2020.pf file, and modify the target databases section to point to the database in the Pro2 setup directory. Save the contents of the sports2020.pf file.


  17. From C:/Pro2v61_SecondPass/bprepl/repl_tmpl, rename the process library template name in second-pass setup directory.
    • For a WAN setup, rename the file tmpl_replproc_WAN_4SECOND_PASS.p to tmpl_replproc_WAN_TgtDb.p.
    • For a LAN setup, rename the file tmpl_replproc_4SECOND_PASS.p to tmpl_replproc_pro2pro.p.
  18. From C:\Pro2v61_SecondPass, open the predefs.i, file and change the value for SECOND_PASS to YES.
  19. Navigate to the Pro2 web interface, and select Properties. Edit the WRI_TRIG_TEMPLATE to reflect tplt_repltrig-raw.p as Value. Click Save.
  20. Navigate back to the Properties tab. Edit the DEL_TRIG_TEMPLATE to reflect tplt_repltrig-raw.p as the Value. Click Save.
  21. From the \Pro2v61_secondpass\bprepl\scripts folder, double click the batchgen_GEN_PROCS.bat file to generate code.