Pre- and Post-processing using DBV_PRE_PROC and DBV_POST_PROC

Introduction

It is possible to specify your own commands to run before or after Dbvisit Standby transfers or applies the log files. This can be either on the primary server, the standby server or on both. 

This section describes the pre- and post-processing options available in Dbvisit Standby version 6 which is still available in version 7, but it is recommended that you review your scripts and migrate to using the preferred new method introduced in version 7 using the PRE_POST_PROCESSING parameter with one script that handles both pre- and post-processing.

 

On the primary server:
The sequence of events on the primary server is:

  1. Dbvisit Standby pre-processing (here your own commands may be executed)
  2. Dbvisit Standby transfers the archive logs
  3. Dbvisit Standby post-processing (here your own commands may be executed)
  4. Optional Dbvisit Standby Archive log Management Module

On the standby server:
The sequence of events on the standby server is:

  1. Dbvisit Standby pre-processing (here your own commands may be executed)
  2. Dbvisit Standby applies the archive logs
  3. Dbvisit Standby post-processing (here your own commands may be executed)
  4. Optional Dbvisit Standby Archive log Management Module

DBV_PRE_PROC and DBV_POST_PROC settings

DBV_PRE_PROCSpecifies the name of the pre-processing script.
Default value Windows: dbv_pre_processing.cmd
Default value Non Windows: dbv_pre_processing.sh
If a different named script should be called, then this variable can set in the DDC file. If no path name is given the Dbvisit Standby install directory is assumed. 
Example:
    DBV_PRE_PROC = rman_backup.cmd
DBV_POST_PROCSpecifies the name of the post-processing script.
Default value Windows: dbv_post_processing.cmd
Default value Non Windows: dbv_post_processing.sh
If a different named script should be called, then this variable can set in the DDC file. If no path name is given the Dbvisit Standby install directory is assumed. 
Example:
    DBV_POST_PROC = post_procs_all.cmd


Pre-processing (Windows)

The commands will run before Dbvisit Standby transfers or applies the log files. If the pre-processing has to take place before Dbvisit Standby transfers the log files on the primary server, the following commands need to be done on the primary server. If the pre-processing has to take place before Dbvisit Standby applies the log files on the standby server, the following commands need to be done on the standby server. The pre-processing will apply for all databases that use Dbvisit Standby on the server.

 

1. Create an empty file called dbv_pre_processing.cmd in the Dbvisit Standby directory

 

edit dbv_pre_processing.cmd

2. Enter the commands or call the script that you want to execute. If you want Dbvisit Standby to trap the return code and alert if this is not 0, then specify the return code as the exit code (see below). You must ensure that you set the correct return code in your calling script.

 

call_rman.cmd 
exit %errorlevel%

3. If the return code of the pre-processing script is > 0, Dbvisit Standby will stop, an alert will be sent, and Dbvisit Standby will not transfer or apply the log files.

Post-processing (Windows)

The commands will run after Dbvisit Standby has transferred or applied the log files. If the post-processing has to take place after Dbvisit Standby has transferred the log files on the primary server, the following commands need to be done on the primary server. If the post-processing has to take place after Dbvisit Standby has applied the log files on the standby server, the following commands need to be done on the standby server. The post-processing will apply for all databases that use Dbvisit Standby on the server.

 

1. Create an empty file called dbv_post_processing.cmd in the Dbvisit Standby directory

 

edit dbv_post_processing.cmd

2. Enter the commands or call the script that you want to execute. If you want Dbvisit Standby to trap the return code and alert if this is not 0, specify the return code as the exit code (see below). You must ensure that you set the correct return code in your calling script.

 

backup_software.cmd 
exit %errorlevel%

3. If the return code of the dbv_post_processing.sh script is > 0, Dbvisit Standby will stop and an alert will be sent. Dbvisit Standby will have transferred or applied the log files. If the Dbvisit Standby archive module is being used, the Dbvisit Standby archive module will not be invoked.