Installing and configuring the data validator v7

When you install the Replication Server product, the components for the Data Validator are installed as well. Also, when you uninstall the Replication Server product, the Data Validator components are uninstalled.

The following components that you use to run the Data Validator are installed when you install the Replication Server product.

File nameLocationDescription
datavalidator.propertiesXDB_HOME/etcData Validator Properties file
runValidation.sh (Linux)XDB_HOME/binData Validator execution script
runValidation.bat (Windows)XDB_HOME\binData Validator execution script
Note

XDB_HOME is the directory where Replication Server is installed. This might not be the same as the Postgres home directory depending on how Replication Server is installed.

  1. If you plan to use an Oracle database as the source or target database, download the Oracle JDBC driver and place it in the JAVA_HOME/jre/lib/ext directory.

  2. Edit the datavalidator.properties file located in the XDB_HOME/etc directory and specify the connection information for the source and target databases you want to compare.

    You can override any of these parameters with an option when you invoke the Data Validator script. See Performing data validation for information on invoking the Data Validator.

    The following are the parameters in the datavalidator.properties file.

    ParameterDescripton
    source_dbmsType of the source database. Values can be enterprisedb, oracle, sqlserver, sybase, or mysql.
    source_hostIP address or server name of the host running the database server of the source database
    source_portPort number on which the database server of the source database listens for requests
    source_databaseDatabase name of the source database
    source_userDatabase user name of the source database
    source_passwordUnencrypted password of the source database user
    target_dbmsType of the target database. Values can be enterprisedb or oracle.
    target_hostIP address or server name of the host running the database server of the target database
    target_portPort number on which the database server of the target database listens for requests
    target_databaseDatabase name of the target database
    target_userDatabase user name of the target database
    target_passwordUnencrypted password of the target database user

    The following is the initial content of the datavalidator.properties file after installation:

        ###############################################################
                Source database connection
        ###############################################################
    
        #source_dbms=(enterprisedb | oracle | sqlserver | sybase | mysql)
    
        source_dbms=oracle
        source_host=localhost
        source_port=1521
        source_database=xe
        source_user=hr
        source_password=hr
    
        #source_dbms=mysql
        #source_host=localhost
        #source_port=3306
        #source_database=test
        #source_user=root
        #source_password=
    
        #source_dbms=sqlserver
        #source_host=localhost
        #source_port=1433
        #source_database=pubs
        #source_user=sa
        #source_password=
    
        #source_dbms=sybase
        #source_host=localhost
        #source_port=5004
        #source_database=test
        #source_user=sa
        #source_password=
    
        ###############################################################
                Target database connection                   
        ###############################################################
    
        #target_dbms=(enterprisedb | oracle)
    
        target_dbms=enterprisedb
        target_host=localhost
        target_port=5444
        target_database=edb
        target_user=enterprisedb
        target_password=edb
  3. Before invoking the Data Validator for the first time, determine the location of the Data Validator logs directory.

    The Data Validator generates a log file with a name formatted as datavalidator_yymmdd-hhmiss.log in the logs directory for each run.

    If there are row differences between the source and target tables, a file with a name formatted as datavalidator_yymmdd-hhmiss.diff is also generated that contains output of the errors in diff format. Use a graphical diff tool like Kompare to view this file to highlight the specific differences.

    The Data Validator attempts to create a subdirectory named logs in the XDB_HOME/bin directory the first time you invoke the Data Validator without the -ld option. If you don't invoke the Data Validator as the root account, the run will likely fail as it attempts to create subdirectory logs in the XDB_HOME/bin directory. Typically only the root account has this privilege.

    Windows hosts have the same situation, as the account you're using must have the permission to create a subdirectory in the XDB_HOME\bin location. Choices for determining and setting the Data Validator directory for the log and diff files are the following:

  • Run the Data Validator as the root account. This approach enables the Data Validator to create the logs subdirectory in the XDB_HOME/bin directory and then to create the log and diff files in the logs subdirectory.

  • Create the XDB_HOME/bin/logs directory structure before running the Data Validator. Modify the permissions on directory XDB_HOME/bin/logs so the operating system account you use to run the Data Validator has the privilege to create files in the directory.

  • Use the -ld log_directory_path option to allow the Data Validator to create the log and diff files in the specified directory location log_directory_path. Be sure the operating system account you use to run the Data Validator has the privileges to either create the lowest level subdirectory specified by log_directory_path if it doesn't already exist or to create files in the specified directory if the full directory path already does exist.

    Once you have determined and verified that the operating system account you plan to use to run the Data Validator can create files in the log directory, you can proceed with performing data validation.