Data Compare for Oracle - 2.1

Data Compare for Oracle

Examples: Using the command line - Data Compare for Oracle

This topic provides some simple examples of how you can use the Data Compare for Oracle command line interface.

The command line interface for Data Compare for Oracle is a separate program called DCO.exe. It is installed in the same location as the graphical tool, typically:

C:\Program Files\Red Gate\Data Compare for Oracle 1

Note that you cannot use the command line to set data sources to compare, you must first create and save a project using the Data Compare for Oracle user interface.

Example 1: Getting a comparison summary

To get a comparison summary from a project saved as Example.dco using the command line:

dco /project:"C:\Data Compare for Oracle\Projects\Example.ocp"

The project option settings saved in the project are used for the comparison.

Example 2: Deploying data changes

To deploy data changes from a project saved as Example.dco using the command line:

dco /project:"C:\Data Compare for Oracle\Projects\Example.dco" /deploy

The following are used for the comparison and deployment:

  • tables that were selected for comparison when you saved the project

    If you want to include or exclude objects from an existing project, you must modify your selection using the Data Compare for Oracle user interface.

  • project option settings saved in the project

Example 3: Creating a deployment script to run later

To create a deployment script from a project saved as Example.dco using the command line:

sco /project:"C:\Data Compare for Oracle\Projects\Exampe.dco" /scriptfile:"C:\Deployment Scripts\Script.sql"

Note that if there is already a file of the same name in the location you specify, it will be overwritten.

Example 4: Creating a report of comparison results

To create a CSV report of the differences between the tables in the Example.dco project using the command line:

sco /project:"C:\Schema Compare for Oracle\Projects\WidgetDatabases.ocp" /report:"C:\Reports"

Example 5: Scheduling a comparison

You can use the Microsoft Windows® Scheduled Task wizard to schedule a comparison by creating a script to run the comparison.

The following example compares tables selected in the Example.dco project, and outputs the results as the filelog_file.txt:

  1. Create the script:

    dco /project:"C:\Data Compare for Oracle\Projects\Example.dco" >> C:\log_file.txt

  2. Save the script as a .bat file.

    You specify the .bat file as the program to run from within the Scheduled Task wizard by browsing to it.

MS-DOS batch scripting is used in this example, a basic scripting language that is supported on all versions of Windows. If preferred, you could use VBScript, JScript, PHP, Perl, Python or any other scripting language of your choice.

Was this article helpful?

Search support
Forums