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 > how to execute reorg command in java code

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-02-07, 00:01
Wong Tseng Wong Tseng is offline
Registered User
 
Join Date: Mar 2007
Posts: 8
how to execute reorg command in java code

I need to Sometimes delete large bulk of data from tables with NLI, and after first DELETE operations, the performances of which on those tables which had been cleared became very low. With some research, I found the command reorg. I tried it,and the performances are improved a lot.
Now,I need to execute the reorg command in java using jdbc,but the reorg can't be recognized as a correct SQL statement. My DB2 version revealed by db2level is v8.1.7.445 with the fixpack versioned as 7,so I don't have the procedure ADMIN_CMD. I have tried to update the fixpack, but I am frustrated and confused by the DB2's long download list of update.
Can anybody give me some good advice about how to execute reorg command in java code in my case. Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 03-02-07, 01:09
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Fixpacks download page:
http://www-306.ibm.com/software/data...ownloadv8.html

Execute two following commands at db2 command prompt:
db2level (this command returns version and fixpack lavel)
db2licm -l (-l is for license; this command returns edition level)

Hope this helps,
Grofaty
Reply With Quote
  #3 (permalink)  
Old 03-02-07, 17:52
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
REORG is a DB2 command and not a SQL statement. Therefore, you can't issue it through CLI/JDBC.

Installing a newer FP is easy. Go to the DB2 UDB support page and then click your way through (Version 8 -> platform -> regular FP).
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #4 (permalink)  
Old 03-02-07, 21:16
Wong Tseng Wong Tseng is offline
Registered User
 
Join Date: Mar 2007
Posts: 8
Can I install the FP10 derectly on FP7 which is my current PF version? I notice that there are serveral download items about each version's FP, and in my case of retriving the ADMIN_CMD procedure, do I need to download them all or just partially? I really don't have any experience on installing a FP, so I need your help again. Thanks!
Reply With Quote
  #5 (permalink)  
Old 03-03-07, 01:56
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,
If you have a FP7 you can install FP10 at the top of FP7. Do you have any reason not to install FP14?

What is your operating system and version?
Hope this helps,
Grofaty
Reply With Quote
  #6 (permalink)  
Old 03-03-07, 21:46
Wong Tseng Wong Tseng is offline
Registered User
 
Join Date: Mar 2007
Posts: 8
the current developing enviroment involves Windows Xp operating systems. The final running enviroment will be on AIX machine with LINUX operationg system. But I don't know the details about that. My DB2 version is 8.1.7.445.
I want to stall FP10,because people say ADMIN_CMD is introduced in that version. And I see there are serveral download items with FP10, should I download and install them all?
Reply With Quote
  #7 (permalink)  
Old 03-04-07, 01:01
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,
Quote:
Originally Posted by Wong Tseng
I see there are serveral download items with FP10, should I download and install them all?
No. You only download fixpack for edition you have installed on your Windows computer.You need to execute command db2licm -l to check out what edition you have installed. Under the "Product Name" is edition displayed.

You most probably have installed one of:
- DB2 Personal Edition
- DB2 Workgroup Server Edition or DB2 Workgroup Server Unlimited Edition
- DB2 Enterprise Server Edition

So you need to download and install only one fixpack.

If the above command returns more than one "Product name" you need to download all fixpacks of the product name.

Hope this helps,
Grofaty
Reply With Quote
  #8 (permalink)  
Old 03-05-07, 02:33
Wong Tseng Wong Tseng is offline
Registered User
 
Join Date: Mar 2007
Posts: 8
Thank you a lot.

Last edited by Wong Tseng; 03-05-07 at 02:39.
Reply With Quote
  #9 (permalink)  
Old 03-05-07, 07:28
vini_srcna vini_srcna is offline
Registered User
 
Join Date: May 2006
Posts: 82
REORG is a DB2 utility.It could be either offline or online REORG.
All utilies in DB2 understands only control statments and NOT SQL statements.
Stolze has already pointed out this. I'm not sure whether you can initiate the utility from Java application.

Before coming to the conclusion, REORG will increase the performance there would be many points to think.

What kind of tablespace is that ..? (SIMPLE,SEGMENTED,PARTITIONED )
Is there any clustering index built on that table..?
Sometimes just running the RUNSTATS would also makes difference.
RUNSTATS requires less resources compared to REORG.
I'm not sure about your scenario.
Reply With Quote
  #10 (permalink)  
Old 03-08-07, 08:28
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Quote:
Originally Posted by Wong Tseng
Can I install the FP10 derectly on FP7 which is my current PF version? I notice that there are serveral download items about each version's FP, and in my case of retriving the ADMIN_CMD procedure, do I need to download them all or just partially?
As I said: download the "regular FixPak", then read the README file that comes with the FP and follow the steps described there.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
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