oracle patition 分区 参考博文

简单的分区方法是 Hash Partitioning

Hash partitioning enables easy partitioning of data that does not lend itself to range or list partitioning. It does this with a simple syntax and is easy to implement. It is a better choice than range partitioning when:

You do not know beforehand how much data maps into a given range

The sizes of range partitions would differ quite substantially or would be difficult to balance manually

Range partitioning would cause the data to be undesirably clustered

Performance features such as parallel DML, partition pruning, and partition-wise joins are important

The concepts of splitting, dropping or merging partitions do not apply to hash partitions. Instead, hash partitions can be added and coalesced.

Hash Partitioning Example

CREATE TABLE sales_hash

(salesman_id NUMBER(5),

salesman_name VARCHAR2(30),

sales_amount NUMBER(10),

week_no NUMBER(2))

PARTITION BY HASH(salesman_id)

PARTITIONS 4

STORE IN (data1, data2, data3, data4);

The preceding statement creates a table sales_hash, which is hash partitioned on salesman_id field. The tablespace names are data1,data2, data3, and data4.

对已有表添加partition的方法

根据partition 查询语句写

跨分区查询

select sum( *) from

(select count(*) cn from t_table_SS PARTITION (P200709_1)

union all

select count(*) cn from t_table_SS PARTITION (P200709_2)

);

查询表上有多少分区

SELECT * FROM useR_TAB_PARTITIONS WHERE TABLE_NAME='tableName'

查询索引信息

select object_name,object_type,tablespace_name,sum(value)

from v$segment_statistics

where statistic_name IN ('physical reads','physical write','logical reads')and object_type='INDEX'

group by object_name,object_type,tablespace_name

order by 4 desc

显示数据库所有分区表的信息:

select * from DBA_PART_TABLES

显示表分区名称之类的信息:

select *

from DBA_PART_COL_STATISTICS

where table_name like '%MIGRAT%'

另外关于查询分区表的信息可以参考:

为表添加索引的方法

CREATE INDEX emp_ename ON emp(ename)

TABLESPACE users

STORAGE (INITIAL 20K

NEXT 20k

PCTINCREASE 75);

注意:当设置主键的时候,是默认会加上一个唯一索引的,是自动创建的。可以指定包含这个索引的用户空间。

Creating an Index Associated with a Constraint

Oracle Database enforces a UNIQUE key or PRIMARY KEY integrity constraint on a table by creating a unique index on the unique key or primary key. This index is automatically created by the database when the constraint is enabled. No action is required by you when you issue the CREATE TABLE or ALTER TABLE statement to create the index, but you can optionally specify a USING INDEX clause to exercise control over its creation. This includes both when a constraint is defined and enabled, and when a defined but disabled constraint is enabled.

To enable a UNIQUE or PRIMARY KEY constraint, thus creating an associated index, the owner of the table must have a quota for the tablespace intended to contain the index, or the UNLIMITED TABLESPACE system privilege. The index associated with a constraint always takes the name of the constraint, unless you optionally specify otherwise.

oracle里面的分区索引,oracle patition 分区和索引相关推荐

  1. oracle删除建分区索引,Oracle分区表之创建维护分区表索引的详细步骤

    分区索引分为本地(local index)索引和全局索引(global index).局部索引比全局索引容易管理, 而全局索引比较快.与索引有关的表:dba_part_indexes 分区索引的概要统 ...

  2. oracle 建分区索引_Oracle分区表及分区索引-创建list分区

    Oracle 分区表及分区索引 - 创建 list 分区 创建 list 分区的语法如上,需要我们指定的 : l column: 分区依赖列 ( 注意:只能是一个 ); l partition: 分区 ...

  3. 【Oracle】表级别分区操作对索引(本地分区索引,全局分区索引,非分区索引)的影响

    --参考自<Oracle索引技术> 先贴上结论吧: 下面对以上几种操作分别测试: 创建测试表及索引 --创建测试分区表 CREATE TABLE employees_parttest (e ...

  4. Oracle分区之五:创建分区索引总结

    分区索引总结: 一,分区索引分为2类: 1.global,它必定是Prefix的.不存在non-prefix的 2.local,它又分成2类:    2.1.prefix:索引的第一个列等于表的分区列 ...

  5. oracle删表分区同时维护索引,有关Oracle表分区进行(DML)维护后对索引的影响的分析...

    对索引的几种情况分别进行总结:1.如果删除分区,则会导致该表下所有的索引状态处于不可用状态(除本地前缀索引外):2.如果重命名表,同上3.如果truncate分区数据,同上:4.重命名分区,不会对索引 ...

  6. oracle分区唯一索引,关于分区表与唯一索引的测试记录

    关于分区表与唯一索引的测试记录 SQL> connect eygle/eygle Connected. SQL> CREATE TABLE docinfo( 2  docid    NUM ...

  7. oracle范围分区合并,ORACLE 范围分区 partition-range分区

    范围分区的用法说明 Range partitioning maps data to partitions based on ranges of partition key values that   ...

  8. oracle 10g 分区管理,Oracle 10g分区表的自动维护

    Oracle 10g分区表不支持自动化管理,一般都要手动创建分区,手动删除.今天给大家带来了一个自动化管理表空间的脚本. 本脚本主要由3个部分组成:sys_ConfigTable.sql.sys_pr ...

  9. oracle sql 分区查询语句_Oracle 分区概述

    一. 概念 分区是将一个表或者索引物理地分解成多个更小的部分.对于访问数据库的应用来看,逻辑上看只有一个表或者索引,因为访问和普通表或索引一模一样.但物理上这个表可能被分成了数十个独立的分区,每一个分 ...

最新文章

  1. Python 比较俩张图片差异
  2. 21个令程序员泪流满面的瞬间
  3. python 制作高斯mask_【趣味案例】用Python制作各种酷炫词云图,原来这么简单!...
  4. 印象笔记电脑版使用技巧_我的印象笔记使用手册(2020)
  5. Xilinx IP解析之Processor System Reset v5.0
  6. Debian 忘记root密码的处理(passwd:command not found)
  7. python 输出引号_python输出字符串单双引号如何选择
  8. Python应用03 使用PyQT制作视频播放器
  9. Nodejs中获取get请求传过来的参数_note
  10. c语言直流电机控制实验报告,直流电机实验报告.docx
  11. ImportError: No module named ‘BaseHTTPServer‘:解决方案
  12. hitool备份3798固件方法_创维E900s海思3798芯片当贝桌面不拆机通刷固件及刷机教程201910版...
  13. C++标准库分析总结(一)
  14. LeetCode之SQL练习:第二高薪
  15. 将视频设置为电脑动态桌面的方法
  16. 纠正英语语法错误---Grammarly安装
  17. Qt应用程序嵌入浏览器的常用方法
  18. java 循环依赖_Java详解之Spring Bean的循环依赖解决方案
  19. md文件的简洁打开方式
  20. 2017面向对象程序设计(Java)第十五周学习总结

热门文章

  1. mx250 计算能力_MX250与GTX1050对比:参数规格、性能差距,详细解读
  2. Stars in Your Window 【POJ - 2482】【线段树扫描线】
  3. 无法打开这个应用,查看Microsoft store, 了解有关Nahimic的详细信息
  4. java编程成绩评分分等级_java编写成绩等级,最高分为best
  5. 【例16 Java从键盘读入学生成绩,找出最高分,并输出学生成绩等级】
  6. css 设置 多行超出 显示为 省略号 ,可 多行超出 显示为 省略号
  7. 论文翻译:2022_PACDNN: A phase-aware composite deep neural network for speech enhancement
  8. 【ArcGIS】空间表无法删除的问题处理
  9. 数据产品经理类型划分和工作汇报框架
  10. Springcloud入门第二篇