View previous topic :: View next topic |
Author |
Message |
deepa12 Beginner
Joined: 05 Apr 2005 Posts: 131 Topics: 64 Location: chennai
|
Posted: Tue Aug 09, 2005 3:26 am Post subject: load tables in simple tablespace |
|
|
Hello Sir
I have the following command
LOAD DATA
REPLACE
RESUME NO
LOG YES
ENFORCE CONSTRAINTS
INTO TABLE XY46.TXGR0FIX
to load db2 tables in simple tablespace
This is run in batch mode. There are many such tables. for each table i have 1 load step in the same jcl
after the entire jcl runs only the last table remains loaded.
It looks like it is erasing the tablespace everytime that it loads
So pls help me
I would like to know what should be the command to load all the tables 1 after another in the jcl. And have the data in all the tables _________________ deepa |
|
Back to top |
|
|
bonnie_mathew Beginner
Joined: 05 Aug 2005 Posts: 8 Topics: 0
|
Posted: Tue Aug 09, 2005 4:39 am Post subject: |
|
|
Hi,
Please check if the tables mentioned are sharing a table space. You can use the following query :
select tsname from sysibm.systables where name in (<give table names here>); |
|
Back to top |
|
|
deepa12 Beginner
Joined: 05 Apr 2005 Posts: 131 Topics: 64 Location: chennai
|
Posted: Tue Aug 09, 2005 8:18 am Post subject: |
|
|
Yes.. all the tables are to be loaded into the same tablespace _________________ deepa |
|
Back to top |
|
|
bonnie_mathew Beginner
Joined: 05 Aug 2005 Posts: 8 Topics: 0
|
Posted: Tue Aug 09, 2005 8:31 am Post subject: |
|
|
Deepa,
When you use a LOAD REPLACE, the table space and all its indexes need to be reset to empty before records are loaded. With this option, the newly loaded rows replace all existing rows of all tables in the table space, not just those of the table you are loading.
So what happens is each time the load replace command is executed, your table space is cleared. That is why only last table retains data.
Ideally each table space should have one table only to avoid situations like this. Is it possible to recreate the tables in separate table spaces?
Or else I am not sure about the approach. You could use LOAD REPLACE on the first table in the JCL and for the other tables you can use LOAD DATA RESUME YES and omit the REPLACE verb. This should get your job done, but am not sure if this is the correct approach.
Any suggestions are welcome. |
|
Back to top |
|
|
schintala Beginner
Joined: 18 May 2005 Posts: 108 Topics: 31 Location: USA
|
Posted: Tue Aug 09, 2005 10:25 am Post subject: |
|
|
Looks like you have segmented table space with multiple tables into it. Your load card would be some thing like this to load the tables into one table space.
LOAD DATA INDDN SYSREC00 RESUME YES INTO TABLE |
|
Back to top |
|
|
deepa12 Beginner
Joined: 05 Apr 2005 Posts: 131 Topics: 64 Location: chennai
|
Posted: Fri Aug 12, 2005 8:50 am Post subject: |
|
|
Hi
sorry for a delayed reply
I will check this out
rgs
deepa _________________ deepa |
|
Back to top |
|
|
|
|