Using Command Line To Create Database Snapshots

You can automate creation of target database snapshots using the command line.

Note

The command line functionality is available only in certain editions of dbForge Schema Compare for Oracle. For the detailed information on features availability in the dbForge Schema Compare editions, please refer to the Editions topic.

To create a snapshot of target database through the command line, do the following:

  1. Open Command Prompt by pressing Win+R, and typing cmd in the Open line.

    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 then 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 Schema Compare for Oracle installation folder on your PC, and press the SPACE bar.

     "C:\Program Files\Devart\Compare Bundle for Oracle\dbForge Schema Compare for Oracle\schemacompare.com"
    
  3. Specify the action you want to perform:

     "C:\Program Files\Devart\Compare Bundle for Oracle\dbForge Schema Compare for Oracle\schemacompare.com" /snapshot
    
  4. Specify the connection string and schemas:

     "C:\Program Files\Devart\Compare Bundle for Oracle\dbForge Schema Compare for Oracle>schemacompare.com /snapshot /connection:"User Id=yourusername;Server=ORCL;Unicode=True" /s:"SH,SH"
    
  5. Press ENTER to run the process.

Tip: To see a quick help on the switches available for the /snapshot operation, type the following:

"C:\Program Files\Devart\Compare Bundle for Oracle\dbForge Schema Compare for Oracle\schemacompare.com" /snapshot /?

Additional arguments:

You can edit the generated file to add some additional parameters, for example:

  • To write a comment, type:

      /comment:<value>
    
  • To apply compression to your snapshot file, type:

      /compress:[value]
    

To turn this option on, type Yes, Y, On, True, T.

To turn this option off, type No, N, Off, False, F.

  • To specify full connection string with additional parameters, type:

      connection:<connection_string>
    

    This argument is required.

  • To specify a file name and its path to save the created snapshot file, type:

      /file:<file_path>
    

    If the path is not specified, the snapshot will be saved to the current directory.

  • To specify server password, type:

      /password:<pw> 
    

Define this argument to override the password specified in the connection string.

Command line used to make a snapshot of a schema may look like:

"C:\Program Files\Devart\Compare Bundle for Oracle\dbForge Schema Compare for Oracle\schemacompare.com" /snapshot /connection:"User Id=yourusername;Server=ORCL;Unicode=True;" /password:yourpassword /schema:"HR" /file:"D:\result.snap"

If you connect to the server in the Direct mode, the connection parameters will differ and the command line used to make a snapshot of a schema will look like:

"C:\Program Files\Devart\Compare Bundle for Oracle\dbForge Schema Compare for Oracle\schemacompare.com" /snapshot /connection:"User Id=yourusername;Server=dbOracle;Connect Mode=SysDba;Unicode=True;Direct=True;Service Name=ORCL" /password:yourpassword /schema:"HR" /file:"D:\result.snap"