Additional /datacompare Arguments

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 command line arguments file.

Arguments

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 Oracle>datacompare.com  /datacompare /?

Below all switches of this option are described, together with usage examples.

Argument Action and usage
/compfile This switch is used to load command line settings from the comparison project file, *.dcomp. Command usage looks like:
/compfile:<path>
Example of using a file with comparison settings, saved earlier:
C:\Program Files\Devart\dbForge Data Compare for Oracle>dbforgeoracle.com /datacompare /compfile:"D:\workDir\ODC1vsODC2.dcomp"
/copybfiles Specifies parameters for the option ‘Physically copy BFILEs’.
Usage: /copybfiles dir:<directory_alias> path:<path>
/lobsviafiles Specifies parameters for the ‘Synchronize LOBs data via files’ option .
Usage: /lobsviafiles dir:<directory_alias> path:<path>
/log Use this switch if you want to generate comparison log file in a specified directory. Command usage looks like:
/log:<filepath>
The following example shows how to compare schemas using settings from the file and write log to the specified file:
C:\Program Files\Devart\dbForge Data Compare for Oracle>dbforgeoracle.com /datacompare /compfile:"ODC1vsODC2.scomp" /log:"D:\sync.log
/meobjmask Use the option to exclude objects from the comparison if they match the given expression. To exclude objects from the comparison, specify mask expression. To turn off the option, specify: No, N, Off, False, F.
Usage: /meobjmask:<expression/N>
/micolmask Includes objects to comparison if they match the given expression. To include objects to comparison, specify mask expression. To turn off the option, specify: No, N, Off, False, F.
Usage: /micolmask:<expression/N>
/miobjmask Includes objects to comparison if they match the given expression. To include objects to comparison, specify mask expression. To turn off the option, specify: No, N, Off, False, F.
Usage: /miobjmask:<expression/N>
/options You can specify some comparison and synchronization options directly in the command line interface. See the list of available options and learn how to use them in the Options Used in Command Line for /datacompare topic.
/report Generates data comparison report file. If the output file name has .html, .xls or .csv extension, it’s not necessary to specify the file format - it will be chosen depending on the extension.
Usage: /report:<filepath>
/reportformat Specifies the format of the file comparison report: HTML - a simple HTML file; XLS - a simple Microsoft Excel file; CSV - a simple CSV file.If the format was not specified, it is determined by the extension of the report file.
Usage: /reportformat:<HTML|XLS|CSV>
/schemas You can specify schemas to compare. If you don’t, schemas specified in /source and /target will be used. Command usage looks like:
/schemas:<source_1>,<target_1>[;<source_2>,<target_2>;...]
The following example shows how to compare schemas using connection through client.
C:\Program Files\Devart\dbForge Data Compare for Oracle>dbforgeoracle.com /datacompare /source server:OraServer user:system password:pswd /target server:OraServer2 user:system password:pswd /schemas:OSC1,OSC2
/source You can specify source database schema for comparison and synchronization in the command line. It is possible to use several options for defining the schema.
To connect to a server via Oracle client, type:
server:<server_alias> [home:<oracle_home_name>] user:<user_name> password:<pw> mode:[normal/sysdba/sysoper]
To connect to a server without using Oracle client (direct connection), type:
host:<machine_name> [port:<port_number>] SID:<oracle_service_ID> user:<user_name> password:<password> mode:[normal/sysdba/sysoper]
To specify full connection string with additional parameters, type:
connection:<connection_string>
/sync You can perform schema synchronization from the command line interface. If you specify output file for synchronization, only synchronization script will be generated. Command usage looks like:
/sync[:path]
The following example shows how to compare schemas using settings from the file saved before, and save synchronization script:
C:\Program Files\Devart\dbForge Data Compare for Oracle>dbforgeoracle.com /datacompare /compfile:"OSC1vsOSC2.scomp" /sync:"D:\compare_result.sql"
Note: If the /sync argument is used without parameters, synchronization with the database is performed at once and changes cannot be reversed.
/target You can specify target database schema for comparison and synchronization in the command line. It is possible to use several options for defining the schema.
To connect to a server via Oracle client, type:
server:<server_alias> [home:<oracle_home_name>] user:<user_name> password:<pw> mode:[normal/sysdba/sysoper]
To connect to a server without using Oracle client (direct connection), type:
host:<machine_name> [port:<port_number>] SID:<oracle_service_ID> user:<user_name> password:<password> mode:[normal/sysdba/sysoper]
To specify full connection string with additional parameters, type:
connection:<connection_string>
/copybfiles Use this switch to specify parameters for the Physically copy BFILEs option. Command line usage looks like:
/copybfiles dir:<directory_alias> path:<path>
/lobsviafiles Use this switch to specify parameters for the ‘Synchronize LOBs data via files’ option. Command line usage looks like:
/lobsviafiles dir:<directory_alias> path:<path>

Usage Examples

  • Compare data using settings from a file saved earlier:

      /datacompare /compfile:"D:\workDir\ODC1vsODC2.dcomp"
    
  • Compare and synchronize data using connection through the client. Log will be written to the specified file:

      /datacompare /source server:OraServer user:system password:manager /target server:OraServer2 user:system password:pswd /schemas:ODC1,ODC2 /sync /log:"D:\sync.log"
    
  • Compare data of the specified schemas and save the synchronization script to the D:\compare_result.sql file; the first connection is created using direct mode, the second connection is established through the client:

      /datacompare /source host:oraHost port:1521 SID:orcl user:sys password:manager mode:sysdba /target server:OraServer user:system password:pswd /schemas:DC1,DC2;ODC1,ODC2 /sync:"D:\compare_result.sql"
    
  • Compare and synchronize data using settings from the file, do not generate comments in the synchronization script, turn off triggers during synchronization; generate a report to the specified file in the .html format:

      /datacompare /compfile:"ODC1vsODC2.dcomp" /nocomments:yes /distrig:yes /report:"report.txt" /reportformat:HTML /sync
    
  • Compare and synchronize data using settings from a file. Synchronize Lob columns using files:

      /datacompare /compfile:"ODC1vsODC2.dcomp" /LobsViaFiles dir:DC2_DIR path:\\oracleHost\TEMP_FOLDER\DB_TARGET\ /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 /compfile:"ODC1vsODC2.dcomp" /report:"report.html" /incdata:Yes /incsettings:Yes