Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Oracle > Partitioning and maintenance

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-02-08, 13:07
chuck_forbes chuck_forbes is offline
Registered User
 
Join Date: Dec 2003
Posts: 847
Partitioning and maintenance

So, I've just been getting my feet wet in the documentation, and I already have a question:

We have a table with YEAR and QTR separated into their own columns. I'd like to use these as a basis for partitioning, but it looks like there'll be a maintenance overhead of going in, perhaps annually, and altering the table to include 4 new partitions for every year?

Am I on the right track? It'd be much easier if there was an automated way of declaring that a partition be created everytime a unique set of values were introduced into the system. That's what I'm hoping for, I guess.

v. 10.1.0.4
---=Chuck
Reply With Quote
  #2 (permalink)  
Old 07-02-08, 13:31
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 3,564
manual maintenance is required & if/when you forget it is a real pain to clean up the mess.

You need to read up on HIGH VALUES.
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
Reply With Quote
  #3 (permalink)  
Old 07-02-08, 13:36
chuck_forbes chuck_forbes is offline
Registered User
 
Join Date: Dec 2003
Posts: 847
Is is still a pain if you have ENABLE ROW MOVEMENT in place, alongside a MAXVALUE partition? I was hoping that in the case I forgot to create a partition, and rows were inserted into the MAXVALUE partition, that an ALTER TABLE which added a new partition would automatically move the appropriate MAXVALUE rows.
Reply With Quote
  #4 (permalink)  
Old 07-02-08, 14:01
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 3,564
Think about the following restrictions.
1) Partitions can only be added at the "top".
2) A new partition can not be added "between" two existing partition.
3) No value is greater than HIGH VALUES; which means a partition can not be created on "top" (after) the HIGH VALUES partition.

IIRC, Oracle won't allow a partition to be dropped if it contains data.

So when you forget here is what needs to occur.
1) Move all the data out of the HIGH VALUES partition.
2) Drop HIGH VALUES partition
3) create new partitions
4) create HIGH VALUES partition
5) move data into appropriate new partition

All of which can be disruptive for 24x7 application
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
Reply With Quote
  #5 (permalink)  
Old 07-02-08, 14:49
beilstwh beilstwh is offline
Registered User
 
Join Date: Jun 2004
Location: Liverpool, NY USA
Posts: 1,642
I don't know what version you are using, but Oracle 11G now has automatic partition generation. Maybe you should look at upgrading if you want this option.
__________________
Bill
Cream always raises to the top, and so does the scum!!
Reply With Quote
  #6 (permalink)  
Old 07-03-08, 05:49
AlanP AlanP is offline
Registered User
 
Join Date: Mar 2002
Location: Reading, UK
Posts: 1,098
Alternatively why not just create your future partitions now if you have the disk space. We tend to create our partitions going upto 5 years in advance.

Alternatively the partition maintenance isnt really that big a job unless you have loads of partitioned tables in which case you could create a procedure to add the new partitions and call it from an oracle job near the end of the year.

Alan
Reply With Quote
  #7 (permalink)  
Old 07-03-08, 11:36
chuck_forbes chuck_forbes is offline
Registered User
 
Join Date: Dec 2003
Posts: 847
That's a good point. We're not really poised to endure the testing necessary to go to 11g at this time.

It still sounds like a yearly job, in itself, wouldn't be sufficient if I have a category which includes the MAXVALUE keyword, though. At least things wouldn't be easy. I'd have to add some code which moved all data out of that top partition, dropped that partition, added some new partitions at the top (including a new MAXVALUE partition), and then moved the data back into the table.

Does that sound like I'm on the right track?
--=cf
Reply With Quote
  #8 (permalink)  
Old 07-03-08, 12:09
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 3,564
If you are proactive, then the HIGH VALUES partition will never contain any data.
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
Reply With Quote
  #9 (permalink)  
Old 07-03-08, 12:49
chuck_forbes chuck_forbes is offline
Registered User
 
Join Date: Dec 2003
Posts: 847
OK, I see what you're saying. So in that case, dropping the HIGH VALUES partition, adding new partitions at the top, then re-adding the HIGH VALUES partition, requires 0 data movement.
Reply With Quote
  #10 (permalink)  
Old 07-03-08, 12:56
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 3,564
Quote:
Originally Posted by chuck_forbes
OK, I see what you're saying. So in that case, dropping the HIGH VALUES partition, adding new partitions at the top, then re-adding the HIGH VALUES partition, requires 0 data movement.

That is 100% correct; assuming it is done PROACTIVELY

This operation can be automated to run as a batch job once a year;
or it can be done manually during normal working hours.
Nothing in the application will be referencing HIGH VALUES or the new partition(s).
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On