当前位置:网站首页>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的分区是一个很好的功能, 以后有机会可以作为一个培训技术专题给大家分享.
如果大家还有更好的方法, 请在留言区留下您的建议, 多谢!
大表操作有风险, 祝一帆风顺!
边栏推荐
- Introduction to JWT
- 完全背包如何考虑排列问题
- leetcode.11 --- 盛最多水的容器
- client-go gin的简单整合十一-Delete
- [deeply understand tcapulusdb technology] tcapulusdb table management - create a new table
- Three dimensional world helps the laboratory to consolidate the complete quality system management
- A Dynamic Near-Optimal Algorithm for Online Linear Programming
- Cloud computing in the metauniverse to enhance your digital experience
- Which securities firm is better to choose for opening an account in flush? Is it safe to open a mobile account?
- 软件压力测试有哪些方法,如何选择软件压力测试机构?
猜你喜欢

How to realize @ person function in IM instant messaging

Teach you how to create SSM project structure in idea

MySQL基础——约束

软件压力测试有哪些方法,如何选择软件压力测试机构?

不断重修的计划与变化

Introduction of neural network (BP) in Intelligent Computing
![Web technology sharing | [Gaode map] to realize customized track playback](/img/80/7daba6716b85276de8d09b9d016313.png)
Web technology sharing | [Gaode map] to realize customized track playback
![[proteus simulation] 8x8LED dot matrix digital cyclic display](/img/a9/0107eb02c7a081fb466b1c7c12baef.png)
[proteus simulation] 8x8LED dot matrix digital cyclic display

MySQL高级(二)

基于Sentinel的高可用限流系统的Grafana报表展示
随机推荐
How to consider the arrangement of complete knapsack
[graduation season] step by step? Thinking about four years of University by an automation er
Cross domain cors/options
Web technology sharing | [Gaode map] to realize customized track playback
一个支持IPFS的电子邮件——SKIFF
一张图解码 OpenCloudOS 社区开放日
深度学习常用损失函数总览:基本形式、原理、特点
[proteus simulation] 74LS138 decoder water lamp
Can financial products be redeemed on weekends?
3个月自学自动化测试,薪资从4.5K到15K,鬼知道我经历了什么?
Which securities firm is better to choose for opening an account in flush? Is it safe to open a mobile account?
三维天地助力实验室夯实完整质量体系管理
MySQL中如何计算同比和环比
关于放大器失真的原因你了解多少呢?
[in depth understanding of tcapulusdb technology] introduction tcapulusdb problem summary
Be careful with MySQL filesort
mysql8.0忘记密码的详细解决方法
What can the accelerated implementation of digital economy bring to SMEs?
Introduction to JWT
怎样实现网页端im即时通讯中的@人功能