Dynamic Table Partitioning [message #598037] |
Thu, 10 October 2013 01:33 |
|
saipradyumn
Messages: 419 Registered: October 2011 Location: Hyderabad
|
Senior Member |
|
|
Hi All ,
As we know that Interval partitioning is new feature which is available from 11g on words.
Then how we need to handle that situation in previous versions ?
Example scenario : My table gets the transactions on day basis.Each&every days it will contains lacs of records.
I just want to partition table per each day .
When ever a record was inserted with new date then I need to create the partition for that date (just like Interval partition in 11G) .
How to achieve this partitioning dynamically in 10g
or
is there any other efficient solution for this scenario ?
Thanks
Sai Pradyumn
[Updated on: Thu, 10 October 2013 01:51] by Moderator Report message to a moderator
|
|
|
Re: Dynamic Table Partitioning [message #598039 is a reply to message #598037] |
Thu, 10 October 2013 01:40 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
saipradyumn wrote on Thu, 10 October 2013 12:03
My table gets the transactions on day basis.Each&every days it will contains lacs of records.
I just want to partition table per each day .
lacs of records? That's just 100,000 records. Tiny in fact. Why do you want to keep just 100,000 records in each partition?
|
|
|
|
|
|
|
Re: Dynamic Table Partitioning [message #598058 is a reply to message #598055] |
Thu, 10 October 2013 03:30 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
Your syntax is incorrect.
SQL> CREATE TABLE t1 (
2 id INT,
3 dt date)
4 partition by range (dt)
5 (
6 partition SYS_10 values less than (to_date('2013-10-10','yyyy-mm-dd')),
7 partition SYS_11 values less than (to_date('2013-10-11','yyyy-mm-dd')),
8 partition SYS_12 values less than (to_date('2013-10-12','yyyy-mm-dd') )
9 );
Table created
SQL> ALTER TABLE t1 ADD PARTITION VALUES LESS THAN (to_date('2013-10-13','yyyy-mm-dd'));
Table altered
[EDIT : Realized after submitting that John already pointed to a link to docs by the time I was composing]
[Updated on: Thu, 10 October 2013 03:31] Report message to a moderator
|
|
|
|
Re: Dynamic Table Partitioning [message #598061 is a reply to message #598060] |
Thu, 10 October 2013 04:00 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
saipradyumn wrote on Thu, 10 October 2013 14:23
but When this has to be happened ?
Not sure what you are asking. Do you mean when to create new partitions? You can create them anytime, well before you insert the data.
Quote:
I can't go for the Comparison with new date value with existing dates values as it contains very very huge data
Sorry, I did not understand your question. Why cannot you compare? Are you talking about performance issue or something else. Please elaborate.
Regards,
Lalit
|
|
|
|
|
|
|
Re: Dynamic Table Partitioning [message #598084 is a reply to message #598082] |
Thu, 10 October 2013 07:04 |
John Watson
Messages: 8931 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
I told you what to do five hours ago: use the Scheduler.
Your problem is nothing unusual, you know. I did this a while back for a Cell phone company: automated creating a range partition per hour with 16 hash subpartitions.
--
update: and, by the way, "lac" is not an SI unit.
[Updated on: Thu, 10 October 2013 07:05] Report message to a moderator
|
|
|
|