Comparing Database Schemas

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  Tutorials > "ZooDB" Database >

Comparing Database Schemas

The schema comparison feature in DatabaseSpy allows you to compare and merge the structure of different schemas of a database or schemas in different database types. In our zoo tutorial, you will compare the live database with a test environment that runs on the same database server.

 

Objective

In this section of the tutorial, you will learn how to compare the structure of two schemas of a database and merge differences between the schemas. Specifically, you will learn how to do the following:

 

Add a schema to the zoo database and add tables using an SQL script
Set up a database schema comparison and select items for comparison
Review and correct the mapping
Compare the structure of two schemas of the zoo database
Show and examine the differences
Merge the differences between the two schemas

 

Commands used in this section

Icon

Command name

Description


Open File...

This command is located in the File | Open menu and opens the Windows Open dialog box. Alternatively, you can also use the keyboard shortcut Ctrl+O.

ic_execute-sql

Execute

This command is located in the toolbar of an SQL Editor window and in the SQL Editor menu. Click this command to execute the SQL in the SQL Editor window.

ic_refresh-datasource

Refresh

This command is available in the Online Browser as a button, or as an option in the context menu that opens when you right-click a database. Use this command to refresh the database and display new or changed database objects in the Online Browser.

ic_schema-compare

Schema Comparison

This command is located in the Standard toolbar; alternatively, you can also choose the menu option File | New | Schema Comparison. Click this command to open a new Schema Comparison window and select database items for comparison. Note that at least one active connection to a data source is required to open a new schema comparison.

ic_start-db-comparison

Start Comparison

This command is located in the toolbar of the Schema Comparison window; alternatively, you can also choose the menu option Schema Comparison | Compare items or choose Compare items from the context menu that opens when you right-click the title bar of a component. Click this command to run a comparison of all mapped items in the comparison components.

ic_toggle-message

Toggle Message Window

This command is located in the Schema Comparison window toolbar. Use this command to switch the display of the Message window on and off.


Collapse items

This command is available in the Schema Comparison menu, or as an option in the context menu that opens when you right-click the title bar of a comparison component. Use this command to collapse all items in both components.


Show merge script: Left to Right

This command is available in the Schema Comparison menu, or as an option in the context menu that opens when you right-click the title bar of, or a database item in, a comparison component. Use this command to show the merge script that copies the changes in the left component into the right component. If called from the title bar of a component or when no item is selected, this command will generate the merge script for all items in the component.


Show merge script: Right to Left

This command is available in the Schema Comparison menu, or as an option in the context menu that opens when you right-click the title bar of, or a database item in, a comparison component. Use this command to show the merge script that copies the changes in the right component into the left component. If called from the title bar of a component or when no item is selected, this command will generate the merge script for all items in the component.


© 2019 Altova GmbH