Oracle 26ai — Enhancements to Data Dictionary Views for Partitioning

 In data dictionary views related to partitioning, the HIGH_VALUE column is one of the most frequently used attributes. However, its datatype is LONG, which comes with several limitations and restrictions.

To address these limitations, Oracle AI Database 26ai introduces two additional columns, HIGH_VALUE_CLOB and HIGH_VALUE_JSON, allowing partition high values to be represented in more convenient formats.

Join The Writer's Circle event

The following example creates an interval-partitioned table:

SQL> create table tb(
2 id number,
3 date_ date
4 )
5 partition by range ( date_ )
6 interval ( numtoyminterval(1,'YEAR'))
7 (
8 PARTITION p2022 VALUES LESS THAN (TO_DATE('2023/01/01', 'YYYY/MM/DD')),
9 PARTITION p2023 VALUES LESS THAN (TO_DATE('2024/01/01', 'YYYY/MM/DD')),
10 PARTITION p2024 VALUES LESS THAN (TO_DATE('2025/01/01', 'YYYY/MM/DD'))
11 );
Table created

To display partition boundary values in CLOB format, the HIGH_VALUE_CLOB column can be queried:

SQL> select partition_name, high_value_clob from user_tab_partitions where  table_name = 'TB' order by 1;
PARTITION_NAME HIGH_VALUE_CLOB
-------------------- --------------------------------------------------------
P2022 TO_DATE(' 2023-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS'
P2023 TO_DATE(' 2024-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS'
P2024 TO_DATE(' 2025-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS'

Oracle 26ai also introduces the HIGH_VALUE_JSON column, which exposes the same information in JSON format:

SQL> select partition_name,HIGH_VALUE_JSON  from user_tab_partitions where  table_name = 'TB' order by 1;
PARTITION_NAME HIGH_VALUE_JSON
-------------------- ---------------------------------------------------------
P2022 {"high_value":"2023-01-01T00:00:00"}
P2023 {"high_value":"2024-01-01T00:00:00"}
P2024 {"high_value":"2025-01-01T00:00:00"}

Comments

Popular posts from this blog

Oracle 21c Enhancements for TTS Export/Import

Oracle 21c — Setting Compression Attribute for Indexes During Import

Automatic Service Failback to Preferred Instance in Oracle RAC 19c