Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Table partitioning by month

user13117585Feb 17 2011 — edited Feb 17 2011
Hello everyone,

Let's suppose I have a table like this:
CREATE TABLE MY_TABLE (
...
MY_DATE DATE NOT NULL, 
...
I'd like to know if it is possible to create 12 different partitions based on MY_DATE field. Each partition would be a different month. Every month I use a given partition.

Something like this:
CREATE TABLE MY_TABLE(
...
MY_DATE DATE NOT NULL, 
...
) 
PARTITION BY RANGE (MY_DATE) 
  (my_table_januari VALUES -- BETWEEN january first and january 31 table_space_xx, 
   my_table_february VALUES -- BETWEEN february first and february 28 table_space_xx,  
   ....
);
The thing is that to achieve this, I need to TRUNC the values, but I can't. So anyone has ever faced such problem?

Thanks for your help,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 17 2011
Added on Feb 17 2011
16 comments
13,937 views