“Near production” test environments can be efficiently maintained in two different ways, through full DB2 subsystem cloning or by copying the table and indexspaces. Subsystem cloning is admittedly a quick and inexpensive technique, but it does not allow refresh of single databases or a set of tablespaces. Subsequent executions of the cloning process overwrites the current clone (the current test environment), thus making it like Dolly the sheep, an exact clone where everything is like the source system: tables, views, procedures, grants, etc. All changes that were made on the previous clone are lost. Not really suitable as a working environment for test groups, but quite sufficient as a system which is primarily used as a basis for data provisioning or as an easily accessible data master which is further used to repeatedly populate several test and development environments. The main reason clones are made is to quickly decouple test and production worlds and lessen impact on production resources.
A file-wise copy process (copy/refresh/merge) is more flexible, single databases or table sets can be renewed or migrated. A copy tool must satisfy several requirements in order to enable the user to set up a robust procedure. The processing of the associated DDL has to be done prior to the copying of the data (table-, indexspaces, databases). Objects which do not yet exist in the target system have to be created, those already present have to be tested for compatibility with the source object definitions. Compatible objects should be refreshed by the fastest copy method. Objects that are not compatible should automatically moved by unload and load. Indexes that only exist at the target side must be rebuild. The tablespaces and indexspaces and also imagecopies should be eligible as input to the process. Simultaneous to the copy, the Runstats of the source system should be transferred to the target system, so that objects can be used immediately after the copy.
Cloning and copy/refresh methods both have their advantages. Together, they can quickly provide a powerful solution to lessen impact on production resources and provide a source of near production, quality testing.