Hybrid Partitioned Table With Auto-List Partitioning
Hybrid partitioned tables were introduced in Oracle 19c, allowing us to create partitioned tables with a mix of internal and external partitions. In 19c it was not possible to combine this with interval or auto-list partitioning, but that has changed in Oracle database 23ai/26ai. This article demonstrates hybrid partitioned tables with interval and auto-list partitioning in Oracle Database 23ai/26ai.
- Setup
- Hybrid Partitioned Table With Interval Partitioning
- Hybrid Partitioned Table With Auto-List Partitioning
Related articles.
Connect to a privileged user and create a new test user called .
Create a directory object, making sure has , and permissions on them.
All other actions will be performed from .
Generate some flat files with dummy data for use with external table partitions.
The following example creates a hybrid partitioned table. It uses interval partitioning, with a single external partition for 2022 data, and a single internal partitions for 2023 data respectively.
The clause defines the table-level external table parameters. For external partitions, the clause is used to define partition-level attributes, such as file locations and non-default directory objects.
The column in the views show this is a hybrid table.
We only have data in the external partitions at the moment.
We can perform DML on the internal partition as normal.
All this behaviour is typical for a hybrid list partitioned table. Because this is an interval hybrid partitioned table, we can also insert records for new years, which create new partitions. First we check the current partitions for the table.
Now we insert some data for two new years.
We can see two new partitions have been created for the new years.
And of course we can see the data is present when we query the table.
Generate some flat files with dummy data for use with external table partitions.
The following example creates a hybrid partitioned table. It uses auto-list partitioning, with a single internal partition for USA data, and two external partitions for GBR and IRE data respectively.
The clause defines the table-level external table parameters. For external partitions, the clause is used to define partition-level attributes, such as file locations and non-default directory objects.
The column in the views show this is a hybrid table.
We only have data in the external partitions at the moment.
We can perform DML on the internal partition as normal.
All this behaviour is typical for a hybrid list partitioned table. Because this is an auto-list hybrid partitioned table, we can also insert records for new countries, which create new partitions. First we check the current partitions for the table.
Now we insert some data for two new countries.
We can see two new partitions have been created for the new countries.
And of course we can see the data is present when we query the table.
For more information see:
Hope this helps. Regards Tim...
- Setup
- Hybrid Partitioned Table With Interval Partitioning
- Hybrid Partitioned Table With Auto-List Partitioning
Related articles.
Connect to a privileged user and create a new test user called .
Create a directory object, making sure has , and permissions on them.
All other actions will be performed from .
Generate some flat files with dummy data for use with external table partitions.
The following example creates a hybrid partitioned table. It uses interval partitioning, with a single external partition for 2022 data, and a single internal partitions for 2023 data respectively.
The clause defines the table-level external table parameters. For external partitions, the clause is used to define partition-level attributes, such as file locations and non-default directory objects.
The column in the views show this is a hybrid table.
We only have data in the external partitions at the moment.
We can perform DML on the internal partition as normal.
All this behaviour is typical for a hybrid list partitioned table. Because this is an interval hybrid partitioned table, we can also insert records for new years, which create new partitions. First we check the current partitions for the table.
Now we insert some data for two new years.
We can see two new partitions have been created for the new years.
And of course we can see the data is present when we query the table.
Generate some flat files with dummy data for use with external table partitions.
The following example creates a hybrid partitioned table. It uses auto-list partitioning, with a single internal partition for USA data, and two external partitions for GBR and IRE data respectively.
The clause defines the table-level external table parameters. For external partitions, the clause is used to define partition-level attributes, such as file locations and non-default directory objects.
The column in the views show this is a hybrid table.
We only have data in the external partitions at the moment.
We can perform DML on the internal partition as normal.
All this behaviour is typical for a hybrid list partitioned table. Because this is an auto-list hybrid partitioned table, we can also insert records for new countries, which create new partitions. First we check the current partitions for the table.
Now we insert some data for two new countries.
We can see two new partitions have been created for the new countries.
And of course we can see the data is present when we query the table.
For more information see:
Hope this helps. Regards Tim...
