当前位置:网站首页>91-oracle普通表改分区表的几种方法
91-oracle普通表改分区表的几种方法
2022-06-22 19:10:00 【老虎刘】
在对很多客户的oracle数据库做优化的时候发现, 很多系统都有一些大表没有做分区, 导致性能不佳和维护不便.
下面介绍4种普通表改分区表的方法, 供参考:
方法1:
新建分区表, 然后insert select; 或者在创建新分区表的同时插入(CTAS ,create table as select). 完成后做两次rename table操作.
方法2:
在线重定义, 使用DBMS_REDEFINITION, 步骤有点复杂 ,网上有很多介绍该方法的文章, 可以百度一下.
方法3:
创建只有一个分区的分区表, 用exchange partition将原表变成分区表后,再split partition.
方法4:
适用12.2+版本, 可以直接通过alter table xxx modify 命令, 将表直接改成分区表, 支持online不停业务.
推荐使用方法3和4, 符合版本要求就用4. 其他几个方法版本8.x以上都支持.
上面只是简单介绍了方法, 具体还有很多细节, 包括global index/local index的选择, 如何用最短时间完成,减少对业务的影响等. 多测试,多比较,实践出真知.
另外, 分区字段和分区类型的选择, 也是非常重要的, 需要结合业务好好研究再做决定. oracle的分区是一个很好的功能, 以后有机会可以作为一个培训技术专题给大家分享.
如果大家还有更好的方法, 请在留言区留下您的建议, 多谢!
大表操作有风险, 祝一帆风顺!
边栏推荐
- MySQL基础——约束
- 智能计算之神经网络(Hopfield网络-DHNN,CHNN )介绍
- Oh, my God, it's a counter attack by eight part essay
- [deeply understand tcapulusdb technology] view the online operation of tcapulusdb
- [proteus simulation] H-bridge drive DC motor composed of triode + key forward and reverse control
- 【深入理解TcaplusDB技术】单据受理之创建业务指南
- what? You can't be separated by wechat
- MySQL Basics - functions
- [deeply understand tcapulusdb technology] tcapulusdb process
- An error is reported when idea writes JSP code, but it is solved by normal operation
猜你喜欢
随机推荐
Merge sort (recursive and iterative Implementation)
Teach you how to create SSM project structure in idea
[in depth understanding of tcapulusdb technology] tcapulusdb operation and maintenance
经典面试题:一个页面从输入url到呈现过程
【深入理解TcaplusDB技术】单据受理之创建业务指南
Implementation of UART with analog serial port
Introduction of Neural Network (BP) in Intelligent Computing
完全背包如何考虑排列问题
什么?你居然不会微信分身
[proteus simulation] 74LS138 decoder water lamp
Lora technology -- Lora signal changes from data to Lora spread spectrum signal, and then from RF signal to data through demodulation
Comment le sac à dos complet considère - t - il la disposition?
Scheduling with Testing
跨域 CORS/OPTIONS
Nestjs 集成 config module 与 nacos 实现配置化统一
IVX no code challenge five second game production
How should programmers look up dates
软件压力测试有哪些方法,如何选择软件压力测试机构?
不断重修的计划与变化
Unityeditor editor script execution menu









