Use second pass replication to perform audit data warehouse tasks,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 irrespective 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, AUDIT_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

Use the following procedure to o set up second pass replication:

  1. Create a copy of the Pro2 setup in directory and rename it to append it with SecondPass. For example, if your setup is in the folder Pro2v60, copy paste that folder and rename it to Pro2v60_SecondPass.
    Note: Copy all folders from the Pro2 setup in the appended second pass folder except db and Pro2Lan folders.
  2. Create a new folder named db in newly created second pass folder. This db folder is created for the target database.
  3. Open Proenv window and enter cd C:\<Pro2 second pass folder>\db to navigate to the db folder. For example, cd C:\Pro2v60_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. Now 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 on screen once the load is complete.
  10. Navigate to C:\<Pro2 second pass folder>\bprepl\scripts (C:\Pro2v60_SecondPass\bprepl\scripts) folder. Right click the Pro2 - Editor tool and select Properties. The Pro2 - Editor Properties window appears.
  11. On the Shortcut tab, edit the Start in field to reflect the <Pro2 second pass folder> folder. For example, C:\Pro2v60_SecondPass.
  12. Edit the Pro2_env.bat file to set the value of the Pro2 setup location to the Second Pass directory.
  13. Open the replProc.pf file from C:/Pro2v60_SecondPass/bprepl/scripts folder and modify the replication database section to point to the Pro2 setup.
    Note: This is not the second pass directory but the Pro2 setup directory.
  14. Save the contents of the replProc.pf file.
  15. Similarly, edit the sports2020.pf file and modify the target databases section to point to the database in the Pro2 setup. Save the contents of the sports2020.pf file.


  16. From C:/Pro2v60_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_4audit.p to tmpl_replproc_WAN_<TgtDb>.p.
    • For a LAN setup, rename the file tmpl_replproc_4audit.p to tmpl_replproc_pro2pro.p.
  17. From C:\Pro2v60_SecondPass, open the predefs.i file and change the value for AUDIT_PASS to YES.
  18. Navigate to the Pro2 web user interface, and select Properties. Edit the WRI_TRIG_TEMPLATE to reflect tplt_repltrig-raw.p as Value. Click Save.
  19. Navigate to the Pro2 web user interface, and select Properties. Edit the DEL_TRIG_TEMPLATE to reflect tplt_repltrig-raw.p as Value. Click Save.
  20. From the \Pro2v60_secondpass\bprepl\scripts folder, double click the batchgen_GEN_PROCS.bat file to generate code.