无法删除 Oracle 索引分区——除了删除整个索引并重建之外还有其他选择吗?

发布于 2024-10-11 14:17:56 字数 233 浏览 4 评论 0原文

因此,我有一个 .NET 程序通过 Oracle ODP.NET 使用数组绑定存储过程调用将记录批量加载到分区表中,但这既不存在也不存在。

我想知道的是:因为我在所述表上有分区索引,所以批量加载的速度非常慢。我完全理解我不能删除索引分区,但我显然不希望删除并重建整个索引,因为这将花费更多的时间来执行。这是我唯一的办法吗?

有没有一种相当简单的方法来删除分区本身,然后重建分区和索引分区,这样可以节省时间并实现我的目标?

So, I have a .NET program doing batch loading of records into partitioned tables using array bound stored procedure calls via Oracle ODP.NET, but that's neither here nor there.

What I would like to know is: because I have a partitioned index on said tables, the speed of the batch load is pretty slow. I fully understand that I cannot drop an index partition, but I would obviously prefer not to have to drop and rebuild the entire index since that will take considerably more time to execute. Is this my only recourse?

Is there a fairly simple way to drop the partition itself and then rebuild the partition and index partition that would save time and go about accomplishing my goal?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

伏妖词 2024-10-18 14:17:56

您是否一次加载整个分区?或者您只是向现有分区添加新行?所有索引都与表等分区吗?

通常,如果您要将数据加载到分区表中,则会选择分区方案,以便每次加载都会将数据放入新的分区中。如果是这种情况,您可以使用分区交换来加载数据。简而言之,您将数据加载到结构与真实表匹配的(未索引的)临时表中,创建索引以匹配真实表上的索引,然后执行以下操作:

ALTER TABLE partitioned_table
  EXCHANGE PARTITION new_partition_name
  WITH TABLE staging_table_name
  WITHOUT VALIDATION;

Are you loading an entire partition at once? Or are you merely adding new rows to an existing partition? Are all the indexes equipartitioned with the table?

Normally, if you are loading data into a partitioned table, your partitioning scheme is chosen so that each load will put data into a fresh partition. If that is the case, you can use partition exchange to load the data. In a nutshell, you load data into an (unindexed) staging table whose structure matches the real table, you create the indexes to match the indexes on the real table, and then do

ALTER TABLE partitioned_table
  EXCHANGE PARTITION new_partition_name
  WITH TABLE staging_table_name
  WITHOUT VALIDATION;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文