Home>Article>Database> How to delete table partition in oracle

How to delete table partition in oracle

WBOY
WBOY Original
2022-01-05 16:29:38 17045browse

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.

How to delete table partition in oracle

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';

How to delete table partition in oracle

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn