| Comparing BCV5 with DSN1COPY |
|
|
The mechanism that BCV5 uses to move data is based on copying the VSAM clusters that DB2 uses to store tablespace and indexspace data. There is DB2 utility that works in a similar way: DSN1COPY. The speed of DSN1COPY and the built-in copy utility of BCV5 are comparable if you copy a single cluster. When you want to copy an entire database or even multiple databases with all associated tablespaces and indexspaces, the copy utility of BCV5 has the advantage of integrated parallel processing with a user-definable number of threads. To emulate this parallelism with DSN1COPY, you need to create an elaborate job chain and execute it under the control of a job scheduler. When the number of data sets becomes larger, you must also take other limitations like the maximum number of steps in a job into consideration when using DSN1COPY. The main problem with DSN1COPY, however, is the extremely low extend of automation that is built into this utility. Before the utility can be used, you must do a manual comparison of the source and target object structure in order to ensure that all attributes of all involved objects match. Some of these attributes need to be passed to the program in the form of invocation parameters to achieve usable results. The values that you need to look up are scattered over many catalog tables and need to be retrieved using multiple queries. In addition, you sometimes have to define some of the clusters in the target environment by yourself because DSN1COPY requires that all target clusters already be present. The following list of options illustrates the plethora of attributes that you need to look up for every single dataset that you want to copy using DSN1COPY:
As if all these options weren’t already enough, there are several additional steps that you need to take before and after you use DSN1COPY. You have to make sure that all attributes of all involved tablespaces, tables and indexes are identical in the source and target environment. Even small changes may render your copied tablespaces unusable. For example, if one of your target tables has a column that may contain NULL values, but that column in the corresponding source table may not contain NULL, you cannot use DSN1COPY to make a copy, even if everything else is identical. You have to drop and recreate the target table before you can use DSN1COPY. BCV5 can detect this situation. You have the option of using Unload/Load as a fallback mechanism for copying the data. This is completely transparent, because BCV5 will generate all the required JCL and input statements for you. The other option is to drop and recreate target objects that don’t match the structure of the source objects. Normally, when you drop and recreate an object, you must keep in mind that other objects may be lost as well due to the deletion of the first object. For example, dropping a table will always drop all related indexes, but you will also lose GRANTs and constraints that may have existed on the table, and that includes referential constraints to other tables. What seems like a quick drop and recreate can get out of hands very easily. BCV5 knows what has been dropped, and can recreate the target object as well as all dependent objects automatically for you. If you have changed your source tables at any point in time using ALTER statements, or if you have dropped tables that were located in a multi-table tablespace, you also need to determine if you need to regorganize the tablespace before copying it. If you fail to do so, the target DB2 may give you error messages when you access the copied tablespace. BCV5 will detect if an alteration has taken place that prohibits the direct copy on VSAM cluster level. In some cases, BCV5 is able to make a direct copy where DSN1COPY cannot be used. You must also take care of allocation issues. The actual size of an object may differ from the information that is stored in the DB2 catalog. You need to do a LISTCAT on each of the clusters to find out the actual size. Then you must make sure that the target objects have allocation attributes that allow them to grow to the required size. BCV5 handles all the space calculation automatically and can redefine target clusters (without having to drop and recreate DB2 objects) if the corresponding tablespace or indexspace was created with too small allocation parameters. Finally, for all tables that contain an identity column, you need to look up the highest value that is currently used in the source subsystem. You must explicitly set a higher number as the number that is used next for the target table using an ALTER statement. Otherwise, when you insert a new row into a target table, DB2 might try to use an identity value that is already in use, resulting in an error. BCV5 generates and executes these ALTER statements automatically. In conclusion, while DSN1COPY can be automated to a certain degree using home-grown scripts and queries, its usage can be a pain if a large number of objects is involved, or if the set of objects to be copied changes. BCV5, on the other hand, offers unmatched flexibility in the selection, renaming and copying of DB2 objects and provides a streamlined, fully automated process that takes the pain out of fast copying. |
For more information about this solution click here.
For a free live demonstration click here.