Comparing and Synchronizing Schemas through Command Line

You can automate schema comparison and synchronization using the command line.

  1. Open the Command Prompt.

    Note

    To run the Command Line in Windows 10:

    From the Desktop Mode

    • Move the mouse cursor to the exact lower left corner until the desktop shortcuts menu appears.
    • Right-click to see the shortcut menu and than click Run.

    From the Charms Bar

    • Move your mouse to the upper right corner until the Charms Bar appears.
    • Select Apps from the list and type run in the search box.
    • Click Run from the search results.

    Use Windows + R Shortcut Keys

    • In desktop mode, press the Windows + R keys, to show the Run command line.
    • In the window that opens, type cmd and press Enter.
  2. Type a path to the dbforgeoracle.com file, located in dbForge Studio for Oracle installation folder on your PC, and press the SPACE bar.
  3. Type all the arguments (actions you want to run) in the Command Prompt. You can do this in three ways:

1) Type all the arguments directly in the Command Prompt, for example:

C:\Program Files\Devart\dbForge Studio for Oracle\dbforgeoracle.com" /schemacompare /source connection:"User Id=yourusername;Password=yourpassword;Server=dbOracle;Direct=True;Service Name=orcl1120" 
/target connection:"User Id=yourusername;Password=yourpassword;Server=dbOracle;Direct=True;Service Name=orcl1120" /schemas:SCHEMA3,SCHEMA;SCHEMA1,SCHEMA2
pause

Note

The path to the executable file will differ depending on how you have installed the Studio - as a standalone tool or as part of the dbForge Edge bundle. Make sure that you have specified a correct path. If you have installed the Studio as part of dbForge Edge, change the path accordingly:

C:\Program Files\Devart\dbForge Edge\dbForge Studio for Oracle>dbforgeoracle.com

2) Specify a path to a previously saved comparison document to use the connection settings along with the comparison settings specified in the document.

/schemacompare /compfile:"D:\file_name.scomp"

3) Type the path to a previously generated file with required command line arguments (see below how to prepare the file), for example:

/argfile:"D:\file_name.txt"

Type additional parameters that are not specified in the file into the Command Prompt, for example:

C:\Program Files\Devart\dbForge Studio for Oracle>dbforgeoracle.com /argfile:file_name.txt /schemacompare /sync

Tip: To see a quick help on the arguments available in the command line, type the following:

dbforgeoracle.com /?
  1. Press ENTER to run the process.

Preparing a file with command line arguments

  1. Define what action you want to run, for example:
/schemacompare
  1. Define Source and Target connection strings:
/schemacompare /source connection:"User Id=yourusername;Password=yourpassword;Server=dbOracle;Direct=True;Service Name=orcl1120" 
/target connection:"User Id=yourusername;Password=yourpassword;Server=dbOracle;Direct=True;Service Name=orcl1120"

You can also use the schema comparison document that already contains Source and Target connection strings.

/schemacompare /compfile:"C:\MyComparison.scomp"
  1. To generate and save a log file, specify the file name and location. For example:
/log:"C:\Log.log"
  1. To generate and save a comparison report file, specify the file name and location. For example:
/report:"C:\Report.html"
  1. To synchronize the schemas, i.e., update the Target schema, type the following:
/sync
  1. To generate and save a synchronization script, specify the file location and name. For example:
/sync:"C:\sync_script_name.sql"

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Studio for Oracle.
All Features

All features

Get acquainted with the rich features and capabilities of the Studio in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Studio for your business, request a demo to see it in action.
Ready to start using dbForge Studio for Oracle?