2018年怎么做网站排名,custom post type wordpress,wordpress 页脚改颜色,中国五大门户网站Oracle 的分区是一种“分而治之”的技术#xff0c;通过将大表、索引分成可以独立管理的、小的 Segment#xff0c;从而避免了对每个对象作为一个大的、单独的 Segment 进行管理#xff0c;为海量数据访问提供了可伸缩的性能。自从 Oracle 引入分区技术以来#xff0c;Orac…Oracle 的分区是一种“分而治之”的技术通过将大表、索引分成可以独立管理的、小的 Segment从而避免了对每个对象作为一个大的、单独的 Segment 进行管理为海量数据访问提供了可伸缩的性能。自从 Oracle 引入分区技术以来Oracle 公司在每次推出重要版本时都会对分区方法或功能上有所增强。从后面的分区方法中我们也可以清晰的看到 Oracle 分区技术的发展、成长历程。Oracle 公司一直在致力于不断完善分区技术确保满足所有的业务需求。
版本
新支持的分区方法
说明
7.3.x
逻辑分区/分区视图
◊在Oracle 8版本前DBAs和Consultants 根据系统需要实现了Home-Grown自产的/土生土长的分区方法他们借助UNION-ALL Views或Partition Views7.3开始提供的分区视图需要配合初始化参数PARTITION_VIEW_ENABLEDTRUE来使用Optimizer Prunes特性实现即使到今天如果不采购Oracle Database Enterprise Edition下的Partitioning Option License从许可上来讲也必须借助这种Home-Grown的方法来实现。 ◊这种方法对DML是不透明的
◊Partition Views in 7.3: Examples and Tests (文档 ID 43194.1)
8.0.x
Oracle 8.5 开始支持分区表/索引
首先提供范围分区(range)
1使Oracle成为了第一个支持物理分区的RDBMS供应商 2Oracle 8 仅支持表和索引级的分区 Clustered tables/indexes and snapshots are not supported 3Oracle 8中不可以update partition key columns否则会遇到ORA-14402错误 4只实现了静态的分区裁剪功能
5支持索引的Local and global Range
8i
新增加希分区(hash)
开始支持范围-哈希复合分区(range-hash)
8.1.7实现了动态智能裁剪Dynamic partition pruning和智能连接Partition-wise joins
9iR1
新增列表分区(list)
开始支持全局索引维护
1在9i(9.0.1)之前, IOT表只支持range分区,实际上是从8.1.5版本开始支持对IOT的range分区 2从9i开始支持对IOT的range、hash分区 3在9iR2 hash分区支持IOT表中包含lob列(9i中暂不支持包含lob类型的IOT hash 分区)
4支持Global index maintenance
9iR2
开始支持范围-列表复合分区(range-list)
1Fast Split 2DEFAULT Partition for LIST
10gR1
1增加了对索引组织表(IOT) 列表(list)分区功能 2增加了对全局分区索引的hash分区策略 310gR2开始一个表可以支持1024K-1个分区(以前是64K-1)
1扩展了global indexes on partitioned IOTs的维护支持 2Local partitioned bitmap indexes on partitioned IOTs 3LOB columns are now supported in all types of partitioned IOTs.
4fast split partition支持分区IOT表
10gR2
11g
Interval Partitioning
实现了范围分区的自动化
System Partitioning(系统分区)
在这个新的类型中我们不需要指定任何分区键数据会进入哪个分区完全由应用程序决定实际上也就是由SQL来决定终于我们在Insert语句中可以指定插入哪个分区了
More Composite Partitioning (更多的复合分区)
在9i、10g中,复合分区只支持Range-List和Range-Hash 在11gR1中复合分区的类型大大增加现在RangeListInterval都可以作为Top level分区而Second level则可以是RangeListHash也就是在11gR1中可以有3*39种复合分区可以满足更多的业务需要. 在11gR2中又增加了hash-hash复合分区
Reference Partitioning(外键也叫引用分区)
分区方案的引入是以相关表格通过相同的分区策略获得好处作为前提设想的。Detail表格通过PK-FK关系从master表格继承相同的分区方案.我们不需要把分区键存储在detail表格中通过关键词“PARTITION BY REFERENCEdetail表格获得master表格的分区方案
虚拟列分区(Virtual Column-Based Partitioning)
在11g之前只有分区键存在于表格中才可以实现对表格的分区功能。而Oracle 11g的新功能“虚拟列”打破了这一限制允许通过使用表格中的一列或多列的计算式作为分区键。
分区建议器
SQL Access Advisor 不但可以为索引、物化视图和物化视图日志提供建议还可以生成分区建议。执行 SQL Access Advisor 生成的建议您将会看到预期的性能收益。可以手动实施生成的脚本也可以将其提交给 Oracle Enterprise Manager 中的一个队列。借助分区建议扩展客户不仅可以获得专门针对分区的建议还可以获得 SQL Access Advisor 的更全面的整体建议从而在总体上提高 SQL 语句的整体性能。
Partition Advisor 已集成到 SQL Access Advisor 中是 Oracle Tuning Pack一个额外的许可选件的组成部分。
12cR1
Online Partition 维护
1在线移动、压缩分区或子分区不阻赛DML操作 alter table sales move partition p1 tablespace lowtbs update indexes online; alter table sales move partition p1 ROW STORE COMPRESS BASIC update indexes online; alter table sales move partition p1 ROW STORE COMPRESS ADVANCED update indexes online; alter table sales move partition p1 COLUMN STORE COMPRESS FOR QUERY LOW update indexes online; alter table sales move partition p1 COLUMN STORE COMPRESS FOR QUERY HIGH update indexes online; alter table sales move partition p1 COLUMN STORE COMPRESS FOR ARCHIVE LOW update indexes online; alter table sales move partition p1 COLUMN STORE COMPRESS FOR ARCHIVE HIGH update indexes online; select table_name,compression,compress_for from dba_tables; select table_name,partition_name, compression,compress_for from dba_tab_partitions; 参见示例
2Restrictions on the ONLINE Clause --详见官方文档里的说明 1不支持sys用户下表 2不支持索引组织表(IOT) 3不支持包含对象类型或bitmap join indexes以及domain indexes的表 4当打开database-level supplemental logging 时不支持online维护 5Parallel DML and direct path INSERT operations require an exclusive lock on the table. 所以, these operations are not supported concurrently with an ongoing online partition MOVE, due to conflicting locks.
Reference Partitioning的增强
1支持Interval-Reference分区 2提供truncate partition、exchange [SUB]partition操作的CASCADE级联选项
多分区维护操作
add/truncate/drop/split/merge分区操作允许在一个操作中一次操作多个分区
部分索引
Local和Global indexes可以在部分分区上创建这个特性(Partial Indexing on Partitioned Tables)是通过表表上的indexing属性来控制的。注意部分索引不能创建全局唯一索引。
全局索引异步维护
1对于Drop和Truncate Parition 操作支持异步维护全局索引Update Indexes字句仅仅维护metadata真正的索引维护是通过一个JOBSYS.PMO_DEFERRED_GIDX_MAINT_JOB异步完成的。缺省情况下该job是每天凌晨2:00执行也可手工调用dbms_part.cleanup_gidx来完成 PROCEDURE CLEANUP_GIDX - To clean up the global indexes PROCEDURE CLEANUP_GIDX_INTERNAL - To clean up the internal tables PROCEDURE CLEANUP_ONLINE_OP - To clean up the online partition movements
2DBA_INDEXES 和DBA_IND_PARTITIONS新增加了ORPHANED_ENTRIES列。该列用来指出whether or not a global index (partition) contains stale entries due to deferred index maintenance during DROP/TRUNCATE PARTITION, or MODIFY PARTITION operations. 有三种取值 YES: The index (partition) contains orphaned entries NO: The index (partition) does not contain any orphaned entries N/A: The property is not applicable – this is the case for local indexes, or indexes on non-partitioned tables.
12cR2
Multi-Column List Partition
1)12.2.0.1.0开始支持最大16个列
2)支持分区和子分区
3)支持heap tables、external tables
4)支持Reference Partitioning and Auto-List
Auto-List Partitioning
1)实现了list分区的自动化管理类似11g版本开始支持的Interval Partitioning
2)没有default分区必须至少指定一个分区
3)系统自动增加的分区会自动命名
4)list分区到Auto-List可以转换前提是List分区表定义上没有DEFAULT分区
Interval Subpartioning
1) 从11g版本中开始支持的Interval Partitioning技术不支持子分区从12cR2版本开始支持。
2) Interval Subpartioning和Interval Partitioning的使用条件及要求是一样的如 --没有MAXVALUE --没有Add Partition
3) Interval-subpartitoning strategy set at table level --Subpartiton template mandatory --Interval identical for all partitions
4) 每个表最大100万个[sub]partitions --From one partition with one million subpartitions .. --..To one million partitions with one subpartition each
Partitioned External Tables
Partitioned external tables will provide both the functionality to map partitioned Hive tables into the Oracle ecosystem as well as providing declarative partitioning on top of any Hadoop Distributed File System (HDFS) based data store.
分区与Sharding
–数据垂直分区到多个独立的数据库中 –线性扩展 –自动部署 –支持HASH、RANGE、LIST和复合方式的自动数据分区 –自动Rebalance和Resharding
分区表相关维护维护方面的增强
Online分区维护(DDL)的
11g
Create index Add column Add constraint
12cR1
Drop index Drop Constraint Alter table set unused column Alter table move partition
12cR2
Alter table modify non-partitioned table to partitioned table Alter table move online for heap tables
Alter table split partition online
Filtered分区维护操作
该特性允许我们在维护Move/merge/split分区表的时候进行数据过滤
alter table orders_move_part move partition Q1_2015 tablespace tbs_archive compress INCLUDE ROWS where order_stateopen;
快速创建分区交换中间表
Oracle Database 12c 第 2 版中的FOR EXCHANGE WITH子句消除了分区交换的检测性工作Indexes are not created as part of this command. eg:
create table sales_exch for exchange with sales;
只读分区
分区/子分区可以被设置为read only或read write(default)。
注意只读分区不允许drop但对应的base table是可以被drop的所以不要寄望于这个做更加级别的安全保护还是要配合权限和其他安全措施来保护。
tips这样从12cR2/18c开始可以做到Service-Oracle_Home-Instance--PDB-Tablespace -Table/MV/外部表-Partition-subpartition等各个级别的只读设置配合对象只读权限(read)、系统只读权限read any table)及Schema Only Accounts等特性可以满足各个层次的数据保护需求。
18c
18.1.0
Enhanced Parallel Partition-wise Operations
参见这里
· Partition-Wise Operations
· Partition-Wise Joins in a Data Warehouse
相关知识Partition-Wise Operations – New Features in 12c and 18c
Modifying the Partitioning Strategy 参见这里的文档说明。
Online Merging of Partitions and Subpartitions
这是18c(18.1.0)中针对分区技术的一个很酷的改进在不影响业务的情况下可以在线合并分区或子分区。参见这里的文档说明。
19c
19.2
Hybrid partitioned tables--混合分区表