Method: 1. Use the "ALTER table name SALES DROP PARTITION partition name;" statement to delete table partitions; 2. Use the "ALTER table name SALES DROP SUBPARTITION partition name;" statement to delete subpartitions.
The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.
How to delete table partition in oracle
Delete table partition (drop partition)
Deleting table partition includes two operations, They are:
Delete partition:
alter table [tbname] drop partition [ptname] UPDATE GLOBAL INDEXES ;
Delete sub-partition:
alter table [tbname] drop subpartition [ptname] UPDATE GLOBAL INDEXES;
In addition to hash partition and hash sub-partition, other partition formats can support this operation. For example, to delete a partition:
JSSWEB> select table_name,partition_name 2 from user_tab_partitions where table_name='T_PARTITION_LIST';
The table has changed.
Tips, when dropping a partition, the data stored in the partition will also be deleted at the same time, for example:
SSWEB> insert into t_partition_list values (1,'a'); .......... --插入一批记录,分布于当前各个分区 .......... JSSWEB> commit;
Submission completed.
Recommended tutorial: "Oracle Tutorial"
The above is the detailed content of How to delete table partition in oracle. For more information, please follow other related articles on the PHP Chinese website!