MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

load tables in simple tablespace

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
deepa12
Beginner


Joined: 05 Apr 2005
Posts: 131
Topics: 64
Location: chennai

PostPosted: Tue Aug 09, 2005 3:26 am    Post subject: load tables in simple tablespace Reply with quote

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
View user's profile Send private message Send e-mail
bonnie_mathew
Beginner


Joined: 05 Aug 2005
Posts: 8
Topics: 0

PostPosted: Tue Aug 09, 2005 4:39 am    Post subject: Reply with quote

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
View user's profile Send private message
deepa12
Beginner


Joined: 05 Apr 2005
Posts: 131
Topics: 64
Location: chennai

PostPosted: Tue Aug 09, 2005 8:18 am    Post subject: Reply with quote

Yes.. all the tables are to be loaded into the same tablespace
_________________
deepa
Back to top
View user's profile Send private message Send e-mail
bonnie_mathew
Beginner


Joined: 05 Aug 2005
Posts: 8
Topics: 0

PostPosted: Tue Aug 09, 2005 8:31 am    Post subject: Reply with quote

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
View user's profile Send private message
schintala
Beginner


Joined: 18 May 2005
Posts: 108
Topics: 31
Location: USA

PostPosted: Tue Aug 09, 2005 10:25 am    Post subject: Reply with quote

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
View user's profile Send private message
deepa12
Beginner


Joined: 05 Apr 2005
Posts: 131
Topics: 64
Location: chennai

PostPosted: Fri Aug 12, 2005 8:50 am    Post subject: Reply with quote

Hi
sorry for a delayed reply
I will check this out
rgs
deepa
_________________
deepa
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group