• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

ORA-14652: reference partitioning foreign key is not supported

by admin

The Problem

While creating a reference partitioning, below ora error is encountered.

SQL> CREATE TABLE TRANSACTION_DETAILS
(TRAN_DTL_ID NUMBER,
DETAIL VARCHAR2(100),
CONSTRAINT TRAN_DTL_FK
FOREIGN KEY(TRAN_DTL_ID) 
REFERENCES TRANSACTIONS_MAIN(TRAN_ID))
PARTITION BY REFERENCE(TRAN_DTL_FK)  2    3    4    5    6    7  ;
PARTITION BY REFERENCE(TRAN_DTL_FK)
                       *
ERROR at line 7:
ORA-14652: reference partitioning foreign key is not supported

The Solution

Reference partitioning provides the ability to partition a table based on the partitioning scheme of the table referenced in its referential constraint. A table can now be partitioned based on the partitioning method of a table referenced in its referential constraint. Tables with a parent/child relationship can be equipartitioned by inheriting the partitioning key from the parent table without duplication of the key columns. If the parent table is a composite-partitioned table, then the table will have one partition for each subpartition of its parent.

Note: While creating a reference partitioning table, the foreign key must be not null.

Error code: ORA-14652
Description: reference partitioning foreign key is not supported
Cause: The specified partitioning foreign key was not supported for reference-partitioned tables. All columns of the partitioning foreign key must be constrained NOT NULL with enabled, validated, and not deferrable constraints. Furthermore, a virtual column cannot be part of the partitioning foreign key.

SQL> 
CREATE TABLE TRANSACTION_DETAILS
(TRAN_DTL_ID NUMBER NOT NULL,
DETAIL VARCHAR2(100),
CONSTRAINT TRAN_DTL_FK
FOREIGN KEY(TRAN_DTL_ID) 
REFERENCES TRANSACTIONS_MAIN(TRAN_ID))
PARTITION BY REFERENCE(TRAN_DTL_FK)SQL>   2    3    4    5    6    7  ;

Table created.

Filed Under: oracle

Some more articles you might also be interested in …

  1. Beginners Guide to Oracle Password Management Policy
  2. Oracle Database 12c New feature: Local Temporary Tablespaces
  3. RMAN: SET NEWNAME Command Using SQL
  4. Script to monitor RMAN Backup and Restore Operations
  5. How to add or drop redo log groups in Oracle RAC
  6. How to Move tables and indexes to a different tablespace
  7. How To Size UNDO Tablespace For Automatic Undo Management
  8. Oracle OS watcher (OSWatcher) – Understanding oswiostat
  9. How to Turn Archiving ON and OFF in Oracle database
  10. What are Oracle Key Vault Roles

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright