Results 1 to 2 of 2

Thread: db2 load

  1. #1
    Join Date
    Sep 2007
    Posts
    7

    Thumbs up Unanswered: db2 load

    hi

    using load utility i am generating a dump file for every load operation to a particular path.

    every time i execute the command specifying the same path for the dump file now its replacing the previous entries.

    What i need is altough i give the same location for the dumpfile path should be autogenerated indicating that for this execution of load command a unique dumpfile should be generated.

    BRIEFLY :
    although i excute this query many times
    db2 load from staff.del of del modified by dumpfile = /home/db2inst1/ "replace into task"

    the dumpfiles should be many not one.

    thanks for the guy who will solve it.

  2. #2
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    Quote Originally Posted by vijay_b
    db2 load from staff.del of del modified by dumpfile = /home/db2inst1/ "replace into task"

    the dumpfiles should be many not one.
    From the filename, I'm assuming you are on a unix system.
    (On MS-Windows, just install bash from cygwin.)

    Place your "db2 load" invocation in a shell script as follows:
    Code:
    #! /bin/sh
    db2 load from staff.del of del modified by dumpfile = /home/db2inst1/dump$$.log
    The variable "$$" is the process id of the executing script, which should be different on every invocation.

    An alternative, safer way which also gives a nicer file name sequence, is:

    Code:
    #! /bin/sh
    i=1
    while test -f /home/db2inst1/dump$i.log
      do i=`expr $i + 1`
    done
    db2 load from staff.del of del modified by dumpfile = /home/db2inst1/dump$i.log
    Note that this will start reusing the file dump1.log if you manually delete it.
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

Posting Permissions

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