In Oracle 12c new word CASCADE can be specified for TRUNCATE and EXCHANGE command for “master” partitioned tables which are referenced by enabled ON DELETE CASCADE referential constraint.
Truncate Cascade for partitioned tables
If you specify TRUNCATE … CASCADE for “master” partitioned table then Oracle Database truncates all child reference tables that reference master partitioned table with an enabled ON DELETE CASCADE referential constraint. This is a recursive operation that will truncate all child reference tables, grandchild reference tables, and so on, using the specified options.
Following options are available for “master” partitioned tables:
1. In this case child, grandchild tables don’t need to be partitioned
TRUNCATE <table_name> CASCADE
2. In this case child, grandchild tables must be reference partitioned tables
ALTER TABLE <table_name>
TRUNCATE PARTITION <partition_name> CASCADE
ALTER TABLE <table_name>
TRUNCATE SUBPARTITION <subpartition_name> CASCADE
Continue reading →