12
返回列表 发新帖
楼主: cqiwen

[讨论] oracle普通表转分区表之后的唯一索引创建问题

[复制链接]
论坛徽章:
2
20周年集字徽章-周
日期:2023-08-03 16:37:4519周年集字徽章-19
日期:2024-09-07 21:32:18
11#
发表于 2022-3-24 09:38 | 只看该作者
jihuyao 发表于 2022-3-18 01:22
Why not partition on orderid for both performance and maintenance purpose?  If orderid is from seque ...

这个方法确实能解决local index全局唯一的问题, 但是如果sequence不设置成ordered=y, sequence与插入时间就对应不上了.  一般还是以日期做分区字段最为常见.

使用道具 举报

回复
论坛徽章:
0
12#
发表于 2022-3-29 02:57 来自手机 | 只看该作者
Even though sequence is used one can only truncate old partitions after making sure all rows in it have date meeting purging cutoff date.  And also it is necessary to keep ONE low boundary partition available for possible business operations in future.  This implies a maintenance window for purging is needed.  If have to perform delete, lock each partition and then transfer minor rows to temp table and then truncate and then exchange back (all in maintenance hours).  If only minor rows need to be purged then just delete.  As long as undo tablespace can be well managed redo should not be problem on such set data process for minor rows delete.

使用道具 举报

回复
论坛徽章:
314
行业板块每日发贴之星
日期:2012-07-12 18:47:29双黄蛋
日期:2011-08-12 17:31:04咸鸭蛋
日期:2011-08-18 15:13:51迷宫蛋
日期:2011-08-18 16:58:25紫蛋头
日期:2011-08-31 10:57:28ITPUB十周年纪念徽章
日期:2011-09-27 16:30:47蜘蛛蛋
日期:2011-10-20 15:51:25迷宫蛋
日期:2011-10-29 11:12:59ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41鲜花蛋
日期:2011-11-09 20:33:30
13#
发表于 2022-3-29 09:22 | 只看该作者
可以尝试下对SUBTIME字段,使用TIMESTAMP类型,精确到微妙,

使用道具 举报

回复
论坛徽章:
8
2009新春纪念徽章
日期:2009-01-04 14:52:28祖国60周年纪念徽章
日期:2009-10-09 08:28:002010新春纪念徽章
日期:2010-03-01 11:07:24ITPUB9周年纪念徽章
日期:2010-10-08 09:32:25ITPUB十周年纪念徽章
日期:2011-11-01 16:23:262013年新春福章
日期:2013-02-25 14:51:24沸羊羊
日期:2015-03-04 14:51:522015年新春福章
日期:2015-03-06 11:57:31
14#
发表于 2022-4-1 15:42 | 只看该作者
jihuyao 发表于 2022-3-18 01:22
Why not partition on orderid for both performance and maintenance purpose?  If orderid is from seque ...

这种方法如果orderid有序还好,否则,如果随机产生,维护清理数据就比较麻烦。

使用道具 举报

回复
论坛徽章:
2
20周年集字徽章-周
日期:2023-08-03 16:37:4519周年集字徽章-19
日期:2024-09-07 21:32:18
15#
发表于 2022-4-2 09:12 | 只看该作者
jihuyao 发表于 2022-3-29 02:57
Even though sequence is used one can only truncate old partitions after making sure all rows in it h ...

如果使用了scale extend sequence 也是不行的, 这种sequence 是为了解决高并发插入时index contention问题; 后面说的delete , 在高版本有简单的方法, 就是使用alter table move partition  including rows.

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表