Search notes:

Oracle composite partitioning: subpartition templates

When creating composite partitoned tables, a subpartition template simplifies the partition-specification for its subpartitions.
Composite partitioned tables with a interval-partition require a subpartition template.

Example (Interval-List)

Create the table

create table tq84_interval_list (
   num  number,
   txt  varchar2(3),
   val  number
)
partition    by range (num) interval (100)
subpartition by list  (txt)
subpartition template (
   subpartition sp_foo values ('foo'),
   subpartition sp_bar values ('bar'),
   subpartition sp_baz values ('baz')
)
(
   partition p_init values less than (100)
);

DML operations and querying the data dictionary

insert into tq84_interval_list values ( 50, 'bar', 1.1);

column    partition_name format a30
column subpartition_name format a30
column high_value        format a30

select
   subpar.partition_name,
   subpar.subpartition_name,
   tabpar.high_value
from
  user_tab_partitions    tabpar join
  user_tab_subpartitions subpar on   tabpar.table_name = subpar.table_name
where
  tabpar.table_name = 'TQ84_INTERVAL_LIST';

insert into tq84_interval_list values (350, 'baz', 7.7);

select
   subpar.partition_name,
   subpar.subpartition_name,
   tabpar.high_value
from
  user_tab_partitions    tabpar join
  user_tab_subpartitions subpar on   tabpar.table_name = subpar.table_name
where
  tabpar.table_name = 'TQ84_INTERVAL_LIST';

drop table tq84_interval_list;

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759482250, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/objects/tables/partitions/distribution-techniques/composite/subpartion-template/index(93): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78