当前位置:网站首页>Several methods of changing 91 Oracle common table into partitioned table

Several methods of changing 91 Oracle common table into partitioned table

2022-06-22 22:18:00 Tiger Liu

For many customers oracle When the database is optimized, it is found that , Many systems have some large tables that are not partitioned , Poor performance and inconvenient maintenance .

Let's introduce 4 A method to change a common table into a partitioned table , For reference :

Method 1:

New partition table , then insert select; Or insert... While creating a new partition table (CTAS ,create table as select). Do it twice after completion rename table operation .

Method 2:

Online redefinition , Use DBMS_REDEFINITION, The steps are a little complicated , There are many articles about this method on the Internet , You can baidu .

Method 3:

Create a partitioned table with only one partition , use exchange partition Change the original table into a partitioned table , Again split partition.

Method 4:

apply 12.2+ edition , You can go directly through alter table xxx modify command , Change the table directly into a partitioned table , Support online Keep on doing business .

Recommended use 3 and 4, If it meets the version requirements, use 4. Several other method versions 8.x All of the above support .

The above simply introduces the method , There are many details , Include global index/local index The choice of , How to finish in the shortest time , Reduce the impact on the business . More testing , Multiple comparison , True knowledge comes from practice .

in addition , Selection of partition field and partition type , It's also very important , It needs to be studied carefully in combination with the business before making a decision . oracle The partition of is a good function , In the future, I can share it as a training technology topic .

If you have a better way , Please leave your suggestions in the message area , Thank you very much !

Large table operation is risky , I wish you all the best !

原网站

版权声明
本文为[Tiger Liu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221910053578.html