Schema Compare for Oracle - 3.0

Schema Compare for Oracle

Working with scripts folders - Schema Compare for Oracle

Note: You can use scripts folders only if you are using Schema Compare version 3.0 or later.

A scripts folder contains a set of object creation scripts representing a database's schema(s). 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:

  • Compare databases on unconnected Oracle databases
  • 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.

For more information about using scripts folders in source control, see Continuous integration for databases using Red Gate SQL tools (pdf).

Creating a scripts folder

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

To do this:

  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 snapshots or other scripts folders

You can create scripts folders from snapshots or other scripts folders 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.

Reverting to an earlier database version

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

To do this:

  1. Revert to an earlier version of your scripts folder using your source control system. For information on how to do this, see your source control system's documentation.
  2. 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 an example of source-controlling a database using Subversion, see Example: source-controlling a database using scripts folders.

Was this article helpful?

Search support
Forums