Home > Database > Oracle > body text

How to delete table partition in oracle

WBOY
Release: 2022-01-05 16:29:38
Original
17163 people have browsed it

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  ;
Copy after login

Delete sub-partition:

alter table [tbname] drop subpartition [ptname]  UPDATE GLOBAL INDEXES;
Copy after login

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';
Copy after login

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;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template