当前位置:网站首页>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
边栏推荐
- QT packaging
- 500million users, four years earlier than wechat... This app, which has been in operation for 15 years, will be permanently discontinued
- Curl returns blank or null without output. Solve the problem
- redis源码优化--绑核
- Leetcode topic
- LeetCode每日一练 —— 160. 相交链表
- 微软100题-天天做-第11题
- ANSYS secondary development - MFC interface calls ADPL file
- 【从零开始学习SLAM】将坐标系变换关系发布到 topic tf
- Qt学习之安装
猜你喜欢

Nowcode- learn to delete duplicate elements in the linked list (detailed explanation)

Interesting kotlin 0x06:list minus list

Wake up after being repeatedly upset by MQ! Hate code out this MQ manual to help the journey of autumn recruitment

Ansa secondary development - Introduction to interface development tools

ANSYS secondary development - MFC interface calls ADPL file

Sort 5-count sort

有趣的 Kotlin 0x08:What am I

Each account corresponds to all passwords, and then each password corresponds to all accounts. How to write the brute force cracking code

Leetcode topic

Ansa secondary development - apps and ansa plug-in management
随机推荐
在vs code上配置Hypermesh二次开发环境
Rosen's QT journey 101 models and views in QT quick
局域网无法访问apache服务器
UNP前六章 回射服务模型 解析
Design direction of daily development plan
Pop up layer prompt in the background
2021-04-02
Leetcode learn to insert and sort unordered linked lists (detailed explanation)
curl无输出返回空白或者null问题解决
栈的介绍与实现(详解)
LeetCode-学会对无序链表进行插入排序(详解)
MySQL view event status statements and modification methods
Li Hongyi, machine learning 5. Tips for neural network design
Interesting kotlin 0x08:what am I
PHP calculate coordinate distance
获取时间戳的三种方法的效率比较
配置web服务器步骤详细记录(多有借鉴)
HM二次开发 - Data Names及其使用
Qt学习之安装
About the web docking pin printer, lodop uses