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 > Adding space to tablespace without rebalancing

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-03-06, 12:46
anksagr anksagr is offline
Registered User
 
Join Date: Jul 2005
Posts: 102
Adding space to tablespace without rebalancing

Hi All,

I want to add more space to one of our tablespaces without having DB2 rebalance all the containers.

I know I can use the BEGIN NEW STRIPE option of ALTER TABLESPACE, but doesn't that add another container? How can I add more space without rebalancing and witout adding another container?

ENV: AIX, DB2 UDB v8.2

Thanks

Anks
Reply With Quote
  #2 (permalink)  
Old 08-03-06, 14:54
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Assuming all your current containers are of the same size, extend all the containers by the same amount. This will not cause rebalancing.

Before, BEGIN NEW STRIPE was introdcued, the above method was the only one available to avoid rebalancing

HTH

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 08-03-06, 15:12
anksagr anksagr is offline
Registered User
 
Join Date: Jul 2005
Posts: 102
There are actually three conatiners and they are not the same size.

Tablespace Containers for Tablespace 3

Container ID = 0
Name = /prod2/sms2/data/LADATA16K01.dbf
Type = File
Total pages = 173000
Useable pages = 172992
Accessible = Yes

Container ID = 1
Name = /prod2/sms2/data/LADATA16K02.dbf
Type = File
Total pages = 173000
Useable pages = 172992
Accessible = Yes

Container ID = 2
Name = /prod2/sms2/data/LADATA16K03.dbf
Type = File
Total pages = 110500
Useable pages = 110496
Accessible = Yes

Can I still extend all without rebalancing?

Thanks
Anks
Reply With Quote
  #4 (permalink)  
Old 08-04-06, 17:52
sharrisdb2 sharrisdb2 is offline
Registered User
 
Join Date: Jul 2005
Location: Irvine, CA
Posts: 23
Anks,

Your container output shows me that your tablespace is almost completely empty, so why are you worried about rebalancing? Rebalancing an empty db should take no time at all

Maybe your output is out of date, so it does not reflect the current state of the tablespace? Even if that is so, I would still make all containers the same size and take the hit for rebalancing. Do it off hours if you think it will be too intrusive - although I have never experienced a hugely significant slow down during a rebalance that cannot be lived with.

Another point: why are you creating different sized containers for the same tablespace in the first place? I guess that is why you wish to increase the last one - maybe to match the other 2?

As a general rule, containers should be of the same size at the start. Matter of fact a few versions of DB2 and AIX ago you had to make all containers exactly the same (for a single DMS tablespace). If you didn't, all containers would only fill to the size of the smallest container. This has since been fixed, but I still recommend making them all the same.

When you increase sizes in the future, make sure you increase all of them together and at the same amount. It just makes it easier to manage.


Steve
IBM Certified LUW DB2 DBA
Reply With Quote
  #5 (permalink)  
Old 08-09-06, 10:44
anksagr anksagr is offline
Registered User
 
Join Date: Jul 2005
Posts: 102
Hi Steve,

I am worried about rebalancing because 2 weeks back this tablespace was hitting almost 90%, so I had to add more pages and right after I added these pages DB2 started rebalancing right away (stupid feature of DB2 that you can't let the rebalancing happen at some other time) and the system could not handle it and so the instance crashed. We had lot of trouble because the instance would just not start up. So finally we had to restore the database and rollforward just before the rabalancing happened because according to the IBM support, rebalancing caused data corruption.

My output is actually upto date and you are right I want to increase the third container to make them all same size. I understand its not a good idea to have different sizes of conatiners under one tablespace, but this has not been designed by me, all i can do is find ways to improve things and that is when i seek help from gurus at this forum as I have started working on DB2 few months back and I am still exploring lot of stuff about Db2.

whenever i want to add more space to a tablespace I always increase all the containers at one go. this is the command that I use:

alter tablespace LADATA16k extend (all 1000)

But i am sure this command does not get rid of the rebalancing.

Anks
Reply With Quote
  #6 (permalink)  
Old 08-09-06, 16:45
anksagr anksagr is offline
Registered User
 
Join Date: Jul 2005
Posts: 102
Steve,

One more thing I would like to add. You said that the containers are almost completely empty after looking at the output that I sent.

How did you get to know this?
Please correct me if I am wrong the "list tablespace containers for 3 show detail" command only shows the total pages and Useable pages, the output does not talk about the used pages at all.

Anks
Reply With Quote
  #7 (permalink)  
Old 08-09-06, 19:29
sharrisdb2 sharrisdb2 is offline
Registered User
 
Join Date: Jul 2005
Location: Irvine, CA
Posts: 23
Sorry Anks, my mistake. I mistook the "useable" pages as free. My bad.

You can also run -

db2 list tablespaces show detail

and it will show the used and free pages for all tablspaces, but not for each individual container.


Here is something you may be able to do though: try a redirected restore. This method is usually used to restore a database into another instance (typically on another machine), but can be used to add or subtract containers.

Search through the recent threads from the last month or so. I did a quick write up on how to do a redirect if you have a full offline backup

How to Clone Database

There was another thread on how to do it with an online backup.

The main difference between a redirect and a normal restore is with a redirect, you change the files/paths for the containers and logs, and can even rename the db. It is very powerful and useful.

However, be warned that this will take some time to do. It will take longer than a regular restore, but not too much. Maybe 20% longer? I have never timed it, so I cannot give a definitive answer.


Hope this helps.

Steve
Reply With Quote
  #8 (permalink)  
Old 08-10-06, 10:00
jthakrar jthakrar is offline
Registered User
 
Join Date: Mar 2004
Posts: 46
Anks,

You indicated in the thread above that IBM said that "rebalancing caused data corruption" - you may want to get more details - e.g. APAR #, etc.

-- Jayesh
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