SQL Packager 7

Upgrading the database structure and data

When you use SQL Packager to upgrade the data in a database, you can select data only for those tables whose structure is identical.

If both the schema and the data has been updated for a particular table, and the schema changes include new columns that do not allow null values, you will have to run two packages; the first package to update the schema, and the second to update the data.

For example, the previous version of the database is called DatabaseOld, and the latest is called DatabaseNew. To upgrade DatabaseOld:

  1. Create a package to upgrade only the schema of DatabaseOld:
    1. On the Choose databases to package into an upgrade page of the Packager Wizard, select DatabaseOld as the database to upgrade, and DatabaseNew as the latest version.
    2. On the Specify the database objects whose schema will be packaged page, select all the objects to package their schema.
    3. On the Specify the tables whose data will be packaged page, clear the selection for all of the tables so that no data is packaged.
    4. Generate the package (for example Package1).
  2. Run Package1 on DatabaseOld.DatabaseOld now contains the upgraded schema, but still has the old data.
  3. Create a package to upgrade the data in DatabaseOld with the data in DatabaseNew:
    1. On the Choose databases to package into an upgrade page of the Packager Wizard, select DatabaseOld as the database to upgrade, and DatabaseNew as the latest version.
    2. On the Specify the database objects whose schema will be packaged page, no objects will be available for schema packaging because they are now identical.
    3. On the Specify the tables whose data will be packaged page, select all of the tables so that all data is packaged.
    4. Generate the package (Package2).
  4. Run Package2 on DatabaseOld to complete the upgrade.

If you need to upgrade a number of databases, you should deploy both packages and run Package 1 followed by Package 2.


Didn't find what you were looking for?