Schema Compare for Oracle

Working with script folders

A scripts folder contains a set of object creation scripts representing a database's schemas. A script file, containing a creation script, is created for each object in the schema. Objects are organized by schema, then object type; for example, widget_test\tables.

You can use scripts folders to:

  • Export database schemas to SQL script files
  • Source-control databases (for example, to source-control the script files so you can track new or modified objects)

You can use scripts folders as the source or target for comparison and deployment, as you would databases and snapshots.

Creating a scripts folder

You can create a scripts folder by using the deployment wizard.

  1. On the toolbar, click New Project.
    A new Project Configuration dialog box is displayed:
  2. On the left-hand side, under Source, select the database and schema you want to create the scripts folder from.

    For more information, see Setting data sources.
  3. On the right-hand side, under Target, select Scripts folder.
  4. In the right-hand pane, specify an empty folder you want to use as a scripts folder.
  5. Click
    The comparison wizard runs, and displays the comparison results:
  6. Select the schema objects you want to include in the scripts folder.
  7. On the toolbar, click Deployment Wizard.
    The deployment wizard is displayed:
  8. On the left-hand side, make sure "Write scripts to folder" is selected, and click Next.
  9. Review the objects you have selected to deploy, and click Update Scripts.The deployment wizard runs and populates the target folder with creation scripts.

Creating scripts folders from a snapshot or another scripts folder

You can create scripts folders from a snapshot or another scripts folder by selecting a snapshot or scripts folder as the source, as shown in this example:

Deploying from a scripts folder to a database

You can deploy from scripts folders to live databases by selecting the scripts folder as the source and the database as the target, as shown in this example:

Source-controlling databases with scripts folders

You can use scripts folders to source-control your database schemas.

To do this:

  1. Create a scripts folder from the database you want to source-control.
  2. Commit the scripts folder to your source-control system.
    For information on how to do this, see your source control system's documentation.

To commit a new version of your database schema to source control, repeat both steps.

Updating to an earlier database version

You can update to an earlier version of your database by deploying from an earlier version of your scripts folder using source control.

To do this:

  1. Using your source control system, update to an earlier version of your scripts folder. For more information, see your source control system's documentation.
    Deploy from the scripts folder to the database by selecting the scripts folder as the source and the database as the target:

    After running the deployment wizard, the database is updated from the source-controlled scripts folder.

    For more information about source-controlling Oracle schemas using scripts folders, see Worked example - source-controlling a database using scripts folders.

    Redgate also provides a dedicated source control tool for Oracle databases, Source Control for Oracle, available for purchase as a standalone tool or with the Deployment Suite for Oracle.


Didn't find what you were looking for?