{"id":139,"date":"2013-07-06T12:12:28","date_gmt":"2013-07-06T17:12:28","guid":{"rendered":"https:\/\/bijoos.com\/oraclenotes\/?p=139"},"modified":"2026-02-07T15:35:09","modified_gmt":"2026-02-07T21:35:09","slug":"oracledb12c-new-feature-adding-dropping-truncating-multiple-partitions","status":"publish","type":"post","link":"https:\/\/bijoos.com\/oraclenotes\/2013\/139\/","title":{"rendered":"OracleDB12c New Feature: Adding, Dropping, Truncating Multiple Partitions"},"content":{"rendered":"<p>Yesterday, we discussed merging and splitting multiple partitions. The same feature is extended in 12c to add, drop or truncate multiple partitions in a single SQL statement.<\/p>\n<p>Add multiple partitions example:<\/p>\n<pre class=\"lang:default highlight:0 decode:true\">ALTER TABLE SALESDATA ADD\nPARTITION S2015Q1 VALUES LESS THAN (TO_DATE('01-APR-15','DD-MON-YY')),\nPARTITION S2015Q2 VALUES LESS THAN (TO_DATE('01-JUL-15','DD-MON-YY')),\nPARTITION S2015Q3 VALUES LESS THAN (TO_DATE('01-OCT-15','DD-MON-YY')),\nPARTITION S2015Q4 VALUES LESS THAN (TO_DATE('01-JAN-16','DD-MON-YY'));<\/pre>\n<p>Read more in <a title=\"Adding Multiple Partitions\" href=\"http:\/\/docs.oracle.com\/cd\/E16655_01\/server.121\/e17613\/part_admin002.htm#autoId19\" target=\"_blank\">Oracle Documentation<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Truncate multiple partitions example:<\/p>\n<pre class=\"lang:default highlight:0 decode:true crayon-selected\">ALTER TABLE SALESDATA TRUNCATE PARTITIONS&amp;nbsp;\nS2001Q1, S2001Q2, S2001Q3, S2001Q4;<\/pre>\n<p>Read more in <a title=\"Truncating Multiple Partitions\" href=\"http:\/\/docs.oracle.com\/cd\/E16655_01\/server.121\/e17613\/part_admin002.htm#autoId104\" target=\"_blank\">Oracle Documentation<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Drop multiple partitions example:<\/p>\n<pre class=\"lang:default highlight:0 decode:true\">ALTER TABLE SALESDATA DROP PARTITIONS\u00a0\nS2001Q1, S2001Q2, S2001Q3, S2001Q4;<\/pre>\n<p>Read more in <a title=\"Drop Multiple Partitions\" href=\"http:\/\/docs.oracle.com\/cd\/E16655_01\/server.121\/e17613\/part_admin002.htm#autoId30\" target=\"_blank\">Oracle Documentation<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday, we discussed merging and splitting multiple partitions. The same feature is extended in 12c to add, drop or truncate multiple partitions in a single SQL statement. Add multiple partitions example: ALTER TABLE SALESDATA ADD PARTITION S2015Q1 VALUES LESS THAN (TO_DATE(&#8217;01-APR-15&#8242;,&#8217;DD-MON-YY&#8217;)), PARTITION S2015Q2 VALUES LESS THAN (TO_DATE(&#8217;01-JUL-15&#8242;,&#8217;DD-MON-YY&#8217;)), PARTITION S2015Q3 VALUES LESS THAN (TO_DATE(&#8217;01-OCT-15&#8242;,&#8217;DD-MON-YY&#8217;)), PARTITION S2015Q4 &#8230; <a title=\"OracleDB12c New Feature: Adding, Dropping, Truncating Multiple Partitions\" class=\"read-more\" href=\"https:\/\/bijoos.com\/oraclenotes\/2013\/139\/\" aria-label=\"Read more about OracleDB12c New Feature: Adding, Dropping, Truncating Multiple Partitions\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[133],"tags":[40,60],"class_list":["post-139","post","type-post","status-publish","format-standard","hentry","category-oracledb","tag-oracle-12c","tag-partition"],"acf":[],"jetpack-related-posts":[{"id":135,"url":"https:\/\/bijoos.com\/oraclenotes\/2013\/135\/","url_meta":{"origin":139,"position":0},"title":"OracleDB12c New Feature: Merging and Splitting Multiple Partitions","author":"Biju","date":"July 5, 2013","format":false,"excerpt":"In Oracle11g, you can merge or split two partitions. This feature is enhanced in 12c to merge and split multiple partitions in a single SQL thus reducing the maintenance operations. When merging range partitions, they must be adjacent. Merging Partitions Example: ALTER TABLE SALESDATA MERGE PARTITIONS S2012Q1, S2012Q2, S2012Q3, S2012Q4\u2026","rel":"","context":"In &quot;Oracle Database&quot;","block_context":{"text":"Oracle Database","link":"https:\/\/bijoos.com\/oraclenotes\/category\/oracledb\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":114,"url":"https:\/\/bijoos.com\/oraclenotes\/2013\/114\/","url_meta":{"origin":139,"position":1},"title":"OracleDB12c New Feature: Cascaded Truncate","author":"Biju","date":"June 29, 2013","format":false,"excerpt":"Oracle Database 12c, now TRUNCATE statement is enhanced with \u00a0CASCADE option. This is pretty useful, that you need not worry about truncating all \"child\" tables before truncating the parent. With the CASCADE option, Oracle will truncate all tables with a foreign key constraint to the table being truncated. The foreign\u2026","rel":"","context":"In &quot;Oracle Database&quot;","block_context":{"text":"Oracle Database","link":"https:\/\/bijoos.com\/oraclenotes\/category\/oracledb\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":426,"url":"https:\/\/bijoos.com\/oraclenotes\/2014\/426\/","url_meta":{"origin":139,"position":2},"title":"Oracle Tidbits &#8211; June 2014","author":"Biju","date":"June 30, 2014","format":false,"excerpt":"\u201cOracle *daily* TidBits\u201d published at\u00a0https:\/\/www.facebook.com\/oraclenotes\u00a0on all weekdays\u00a0in June\u00a02014. You will also see these tidbits, one tidbit at a time, for each page refresh on the right side of this blog as well\u2026 TidBit Topic In Oracle Database 12c, the Pre-Upgrade Information Tool script is preupgrd.sql (meaningfully named). Earlier release pre-upgrade\u2026","rel":"","context":"In &quot;TidBits &amp; Quick Tips&quot;","block_context":{"text":"TidBits &amp; Quick Tips","link":"https:\/\/bijoos.com\/oraclenotes\/category\/tidbits\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":495,"url":"https:\/\/bijoos.com\/oraclenotes\/2014\/495\/","url_meta":{"origin":139,"position":3},"title":"Oracle TidBits &#8211; July 2014","author":"Biju","date":"August 1, 2014","format":false,"excerpt":"\u201cOracle *daily* TidBits\u201d published at\u00a0https:\/\/www.facebook.com\/oraclenotes\u00a0on all weekdays\u00a0in July 2014. You will also see these tidbits, one tidbit at a time, for each page refresh on the right side of this blog as well\u2026 Hope you find these helpful to learn something new or to remind you of its existence and\u2026","rel":"","context":"In &quot;TidBits &amp; Quick Tips&quot;","block_context":{"text":"TidBits &amp; Quick Tips","link":"https:\/\/bijoos.com\/oraclenotes\/category\/tidbits\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":21,"url":"https:\/\/bijoos.com\/oraclenotes\/2011\/21\/","url_meta":{"origin":139,"position":4},"title":"Read Only Tables [Orig Published Apr 2000]","author":"Biju","date":"September 26, 2011","format":false,"excerpt":"In Oracle (all versions including 10g) you can make a tablespace read only, but not a single table. To make a table read only, you need to have that table in its own tablespace. If the tablespace has many tables, then you can either make all the tables read only\u2026","rel":"","context":"In &quot;Oracle Database&quot;","block_context":{"text":"Oracle Database","link":"https:\/\/bijoos.com\/oraclenotes\/category\/oracledb\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1513,"url":"https:\/\/bijoos.com\/oraclenotes\/2015\/1513\/","url_meta":{"origin":139,"position":5},"title":"Oracle Tidbits &#8211; March 2015","author":"Biju","date":"April 1, 2015","format":false,"excerpt":"\u201cOracle *daily* TidBits\u201d (#oratidbit) published at\u00a0https:\/\/www.facebook.com\/oraclenotes\u00a0on weekdays\u00a0in March\u00a02015. You will also see these tidbits, one tidbit at a time, for each page refresh on the right side of this blog as well\u2026 Hope you find these helpful to learn something new or to remind you of its existence and use\u2026\u2026","rel":"","context":"In &quot;TidBits &amp; Quick Tips&quot;","block_context":{"text":"TidBits &amp; Quick Tips","link":"https:\/\/bijoos.com\/oraclenotes\/category\/tidbits\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/comments?post=139"}],"version-history":[{"count":1,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/139\/revisions"}],"predecessor-version":[{"id":3032,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/139\/revisions\/3032"}],"wp:attachment":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/media?parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/categories?post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/tags?post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}