ALTER architecture
ALTER provides management of data structures and data for a Db2 subsystem.
The product consists of several components that allow you to create, modify, and drop Db2 data structures while preserving data and dependent objects.
ALTER architecture depiction illustrates the architecture of the ALTER product. The components and the objects of ALTER are discussed in the sections that follow.
ALTER components
Most of the components that ALTER uses to perform its tasks can run in the foreground or as batch jobs.
ALTER consists of the following components:
- Front End
- Specification
- Import (DDL only)
- Analysis
- JCL Generation
- Execution
ALTER Front End
The Front End component is a dialog panel that you use to access and control ALTER.
From the Front End component, you can create, analyze, and execute work IDs, and build JCL in foreground or batch mode.
ALTER Specification
The Specification component enables you to create or edit data structure change or migration requests.
The component stores the change or migration requests in a work ID. With Specification, you can perform the following tasks:
- Create data structures
- Change data structures
- Delete data structures
- Migrate data structures
- Estimate the space required for a table space or index
The Specification component lists objects from the Db2 catalog (or from a copy of that catalog if your site uses catalog indirection). You can change these objects, delete them, or create new objects either from the list of objects or from the Command line of some Specification panels. Changes are not made to the data structures until you execute the change and migration requests.
ALTER Import
You can import data structure definitions that are stored in a DDL file.
The Import component converts these data structures into change requests in a work ID. The Import component provides a batch function similar to that provided by the Specification component with limited validation checking.
ALTER Analysis
After you create change or migration requests in a work ID, the Analysis component checks the requests for validity with the Db2 catalog, develops an optimal implementation strategy, and generates a worklist.
The worklist contains the Db2 utility commands, AMS commands, security commands, and SQL statements that are necessary for implementing the requests. In addition, the Analysis component propagates changes to dependent structures. The Analysis component can be run in the foreground or in batch using the JCL Generation component.
The Analysis component performs the following validity and compliance checks:
- Verifies that the data structures of changing objects have not changed in the Db2 catalog since the present changes were requested
- Checks the change requests against other requested changes and warns of any conflicts
- Checks the change requests for compliance with Db2 rules and reports conflicts
- Develops the most efficient strategy to implement the requested changes or migrations
- Locates all dependent structures
- Binds or rebinds plans and packages
- Migrates plan and package authorizations
- Checks for objects that are indirectly affected by requested changes
If no errors are found, the Analysis component generates a worklist, stores the worklist or associated data set name with the work ID, and uses it as the default worklist when you run the Execution component. The Analysis component also creates diagnostic output in ALUPRINT and provides authorization switching.
ALTER JCL Generation
The JCL Generation component works with the Front End component to construct a job control language (JCL) file for running the Analysis and Import components in batch.
Using symbolic variables, the Front End component resolves all data set names that appear on the interface panels of the components. These names include the names of input files, JCL files, and the diagnostic output files.
Execution functions
The Execution component performs the commands that are contained in the worklist that the product generates for change or migrate requests.
Although the tasks that are required to implement a worklist vary depending on the complexity of the actions involved, the Execution component performs the following basic functions:
- Performs worklist control-command processing for DASD MANAGER PLUS
- Unloads Db2 data
- Runs IBM or BMC utilities
- Executes Db2 commands and Access Method Services (AMS) statements
- Establishes synchronization (sync) points to accommodate restart, if needed
- Creates diagnostic output in AEXPRINT
- Performs audit and recovery logging, if requested
- Performs authorization switching to ensure that Db2 objects are created with the correct owner and creator
The Execution component is the only component that makes physical changes to Db2 data structures.
ALTER objects
ALTER uses the following objects to perform its tasks.
This section describes each of the following objects in detail:
- Work IDs
- Worklists
- Unload data sets
- DDL files
- Internal tables
Work IDs
Work IDs enable you to identify, control, and track a unit of work.
Work IDs contain change or migration requests that are stored in the CD tables. Creating or selecting a work ID is usually the first step in performing any type of change or migrate process.
ALTER uses the following types of work IDs:
Alter-type
You use an alter-type work ID to change or modify data structures, drop objects, or create new data structures.
Migrate-type
You use migrate-type work IDs to specify the data structure definitions that are to be migrated from one Db2 subsystem to another, or to duplicate structures within the same subsystem. Migrate-type work IDs do not modify existing data structures.
Migrate-type work IDs can contain change rules to modify database object attributes and migrate options to specify the default dependencies to include in a migration. The change rules compare the object type and attribute to those in the migrated data structures and apply the rule when a match is found.
The migrate process provides a way to create new data structures from data structures that already exist on a subsystem. You can create the new data structures on the same subsystem if the objects are renamed. You can rename the objects through the Specification component or with change rules in the work ID.
Receive-type
You use receive-type work IDs to receive a worklist that is generated by a migrate-type work ID that contains the migrated data structures and data from a different subsystem.
You can request any number of changes or migrations with a single work ID. You can enter these requests all in one session or across many sessions. You can also delete or modify requests if you make a mistake or change your mind. Any number of users can request changes or migrations with the same work ID.
For more information, view the Quick Course CHANGE MANAGER for DB2 - Creating Work IDs. |
ALTER worklists
The worklist data set contains all of the commands and SQL statements that are needed to execute the changes or migrations specified in a work ID.
The Analysis component generates the worklist commands in a specific order. You can edit the worklist, but changing the order of the commands might yield incorrect results.
The worklist can contain any of the following items:
- SQL statements that perform the change or migration requests, including the dropping and re-creating of all affected objects and the restoring of dependent objects that are lost as a result of a change or that propagate the changes into other objects
- Db2 and utility commands that implement requested changes and migrations, including:
- Unloading data
- Reorganizing table spaces and indexes
- Reloading data
- Collecting statistics
- Making image copies
- Rebuilding indexes
- Checking the data
- Rebinding application plans and packages (if an alter-type work ID)
- Binding plan and package authorizations (if a migrate-type work ID)
- Performing other authorizations
- AMS commands for data set allocation and deletion that support VCAT-defined partitions
Unload data sets
ALTER uses unload data sets to store data while dropping and rebuilding Db2 objects.
ALTER DDL files
ALTER does not generate DDL files. ALTER can use DDL files to import data structures.
ALTER internal tables
ALTER uses the following types of internal tables to perform its tasks:
- CD tables, which store change and migration specifications for each work ID
- CM tables, which store work ID, change rule, and sync data