Schema Compare for Oracle - 2.0

Schema Compare for Oracle

Examples: Using the command line - Schema Compare for Oracle

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

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

For more information on the switches you can use with the Schema Compare for Oracle command line see: Switches used in the command line.

Example 1: Deploying schema changes

To deploy schema changes from a project saved as WidgetDatabases using the command line:

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

The following are used for the comparison and deployment:

  • objects 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 Schema Compare for Oracle user interface.

  • project option settings saved in the project

Example 2: Creating a deployment script to run later

To create a deployment script from a project saved as WidgetDatabases:

sco /project:"C:\Schema Compare for Oracle\Projects\WidgetDatabases.ocp" /scriptfile:"C:\Deployment Scripts\WidgetSyncScript.sql"

Note that if there is already a file of the same name in the location you specify, an error will ocur.

Example 3: Creating a HTML report of comparison results

To create a simple HTML report of the differences between schemas in the WidgetDatabases project using the command line:

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

Example 4: 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 schemas selected in the WidgetDatabases project, and outputs the results as the file log_file.txt:

  1. Create the script:

    sco /project:"C:\Schema Compare for Oracle\Projects\WidgetDatabases.ocp" >> 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