Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2012
    Posts
    29

    Unanswered: load with SOURCEUSEREXIT on a remote server

    Hi all,
    I'm using DB2 10.5 EE.
    I have db2client on a machine and a remote DB2 Server (both Linux).
    I need to run from the client a load with SOURCEUSEREXIT option so that the load utility can execute a customized script server side.
    So I need the user exit to be put in a specific path server side, but cannot leverage ssh or any other login service but just the db2 client.

    Is it possible to achieve this?

    Thanks a lot for any reply

  2. #2
    Join Date
    May 2012
    Location
    Canberra, Australia
    Posts
    176
    Provided Answers: 6
    Invoking your user exit

    The user exit must reside in the bin subdirectory of the DB2ฎ installation directory (often known as sqllib).
    Given that the directory is linked to the install bin directory and will be owned by bin/bin I can't see you doing that from the client. You would have to ship the file to someone with appropriate access to the directory on the server
    Andy

    "All parts should go together without forcing. You must remember that the parts you are reassembling were disassembled by you. Therefore, if you can’t get them together again, there must be a reason. By all means, do not use hammer.” — IBM maintenance manual, 1975 "

  3. #3
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Hi,

    You don't need ssh for that.
    SOURCEUSEREXIT REDIRECT INPUT FROM FILE my_client_side_file
    allows you to pass the contents of your client side file directly into the STDIN of your user exit.
    Regards,
    Mark.

  4. #4
    Join Date
    Jan 2012
    Posts
    29
    Quote Originally Posted by mark.b View Post
    Hi,

    You don't need ssh for that.
    SOURCEUSEREXIT REDIRECT INPUT FROM FILE my_client_side_file
    allows you to pass the contents of your client side file directly into the STDIN of your user exit.
    Mark,
    thanks for your reply.
    I see that REDIRECT INPUT FROM FILE option allows to pass client data as input to the user exit, but I guess the user exit must still reside server side, so I still have the issue to move it remotely.

  5. #5
    Join Date
    Jan 2012
    Posts
    29
    Quote Originally Posted by tafster View Post
    You would have to ship the file to someone with appropriate access to the directory on the server
    Thanks Andy.
    Unfortunately I don't have the possibility to ship this file remotely.
    I though to the userexit because I need to move large amount of data from tableA to tableB on the same remote database, but before writing to tableB I need to perform some operations on those data.
    So in short what I need to do on a remote db is:
    1. select data from tableA
    2. perform operations on data
    3. insert modified data on table B

    If it's not possible to achieve this with the load with userexit because I cannot move files remotely, is there another efficient way to achieve this using db2 tools?

  6. #6
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Yes, you have to place your user exit into the ~${DB2INSTANCE}/sqllib/bin directory.

    BTW, try to look at the ingest utility instead.
    Regards,
    Mark.

  7. #7
    Join Date
    Jan 2012
    Posts
    29
    Quote Originally Posted by mark.b View Post
    BTW, try to look at the ingest utility instead.
    Unfortunately ingest doesn't support LOBs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •