当前位置:网站首页>Oracle table partition
Oracle table partition
2022-07-28 16:47:00 【Royal shadow time】
oracle Table partitioning
1. Create table partition
1.1 New table
- New tables can be created directly
1.2 Create partitions for old tables
Online redefining function ( Baidu )
Directly establish
Back up the old table first ( best )
Query the index of the old table
Create partitions ( With hash Zoning as an example )
-- Create partitions create table IDX_MAKT_QUOT_PARTITION partition by hash(PROD_CD) ( partition p1 , partition p2 , partition p3 , partition p4 ) as select * from IDX_MAKT_QUOT
View partition data
-- View the data of the corresponding partition select count(*) from IDX_MAKT_QUOT_PARTITION partition(p2); select PROD_CD from IDX_MAKT_QUOT_PARTITION partition(p3) GROUP BY PROD_CD HAVING count(PROD_CD) >1 ;
View the partition table information
select * from user_tab_partitions; select * from DBA_PART_TABLES a where a.owner=upper('otc') and a.table_name=upper('IDX_MAKT_QUOT_PARTITION');
Enable update operations to span table partitions ( It's best that the partition field doesn't change )
-- Enable update operations to span table partitions The default partition table is not allowed for partition fields update Operation of the , Report errors ——ORA-14402: Updating the partition keyword column causes the partition to change alter table IDX_MAKT_QUOT_PARTITION enable row movement; -- Turn off row migration alter table IDX_MAKT_QUOT_PARTITION disable row movement;
More partition maintenance references https://blog.csdn.net/woailyoo0000/article/details/78836474
2. Create index
Create index ( Local index )
create index IDX_MAKT_QUOT_PARTITION_INDEX on IDX_MAKT_QUOT_PARTITION(PROD_CD) local ( partition p1 , partition p2 , partition p3 , partition p4 )
View index information
-- View index information , View partition information ( Include the number of rows per partition ) select * from dba_ind_partitions where index_name='IDX_MAKT_QUOT_PARTITION_INDEX' select * from user_indexes where index_name='IDX_MAKT_QUOT_PARTITION_INDEX';
More reference https://www.cnblogs.com/xcnblog3035/p/5266894.html https://blog.csdn.net/wonderful_life_mrchi/article/details/77062861https://blog.csdn.net/xujinyang/article/details/710955
3. Delete partition table
Delete directly
ALTER TABLE IDX_MAKT_QUOT_PARTITION DROP PARTITION p1;
If you accidentally delete the table first , You can also see the partition table by viewing the partition information , But the table name is random
-- Delete the table in the recycle bin ALTER TABLE IDX_MAKT_QUOT_PARTITION DROP PARTITION p1;
More reference https://blog.csdn.net/shangzhiliang_2008/article/details/46728279 https://blog.csdn.net/smilecjw/article/details/78658984
边栏推荐
- 在abaqus中使用PyQt设计GUI
- CRC16 data verification supports modelbus and XMODEM verification modes (C language)
- “蔚来杯“2022牛客暑期多校训练营3 J.Journey 0-1最短路
- Li Hongyi, machine learning 5. Tips for neural network design
- Interesting kotlin 0x0a:fun with composition
- ABAQUS GUI interface solves the problem of Chinese garbled code (plug-in Chinese garbled code is also applicable)
- curl无输出返回空白或者null问题解决
- Qt学习之Qt Designer(设计师)
- 重置grafana登录密码为默认密码
- "Weilai Cup" 2022 Niuke summer multi school training camp 3 h.hacker sam+ segment tree /dp/ divide and conquer (without the largest sub segment and of the inspection interval)
猜你喜欢
随机推荐
排序5-计数排序
asp.net大文件分块上传断点续传demo
Qt学习之安装
Redis source code optimization -- binding core
First day of QT study
Qt学习之Qt Designer(设计师)
Wake up after being repeatedly upset by MQ! Hate code out this MQ manual to help the journey of autumn recruitment
Sort 1-insert sort and Hill sort
微信公众号获取素材列表
Interesting kotlin 0x0a:fun with composition
Simple addition, deletion, modification and query of commodity information
LeetCode每日一练 —— 剑指Offer 56 数组中数字出现的次数
Signal and slot mechanism of QT learning
curl无输出返回空白或者null问题解决
局域网无法访问apache服务器
Signal shielding and processing
PHP计算坐标距离
El input limit can only input the specified number
LeetCode每日一练 —— 160. 相交链表
ABAQUS GUI interface solves the problem of Chinese garbled code (plug-in Chinese garbled code is also applicable)









