Data Compare Command Line

Before Using the Command line, the user needs to go to the Data Compare and create a profile that can be used as a project/profile to interact with the Command line.

Follow the following links to set up a Data compare profile.

Source Setup

Once the profile is completed use the given Command lines to interact with Data compare Profiles

CLI to Interact with Profiles

This command compares data (as configured) within the Profile named <projectname> and applies various specified options to tailor the comparison process and its outputs.

Commands for Getting the list of profiles present for comparison

This command will help to get the list of all profiles that are created for data compare

// > dbsync-cli.bat dbs compare -list 

Result

Showing the List of profile that is present

Terms defined in Command and their meanings

  • ‘-project=<projectname>’: Specifies the profile containing the database configurations to be compared.

  • ‘-download=<true|false>’: Controls whether to download the comparison reports as files. If ‘true,’ reports selected in the ‘-show’ option will save to the specified output directory; otherwise, a summary is displayed.

  • ‘-show=<Filters>’: Comma-separated filter name(s) determines what to show in the output. Options include ‘all[default]’, ‘onlyInTarget’, ‘onlyInSource’, and ‘different’.

  • ‘-list’: Displays a list of existing projects configured for comparison.

The command for comparing the projects

This command will help to get the “compare” result of the selected profile, which you get in the above step

// >dbsync-cli.bat dbs compare -project=<project name > -download=<false/true> -show=<"OnlyInTarget, OnlyInSource, all"> 

Depending on the Use one can define the properties for Download - If ‘true,’ reports selected in the ‘-show’ option will save to the specified output directory; otherwise, a summary is displayed.

For Show one can select all three option or even one or two depending on what report they want to see either they want to know "onlysource" count "onlydestination" count or "all" counts

The command for comparing the projects with download = false

dbsync-cli.bat dbs compare -project=<project name> -download=false -show="OnlyInTarget, OnlyInSource, all"

// dbsync-cli.bat dbs compare -project=<project name> -download=false -show="OnlyInTarget, OnlyInSource, all"

Example

//>dbsync-cli.bat dbs compare -project=SFtoMySQL -download=false -show="OnlyInTarget, OnlyInSource, all"

Note- As Download is false, this command will only show the results, but the result files will not be downloaded

While processing, it will show the job run's status, date, and completion time.

Results of comparison

Result Shows list of all three

The command for comparing the projects with downloading into a temp folder

dbsync-cli.bat dbs compare -project=<project name> -download=true -show="OnlyInTarget, OnlyInSource, all"

// dbsync-cli.bat dbs compare -project=<project name> -download=true -show="OnlyInTarget, OnlyInSource, all"

Note- As Download is true, this command will only show the results, and also the result files will be downloaded

Example

// dbsync-cli.bat dbs compare -project=SFtoMySQL -download=true -show="OnlyInTarget, OnlyInSource, all"

Results of comparison

Last updated