通常,我们需要从数据库中卸载(DB2实用程序)所有数据并将其加载到另一个数据库(相同的结构)。
我通常每个表有一个卸载jcl(源数据库),每个表有一个加载jcl(目标数据库)。 对于50-100个表数据库,它有很多jcl和重复的代码。
是否有可能构建一个工具,可以使用DB2实用程序为我完成所有这些工作? 示例:指定源数据库和目标数据库,然后指定SUB ...
任何想法,将不胜感激。 谢谢!
Often, we need to unload (DB2 utility) all the data from a database and load it to another database (same structure).
I usually have one unload jcl per table (source db), and one load jcl per table (target db). For 50-100 table databases, it's a lot of jcls and repeated code.
Would it be possible to build a tool that would do all that for me using the DB2 utilities? Example: specifying source and target databases, then SUB...
Any ideas would be appreciated. Thanks!
最满意答案
是的,你可以建立这样一个工具。 一种方法是用您选择的语言编写一个程序来生成JCL。 另一种方法是使用编目或流内过程来执行卸载和加载实用程序,然后执行提供表作为参数的过程。
如果你想变得更加漂亮,你可以编写一个程序来读取DB2目录以获取表列表并编写卸载并为您加载JCL。
Yes you can build such a tool. One approach is to write a program in the language of your choosing that will generate the JCL. Another approach is to make a cataloged or in-stream procedure to execute your unload and load utilities, then execute the procedure supplying your tables as parameters.
If you want to get even fancier, you write a program that reads the DB2 catalog to get your list of tables and write the unload and load JCL for you.
更多推荐
发布评论