I want to create a table like this.
create table some_data (
id number(19,0),
group_id number(19,0),
value float,
timestamp timestamp
);
For this table i would like to have the data stored like
group_id=1
jan-2015
feb-2015
...
group_id=2
jan-2015
feb-2015
...
and so on. So I assume i have to create a partition by range for the group_id and then a subpartition also by range with the timestamp column, right?
So it should look like this:
create table some_data (
id number(19,0),
group_id number(19,0),
value float,
timestamp timestamp
)
PARTITION BY RANGE (group_id)
SUBPARTITION BY RANGE ("TIMESTAMP")
INTERVAL (NUMTOYMINTERVAL(1,'MONTH'))
(
PARTITION part_1 values LESS THAN (TO_DATE('01.02.2015','DD.MM.YYYY'))
);
Is this right? And also the question: With this partition, if a new group_id is added, will oracle create automatically a new partition for the new group_id and the new suppartitions for new data with new months?