免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 11421 | 回复: 4
打印 上一主题 下一主题

[请教]如何设置Userexit [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-09-08 13:28 |只看该作者 |倒序浏览
修改了userexit on以后,还有设置一个c程序,可是我没有配置成功,那个userexit.c在DB2安装以后就有

如果我想把归档脱机日志的出口点设置到磁带,该如何做呢?

请指教。

论坛徽章:
0
2 [报告]
发表于 2003-09-08 13:33 |只看该作者

[请教]如何设置Userexit

修改 db2uext2.cdisk(samples目录中有)
#define ARCHIVE_PATH
#define RETRIVE_PATH

编译后生成可执行文件,放到 sqllib\bin目录下即可。

不知道是否可以直接放到磁带上,还请高手支点。

论坛徽章:
0
3 [报告]
发表于 2003-09-08 14:29 |只看该作者

[请教]如何设置Userexit

应该可以吧,
看sg246247资料,
其中提到编译 db2uexit2.c (db2uexit2.ctsm),
然后打开 userexit on ,
就可以了,但是我也没有成功~~~

不知道你的db2uexit2.c文件是怎么写的呢?
能不能贴出来让我看看~~~

论坛徽章:
0
4 [报告]
发表于 2003-09-08 14:54 |只看该作者

[请教]如何设置Userexit

这个应该是比较关键的吧,
但是我还是没有配置的经验,
哪位有经验给我们讲一讲~~~

谢谢!!!

/*****************************************************************************/
/*                                                                           */
/* Sample Name: db2uext2.ctsm                                                */
/*                                                                           */
/*                                                                           */
/* Purpose:    This is a sample User Exit utilizing Tivoli Storage Manager   */
/*             ( TSM ) to Archive and Retrieve database log files.           */
/*                                                                           */
/* Options:    1. This sample provides an audit trail of calls ( stored in a */
/*                separate file for each option ) including a timestamp and  */
/*                parameters received.  This option can be disabled.         */
/*                                                                           */
/*             2. This sample provides an error trail of calls in error      */
/*                including a timestamp and an error isolation string for    */
/*                problem determination.  This option can be disabled.       */
/*                                                                           */
/*                                                                           */
/* Usage:      1. Copy "db2uext2.ctsm" to "db2uext2.c" and place this file   */
/*                into a working directory.                                  */
/*                                                                           */
/*             2. Modify the "Installation Defined Variables" to suit your   */
/*                environment.  Two example scenarios have been provided     */
/*                below for illustrative purposes.                           */
/*                                                                           */
/*             3. Modify the program logic to suit your environment.  If     */
/*                there are situations where the user exit program fails on  */
/*                archive request and you want DB2 to retry the request, set */
/*                the return code to RC_OPATTN.                              */
/*                                                                           */
/*             4. Compile and link "db2uext2.c" with the following command:  */
/*                "cc_r -o db2uext2 db2uext2.c                               */
/*                       /usr/tivoli/tsm/client/api/bin/libApiDS.a           */
/*                       -I/usr/tivoli/tsm/client/api/bin/sample"            */
/*                or a functional equivalent.                                */
/*                Place the resultant "db2uext2" named executable into       */
/*                sqllib/adm or sqllib/bin.                                  */
/*                                                                           */
/*                *** NOTE ***  Code/command modification may be required    */
/*                              depending on compiler options used and       */
/*                              header file location                         */
/*                                                                           */
/*                *** NOTE ***  On Solaris compile as follows:               */
/*                              cc -o db2uext2 db2uext2.c -xarch=v9          */
/*                                /opt/tivoli/tsm/client/api/bin/libApiDS.so */
/*                                -I/opt/tivoli/tsm/client/api/bin/sample    */
/*                                                                           */
/*                              where -xarch=<a>; specifies architecture      */
/*                              instruction set                              */
/*                                                                           */
/*                *** NOTE ***  On HP compile as follows:                    */
/*                              cc -D_INCLUDE_POSIX_SOURCE -Aa db2uext2.c    */
/*                                -o db2uext2                                */
/*                                -I/opt/tivoli/tsm/client/api/bin/sample +e */
/*                                /opt/tivoli/tsm/client/api/bin/libApiDS.sl */
/*                                                                           */
/*                *** NOTE ***  On Linux compile as follows:                 */
/*                              cc -D_INCLUDE_POSIX_SOURCE db2uext2.c        */
/*                                -o db2uext2                                */
/*                                -I/opt/tivoli/tsm/client/api/bin/sample    */
/*                                /opt/tivoli/tsm/client/api/bin/libApiDS.so */
/*                                -lApiDS -lpthread -lcrypt -ldl             */
/*                                                                           */
/*             5. DB2 calls "db2uext2" in the following format -             */
/*                                                                           */
/*                  db2uext2 -OS<os>; -RL<release>; -RQ<request>; -DB<dbname>;   */
/*                           -NN<nodenumber>; -LP<logpath>; -LN<logname>;       */
/*                           [-LSlogsize -SPstartingpage]                    */
/*                           [-AP<tsmpasswd>;]                                */
/*                                                                           */
/*                  where:  os         = operating system                    */
/*                          release    = DB2 release                         */
/*                          request    = 'ARCHIVE' or 'RETRIEVE'             */
/*                          dbname     = database name                       */
/*                          nodenumber = node number                         */
/*                          logpath    = log file path                       */
/*                          logname    = log file name                       */
/*                          logsize    = log file size (optional)            */
/*                          startingpage = starting offset in 4K page unit   */
/*                                         (optional)                        */
/*                          tsmpasswd  = TSM password (optional)             */
/*                                                                           */
/*                  Note: logsize and startingpage are only used when        */
/*                        logpath is a raw device.                           */
/*                                                                           */
/*             6. The following naming convention has been used in this user */
/*                exit:                                                      */
/*                                                                           */
/*                  For the TSM register filespace call:                     */
/*                  . filespace name = "/xxxxxxxx" where "xxxxxxx" is the    */
/*                                     database name                         */
/*                  . filespace type = "DB2"                                 */
/*                                                                           */
/*                  For the TSM object:                                      */
/*                  . object name filespace  = "/xxxxxxxx" where "xxxxxxxx"  */
/*                                             is the database name          */
/*                  . object high level name = "/NODEyyyy" where "yyyy"      */
/*                                             is the node number            */
/*                  . object low  level name = "/Szzzzzzz.LOG" where         */
/*                                             "zzzzzzz" is the log file     */
/*                                             number                        */
/*                                                                           */
/*                For example: If the database name was "SAMPLE", the node   */
/*                             number was NODE0000 and the log file name was */
/*                             "S0000001.LOG", the following                 */
/*                             would result:                                 */
/*                                                                           */
/*                             For the TSM register filespace call:          */
/*                             . filespace name = "/SAMPLE"                  */
/*                             . filespace type = "DB2"                      */
/*                                                                           */
/*                             For the TSM object:                           */
/*                             . object name filespace  = "/SAMPLE"          */
/*                             . object high level name = "/NODE0000"        */
/*                             . object low  level name = "/S0000001.LOG"    */
/*                                                                           */
/*                                                                           */
/* Logic Flow: 1. install signal handlers                                    */
/*             2. verify the number of parameters passed                     */
/*             3. verify the action requested                                */
/*             4. start the audit trail ( if requested )                     */
/*             5. if the requested action is to archive a file:              */
/*                . if the log file is not found, proceed to point 10        */
/*             6. get the TSM library version                                */
/*             7. setup environment variables and initialize the             */
/*                TSM session                                                */
/*             8. if the requested action is to archive a file:              */
/*                . register the filespace                                   */
/*                . bind the application                                     */
/*                . begin the transaction                                    */
/*                . begin the sending of the object ( log file )             */
/*                . send the object in BUFFER_SIZE portions to TSM           */
/*                . end the sending of the object                            */
/*                . end the transaction                                      */
/*                if the requested action is to retrieve a file:             */
/*                . begin the query to search for the object ( log file )    */
/*                . search for the object                                    */
/*                . end the search for the object                            */
/*                . if the object is not found, proceed to point 10          */
/*                . begin the transfer of data                               */
/*                . receive the object in BUFFER_SIZE portions from TSM      */
/*                  into a temporary file                                    */
/*                . end the transfer of data                                 */
/*                . if successful, rename the temporary file to the log file */
/*             9. terminate the TSM session                                  */
/*            10. log errors ( if requested and required )                   */
/*            11. end the audit trail ( if requested )                       */
/*            12. exit with the appropriate return code                      */
/*                                                                           */
/*****************************************************************************/

论坛徽章:
0
5 [报告]
发表于 2014-02-20 17:57 |只看该作者
http://blog.csdn.net/caviler/article/details/19562387
DB2日志文件归档脚本 db2uext2 的 bash shell 实现 用户出口 USEREXIT
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP