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 > Consequences of mass insert in DB2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-18-09, 12:44
db2itg db2itg is offline
Registered User
 
Join Date: May 2008
Posts: 15
Post Consequences of mass insert in DB2

Hi, I would like to know what could be the impact of mass insert in DB2. We have inserted around 9 lakhs plus rows in each table and no of tables was 8 (around 72 lakhs rows) thru REXX programs over the weekend (this is the only activity happened over the weekend) and since Monday 1/12 our system has been behaving very strange. Our online services are down and Mainframe utilization is full. IBM suggessted Recycling of DB2, it works but only for few hours.
Currently we are recycling DB2 every day to get the sytem going.

Does mass insert impact on the DB2 access paths? Any info would be appreciated....

Appreciate your help...
Reply With Quote
  #2 (permalink)  
Old 01-18-09, 16:41
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
did you do reorg, runstats and rebind after the inserts? Documentation suggest it if from 10 to 20% of the data have been changed...
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
Reply With Quote
  #3 (permalink)  
Old 01-18-09, 16:48
db2itg db2itg is offline
Registered User
 
Join Date: May 2008
Posts: 15
we did not do reorg, runstats and rebind after the inserts...do you think this is causing the issue....
Reply With Quote
  #4 (permalink)  
Old 01-18-09, 16:49
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
Quote:
Originally Posted by db2itg
we did not do reorg, runstats and rebind after the inserts...do you think this is causing the issue....
try it. manual says you should. I do it for our applications every time we have an issue and surprisingly in 80% of cases the problem goes away

Pls let me know if it worked
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS

Last edited by MarkhamDBA; 01-18-09 at 16:52.
Reply With Quote
  #5 (permalink)  
Old 01-18-09, 17:02
db2itg db2itg is offline
Registered User
 
Join Date: May 2008
Posts: 15
thnx Mark...as I am a developer i dont have necessary authority to do that but i will ask my DBA to try this and see what happens. I am wondering if this is causing the issue then why the DBA did not do it early as every technical person in my organization is involved in this issue, we have contacted IBM also and they asked us to do recycling of DB2 everyday until they find out the issue (they didnt ask us to reorg,rebind,runstats)...
Reply With Quote
  #6 (permalink)  
Old 01-18-09, 17:08
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
it is usually miscommunication between dbas and programmers. I am as a DBA do not really know when developers do updates, inserts, etc. so when they run into a problem, my 1st step is always run maintenance on a db to make sure it's in tact.
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
Reply With Quote
  #7 (permalink)  
Old 01-18-09, 17:14
db2itg db2itg is offline
Registered User
 
Join Date: May 2008
Posts: 15
Dont you think recycling of DB2 will make the db in tact so after the first recycling we should have been okay but today is the sixth day in a row when we recycle the DB2 to get the system going....please correct me if i am wrong..
Reply With Quote
  #8 (permalink)  
Old 01-18-09, 17:27
db2itg db2itg is offline
Registered User
 
Join Date: May 2008
Posts: 15
Additional info..thought you should know to get better idea about the issue:

The 8 tables where we have inserted data were having the old data already..we emptied all the 8 tables first and then inserted our new data...
Reply With Quote
  #9 (permalink)  
Old 01-18-09, 18:11
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
even if recycling works, what are you going to do next time you do mass updates? recycle again? You need to run maintenance on all those tables.

From DB2 manual :
It is recommended to run the RUNSTATS command:
On tables that have been modified considerably (for example, if a large number of updates have been made, or if a significant amount of data has been inserted or deleted or if LOAD has been done without the statistics option during LOAD)
On tables that have been reorganized (using REORG, REDISTRIBUTE DATABASE PARTITION GROUP)
When a new index has been created.
Before binding applications whose performance is critical.
When the prefetch quantity is changed

Btw, I suggest to use LOAD instead of INSERT if you need to add many records to the table. And RUNSTATS should be the next after LOAD step in the batch which does it.
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
Reply With Quote
  #10 (permalink)  
Old 01-18-09, 18:15
db2itg db2itg is offline
Registered User
 
Join Date: May 2008
Posts: 15
I will ask my DBA to run the RUNSTATS and REORG to see what happens...will get back to you on results....

Appreciate your help Mark....
Reply With Quote
  #11 (permalink)  
Old 01-18-09, 19:11
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
As MarkhamDBA has suggested RUNSTATS needs to be done.
Ask your dba to do it .. in the meantime you can check the CARD and STATSTIME columns in the sysibm.systables. The CARD column gives you then number of rows in the table at runstats time.

Make sure runstats is followed by rebind. you can check the bindtime (not sure about the col name) in sysibm.sysplan and sysibm.syspackage tables.

IBM Information Management Software for z/OS Solutions Information Center


By the way, what sort of application do you have? web appls using say db2 connect or cics or .....?
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #12 (permalink)  
Old 01-18-09, 20:12
db2itg db2itg is offline
Registered User
 
Join Date: May 2008
Posts: 15
Sathya,We have web applications which is impacted and also our batch jobs are taking so much time because of 100% utilization of Mainframe...We also did IPL last night I hope this will clear up the things....i will ask my DBA to run the runstats and rebind....

Appreciate your help Sathya...
Reply With Quote
  #13 (permalink)  
Old 01-18-09, 22:48
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
Since you explicity asked for my input (via a PM), I'll climb into the fray to see what I can do to help. For most mainframe systems, 72 lakh rows is barely enough to climb from trivial to insignificant in terms of load. I agree that the idea of doing a reorg/runstats/rebind combination is probably a good idea, but you'll have to find a "window of opportunity" when you can do this, since the tables will be offline for any practical purposes while this happens... It should only take a few minutes, but depending on your environment finding those few minutes could be challenging!

To get to the bottom of your problem, you need to understand a lot about both the nature of the problem (the database design) and the environment that your design runs within... I'll asume since you are a developer that you intimately understand the problem domain (database design), so I'll focus on the environmental issues.

What performance tools are you running on you mainframe, and what do they show you when you are having performance problems? What version of DB2 are you running? What OS is DB2 running on? How many indicies are on each of the 8 tables? How are the rows added to the tables (you get a very different response from DB2 when you use a REXX script to add one row 900,000 times than you get if you use a REXX script to insert 900,000 rows one time).

Take a look at these factors, and try to determine how they figure into your environment. Every environment is different, so there isn't a "cookie cutter" solution to resolving problems like these.

-PatP
Reply With Quote
  #14 (permalink)  
Old 01-20-09, 08:54
db2itg db2itg is offline
Registered User
 
Join Date: May 2008
Posts: 15
I checked the sysibm.systables and found the STATSTIME 2008-11-16 for all the 8 tables and the column CARD value is same what we deleted from the tables prior to inserting new data on 1/9.

I aksed my DBA to run the RUNSTATS and REBIND on the DB2 tables but he believe this is not causing the issue and not ready to run the RUNSTATS and REBIND.

DBA told me that they have pulled data from 1/5 and Monday 1/12, Thurs 1/15 and seeing issues opp check to racf we are overrunning the system with work,cirext from 1/5 and 1/12 - 10Xworkload for this process id,huge flood of work that is impossible to service-overrunning the threads. taking a look at 5 most commonly used process id's ,ibm - setting trace on gateway servers and letting it wrap.

Not sure what is happening....do you have clue...

appreciate your help...
Reply With Quote
  #15 (permalink)  
Old 03-15-10, 02:53
rashmi.lucknow rashmi.lucknow is offline
Registered User
 
Join Date: Mar 2010
Posts: 2
what is massinsert and how do we use it in db2

hi i would like to know that how can we use massinsert in db2 and cics
Hi, I would like to know what could be the impact of mass insert in DB2. We have inserted around 9 lakhs plus rows in each table and no of tables was 8 (around 72 lakhs rows) thru REXX programs over the weekend (this is the only activity happened over the weekend) and since Monday 1/12 our system has been behaving very strange. Our online services are down and Mainframe utilization is full. IBM suggessted Recycling of DB2, it works but only for few hours.
Currently we are recycling DB2 every day to get the sytem going.

Does mass insert impact on the DB2 access paths? Any info would be appreciated....

Appreciate your help...[/QUOTE]
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