Export and Import Optim Objects

Many sites maintain similar databases on several different DB2® subsystems. For example, a site may have a database on one DB2 subsystem to support production and maintain databases on separate subsystems for testing. Another site may support multiple clients, each with its own database in a separate subsystem.

The Optim™ objects are stored in the Optim Directory. Each DB2 subsystem has a unique Optim Directory and objects in a Directory are available in only the subsystem that houses the Directory. The Export and Import Processes allow you to transport the Optim Directory objects (e.g., Access Definitions, Table Maps, etc.) to Directories in other DB2 subsystems. There is no need to re-create these objects on each subsystem. Thus, Export and Import save time and promote consistent, reliable data handling.

Although you can migrate table definitions, Legacy Tables, and related objects (e.g., primary keys and relationships—DB2, IMS™, or OPT) by using an Extract or Archive Process in combination with a Create Process, you cannot use these processes to migrate the objects unique to Optim that are not table-related. However, the Export and Import Processes must be used to migrate Access Definitions, Table Maps, Column Maps, Compare Definitions, Archive Collections, Legacy Tables, IMS Environment Definitions, and IMS Retrieval Definitions.

The Directory objects are migrated in two steps:

  1. Export Process

    Copy objects from the Optim Directory in the current DB2 subsystem to a data set, so the objects can be imported to an Optim Directory in any DB2 subsystem. Once copied to a data set, exported objects may be imported any number of times to any number of Optim Directories. To execute the Export Process, select Option E on the Choose a Definition Option menu.

  2. Import Process

    Copy the objects in the specified data set to the current DB2 subsystem. To execute the Import Process, select Option I on the Choose a Definition Option menu.

Typically, you use the Export Process to copy the object definitions from the current subsystem to a data set. You can then return to the Choose a Definition Option menu, switch to the receiving subsystem by changing the SUBSYS specification and, if appropriate, the LOCATION specification. Once you have switched to the new subsystem, you can use the Import Process to load the object definitions from the data set. For details about the Choose a Definition Option menu, refer to Choose a Definition Option .

About Object Security

Security status is migrated, but applies only to objects in the database, not to objects in the data set. For example, only the owner can export an Access Definition with PRIVATE status. However, the same PRIVATE status does not prevent any user from importing the Access Definition from the Export File unless an Access Definition with the same name is in the importing Directory. After the Access Definition is imported, it is assigned PRIVATE security status and, depending on an import processing option, the owner is either the importing user (default), the original owner from the Export File, or an explicit owner. (For details about assigning the owner of imported objects, see page Object Owner Processing.)