create job

Creates a new job from one or more comparesets, schedules, and comparison options.

Syntax

create job job_name
set max_concurrent_comparisons [{to|=}] 
number_of_max_concurrent_comparisons
[and set desc [{to|=}] description]]
add comparison comparison_name
set COMPARESET=compareset_name
and set comparison_param [{to|=}] value
[with column option 
set column_name [{to|=}] {literal | column_hash | row_hash}
[set column_name [{to|=}] {literal | column_hash | row_hash}] […]]
[and comparison comparison_name 
set COMPARESET =compareset_name
and set priority [{to|=}] {highest | high | normal | low}…
[with column option
set column_name [{to|=}] {literal | column_hash | row_hash}
[set column_name [{to|=}] {literal | column_hash | row_hash}]
[…]]]
[add schedule schedule_name  
set schedule_param [{to|=}] value
To clone an existing job:
create job with exist_job_name
set max_concurrent_comparisons [{to|=}] 
number_of_max_concurrent_comparisons
[add schedule schedule_name  
set schedule_parameters [{to|=}] value
[and set desc [{to|=}] “description”]
to
create job job_name with exist_job_name

Parameters

  • job_name – the name of the job to be created.
  • exist_job_name – the name of an existing job to be cloned.
  • comparison_name – the name of the comparison to be added to the job.
  • compareset_name – the name of the compareset to be added into the comparison.
  • schedule_name – the name of the schedule to be added.
  • max_concurrent_comparisons – (Optional) the number of the comparisons that can be run concurrently with a job. The default value is 5
  • description – (Optional) description of the agent. Use double quotes if you are using a reserved word or blank spaces.
  • comparison_param – defines various comparison options for the job, all of which are optional.
  • value – defines a value for the comparison_param.
    Comparison Options
    comparison_param value

    ABORT_DIFF_MAX

    Aborts row comparison if the difference count exceeds the specified value.

    Valid values: 1 to 9223372036854775807.

    Default value:1000.

    ABORT_DIFF_ROW_COUNT

    Determines whether to abort row comparison if table row counts do not match.

    Valid values: true or false.

    Default value: false.

    AUTO_RECONCILE

    Indicates whether to automatically apply the reconciliation script.

    Valid values: true or false.

    Default value: false.

    Note: To enable AUTO_RECONCILE, set CREATE_COL_LOG to true.

    COMPARE_MODE

    Specifies the row comparison mode.
    • row_compare – compares all table rows.
    • key_compare – compares the primary key columns.
    • row_count – compress row count.

    Default value: row_compare.

    COMPRESS_DATA_TRANSFER

    Compresses the row data between the agent and the server.

    Valid values: true or false.

    Default value: false.

    CREATE_COL_LOG

    Generates a column differences log, which lists all missing, orphaned, and inconsistent row values (keys and columns). Create a column log if you want to:
    • Generate a reconciliation script
    • Perform automatic reconciliation
    • Generate a detailed report

    Valid values: true or false.

    Default value: false.

    CREATE_RECON_SCRIPT

    Generates a reconciliation script. To use this parameter, you must also set CREATE_COL_LOG to true.

    Valid values: true or false.

    Default value: false.

    ENABLE_ROW_COUNT

    Determines whether or not to count source and target table rows before they are compared. DA server uses the row count to estimate the comparison progress and end time.
    Note: DA server counts rows if COMPARE_MODE is row_count. Use ENABLE_ROW_COUNT only if COMPARE_MODE is a value other than row_count.

    Valid values: true or false.

    Default value: true.

    EXTERNAL_SORT

    Sorts rows on the agent, thereby reducing the impact of processing the ORDER BY clause in the databases.

    Valid values: true or false.

    Default value: false.

    HASH_TYPE

    Specifies the hash type for the comparison.
    • database_hash – use the hash function provided by the database.
    • agent_hash – use the hash function provided by Replication Server Data Assurance Option.

    Default value: database_hash.

    RETRY_DIFF

    Specifies the retry option.
    • never – no recompare.
    • wait_and_retry – run recompare based on RETRY_MAX and RETRY_DELAY_SEC settings.

    Default value: never.

    RETRY_DELAY_SEC

    Specifies the number of seconds delay for each recomparison.

    Valid values: 0 to 86400.

    Default value: 10.

    RETRY_MAX

    Specifies the total number of recomparison for rows that have differences resulting from a previous comparison.

    Valid values: 0 to 100.

    Default value: 3.

    Column Comparison Option
    Column Option Value

    COMPARE_MODE

    Specifies for how each column is compared.
    • column_hash – compares using column hash value.
    • row_hash – compares all columns with this option together with a whole hash value.
    • literal – compares using column literal value.
  • schedule_param – defines the scheduling option for the job.
  • value – defines a value for schedule_param.
    Scheduling Option Parameters
    schedule_param value

    date_value

    Specifies a date in the scheduler.

    time_value

    Specifies a time in the scheduler.

    month_day_value

    Specifies the day of the month in the scheduler.

    cron_value

    Specifies the cron option value in the scheduler.

Examples

  • Example 1 – creates a new job named “myjob_1”:
    create job myjob_1
    set max_concurrent_comparisons = 3
    add comparison mycomparison_1 
    set compareset=mycompareset_1
    and set priority = high 
    with column option
    and set a = literal
    set b = hash
    and comparison mycomparison_2 
    set compareset=mycomparset_2
    and set priority = normal 
    with schedule myschedule_1 
    set type=every_days
    and set every=2
    and set time=10:00
    and set keep=1
    and set keep_unit=months
    and set date=2011-05-05
    go
    The returned result is:
    Job “myjob_1” was created successfully.
  • Example 2 – clones “myjob_1” to a new job “myjob_2”:
    create job myjob_2 with myjob_1 
    go
    The returned result is:
    Job “myjob_2” was created successfully.

Usage

  • The names of the comparisons in a cloned job are generated automatically (if not explicitly specified). The rule is job_name_cloned_comparison_sequence_number, where sequence_number starts from one.

  • When cloning jobs, you can redefine only the scheduling options. The comparison options are automatically imported from the existing job.