As a database administrator you often need to create a
development database that is a subset of the production database.
By working in the development database, you avoid endangering the
production database with untested code.
Database administrators often create the development database by
backing up the production database and restoring it to the development
server. However, you do not typically need an entire production image
or all of its data.
In this scenario, you have been asked to migrate the GOSALESCT
schema from the GSDB database to the GSDBDEV database. The schema
contains many tables. You will use the Compare and Migrate
Objects wizard to make these changes.
Before you begin
This scenario is based on sample data that is provided in the GSDB
database. To do the steps in this scenario, you must complete these
two tasks:
Complete the following steps to migrate the GOSALESCT schema to
the GSDBDEV database.
- Ensure that connections exist in the Administration
Explorer for the GSDB database and the GSDBDEV database.
- If a connection does not exist, on the Administration
Explorer toolbar, click the drop-down button for New and
click New Connection to a Database. In the
wizard that opens, complete the details and then click Finish.
- If a connection needs to be connected, right-click the database
in the Administration Explorer and click Connect.
In the wizard that opens, complete the details and then click Finish.
- Display the GSDBDEV database in the Object List and
make the Object List active.
- In the Administration Explorer, navigate
to and click the GSDBDEV database.
- Click anywhere in the Object List to make
it active.
- From the main menu, click to
start the Compare and Migrate Objects wizard.
- Complete the steps in the wizard.
- On the Migration Source page, click Database connection.
Then, in the list of database connections, click GSDB.
- On the Choose Source Objects page:
- In the Select Object Type section, click the Schemas folder.
- In the Database Object Selection section, select the check box
for GOSALESCT and click Add.
- Click Finish.
- On the Specify any Masks and Ignores page, click Next.
- On the Review and Apply Changes page in the Structural Comparison
table:
- In the column for GSDB (source database model), find the GOSELECT
schema.
- Click the GOSELECT schema and click the (Copy from Left to Right) icon to
copy the schema to GSDBDEV (target database model).
- Click Finish.
Tip: Alternatively, you can find the differences between
the source and target database models to copy the schema by using
the
(Next
Difference) and (Previous Difference)
icons.
A change plan is created automatically and includes the changes
that are necessary to create the GOSALESCT schema in the GSDBDEV database.
The change plan also includes changes to create the schema's
dependent objects, such as the tables and views in the schema.
- Review and deploy the change plan.
- On the change plan toolbar, click the
(Review and deploy changes)
icon to review the DDL for the changes and to deploy the changes to
database.
- In the Review and Deploy wizard, click Run and
then click Finish.
Tip: You can also
use the wizard to specify a location for preserving data, maintenance
commands, and undo scripts.
Your GSDBDEV database catalog is now updated and includes the GOSALESCT
schema. The status of running the commands is displayed in the SQL
Results view.