12c Filtering Maintenance Operations

本文介绍如何在Oracle数据库中使用ALTER TABLE的FILTERED MOVE PARTITION操作,配合数据过滤,仅保留满足条件的数据。通过实例展示如何移动分区的同时移除非开放订单。此功能适用于MOVE、MERGE和SPLIT操作,支持实时维护并允许在维护期间进行DML操作。
摘要由CSDN通过智能技术生成

Partition maintenance operations support the addition of data filtering, enabling the combination of partition and data maintenance.

A filtered partition maintenance operation only preserves the data satisfying the data filtering as part of the partition maintenance. The capability of data filtering applies to MOVE PARTITION, MERGE PARTITION, and SPLIT PARTITION .

Example 4-27 shows the use of the ALTER TABLE statement to move a partition while removing all orders that are not open (closed orders).

The filtering predicate must be on the partitioned table. All partition maintenance operations that can be performed online (MOVE and SPLIT) can also be performed as filtered partition maintenance operations. With ONLINE specified, DML operations on the partitions being maintained are allowed.

模拟实验


insert into dbmt.YHTEST2 select * from dbmt.YHTEST





SQL> select count(*) from dbmt.YHTEST2 partition (PART_202006)  where   wbs_level='2';

  COUNT(*)
----------
     11110

SQL> select count(*) from dbmt.YHTEST2 partition (PART_202006);

  COUNT(*)
----------
     15025

SQL> 
SQL> 
SQL> ALTER TABLE dbmt.yhtest2
  2    MOVE PARTITION PART_202006  COMPRESS ONLINE
  3    INCLUDING ROWS WHERE wbs_level='2';



SQL> select count(*) from dbmt.YHTEST2 partition (PART_202006);

  COUNT(*)
----------
     11110

SQL> select count(*) from dbmt.YHTEST2 partition (PART_202006)  where   wbs_level='2';

  COUNT(*)
----------
     11110

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值