This topic gives detailed description of command line switches and examples of their usage.
You can select the required options while setting the comparison in the Data Comparison wizard and generate a file with command line arguments by clicking Save settings to a
To get more information on switches related to data comparison in the command line interface, you can type:
C:\Program Files\Devart\dbForge Data Compare for PostgreSQL>datacompare.com /datacompare /?
Below all switches of this option are described, together with usage examples.
Action | Parameter |
---|---|
Compare data | /datacompare |
Load command line settings from a comparison .dcomp project file | /compfile:<path> |
Generate a comparison log file in the specified directory | /log:<filepath> |
Generate data comparison report file. | /report:”:<filepath> |
Specify report format | /reportformat:<HTML/XLS> |
Generate and save a synchronization script, specify the file location and name. If an output file path is specified, the program will generate only a synchronization script. | /sync:”D:\sync_script.sql” |
To practice comparison and synchronization through the command line, try to generate a synchronization
script for a database backup and a live database. To do this, you should first change the default path
in the command line by typing cd
/source connection:"Host=pgSqlHost;Port=5435;Database=db1;User ID=postgres;Password=postgres;Pooling=False;Unicode=true;"
/target connection:"Connection Lifetime=120;Host=pgSqlHost2;Port=5436;Database=db2;User ID=postgres;Password=postgres;Pooling=False"
/source server:db port:5440 user:postgres password:postgres database:db1
/target server:db2 port:5440 user:postgres password:postgres database:db2
Compare data using settings from a file saved earlier:
/datacompare.com /compfile:"D:\workDir\DC1vsDC2.dcomp"
Compare and synchronize data using connection string. Log will be written to the specified file:
/datacompare.com /source connection:"Connection Lifetime=120;Host=pgSqlHost;Port=5435;Database=db1;User ID=postgres;Password=postgres;Pooling=False" /target connection:"Connection Lifetime=120;Host=pgSqlHost2;Port=5436;Database=db2;User ID=postgres;Password=postgres;Pooling=False" /sync /log:"D:\sync.log"
Compare data of the specified databases and save the synchronization script to the D:\compare_result.sql file:
/datacompare.com /source server:db port:5440 user:postgres password:postgres database:db1 /target server:db2 port:5440 user:postgres password:postgres database:db2 /sync:"D:\compare_result.sql"
Compare and synchronize data using settings from the file, do not generate comments in the synchronization script ; generate a report to the specified file in the html format:
/datacompare.com /compfile:"DC1vsDC2.dcomp" /nocomments:yes /report:"report.txt" /reportformat:HTML /sync
Compare data and generate data report using settings from a file. Comparison and data writing settings of the different objects will be included into the report.
/datacompare.com /compfile:"DC1vsDC2.dcomp" /report:"report.html" /incdata:Yes /incsettings:Yes