If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > db2 load

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-07-07, 11:42
vijay_b vijay_b is offline
Registered User
 
Join Date: Sep 2007
Posts: 7
Thumbs up 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.
Reply With Quote
  #2 (permalink)  
Old 09-08-07, 06:22
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
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/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On