当前位置:网站首页>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
边栏推荐
- Signal and slot mechanism of QT learning
- Several methods of HyperMesh running script files
- “蔚来杯“2022牛客暑期多校训练营3 H.Hacker SAM+线段树/DP/分治(不带修查区间最大子段和)
- Debugging methods of USB products (fx3, ccg3pa)
- Li Hongyi, machine learning 4. Deep learning
- MD5加密验证
- MySQL5.7及SQLyogV12安装及使用破解及常用命令
- HDU1847解题思路
- 微软:Edge 浏览器已内置磁盘缓存压缩技术,可节省空间占用且不降低系统性能
- Quickly master kotlin set functions
猜你喜欢

MySQL5.7及SQLyogV12安装及使用破解及常用命令

Ansa secondary development - apps and ansa plug-in management

Kubeedge releases white paper on cloud native edge computing threat model and security protection technology

Applet: get element node information

Configure HyperMesh secondary development environment on vs Code

Sort 3-select sort and merge sort (recursive implementation + non recursive implementation)

nowcode-学会删除链表中重复元素两题(详解)

Leetcode learn complex questions with random pointer linked lists (detailed explanation)

HyperMesh自动保存(增强版)插件使用说明

Sort 2 bubble sort and quick sort (recursive and non recursive explanation)
随机推荐
QT packaging
“蔚来杯“2022牛客暑期多校训练营3 ACFHJ
Leetcode learn to insert and sort unordered linked lists (detailed explanation)
Interesting kotlin 0x0a:fun with composition
CRC16 data verification supports modelbus and XMODEM verification modes (C language)
First day of QT study
Using pyqt to design gui in ABAQUS
php关于数据量大导出数据或者遍历数据导致内存溢出超时等问题
大地坐标系转换火星坐标系
curl无输出返回空白或者null问题解决
MD5加密验证
Optimization of network request success rate in IM instant messaging software development
Interesting kotlin 0x06:list minus list
关于web对接针式打印机问题,Lodop使用
在abaqus中使用PyQt设计GUI
PHP 图片上传
LwIP development | socket | UDP
MySQL view event status statements and modification methods
redis源码优化--绑核
Learn ABAQUS script programming script in an hour