周末作了一天的Partitioned Table旧有资料的归档。
主要是用Partitioned Table的Exchange功能。
基本步骤:
1. 构造能用来做exchange的table A。
2. 进行exchange
3. 将segments从物理上转移到归档用的tablespace.
4. Drop 被exchange出的Partition
5. 被drop 的Partition的Tablespace—〉drop
6. Rebuild A中被mark unusable的Index.
Exchange是Partitioned Table 技术中一个非常有用的功能,尤其是当需要将旧资料进行归档的时侯。
Exchange的限制:
Range-Hashßà hash
Range-Listßà List
Range/HASH/LIST ßànon-partitioned table
.. .. ..
以上是9i administrator guides 归类出来的,简而言之,就是Partitioned Table中要用来做exchange的Partition的类型必须和所交换的Table(Partition)一致。
所以在第一步构造用来做exchange的Table的时侯,类型的一致很重要。
比如,如果是Range-Hash Partitioned table要把一个Range Partition exchange出来,那用来交换的Table必须和这个Range Partition 类型一致。
也就是说这个Table必须是Hash Partitioned Table.
进行Exchange的语法:
Illustrate:
alter table Part_table exchange partition Part_0710
with table Part_arch0710
including indexes without validation update global indexes;
几个重点
1. Including indexes: 表明将Local indexes 一同exchange出来。此选项需要用来与之exchange的table 有建立一样的Index.
2. Without validation: with validation是验证是否rows被正确的Mapping. Without validation则是跳过此验证,在这种情况下,exchange 只做data dictionary的更新(这也是exchange快的原因,因为它根本上只是在data dictionary里将segments的归属作了变更)。这里有一个例外,如果在exchange中的table有PK或者unique constraint,是会强制作with validation,不管有没有指定without validation,这样做是为了保证constraint的完整性。如果要避免这个问题,可以在exchange之前先disable相关的constraint,在完成后再enable。
3. Update global indexes:使用此选项可避免Partitioned table的global index在exchange后被mark unusable。用这种方式在功能上不会影响到正常业务,但其过程中产生的额外loading会对业务性能的表现产生影响。如果不使用此选项,则必须在exchange后对global index进行rebuild。不过这个选项只会update被exchange出Partition的table的global index。如上的例子,表A的global index是不会被update,所以如果接下来exchange出的Partition的资料还要用的话,依然需要rebuild,但这已经不影响正常业务。
4. Drop 被exchange出来的Partition所在的Tablespace之前,注意把segments从物理上移动到归档Table A所在的Tablespace。上文提到了exchange只是在data dictionary里对segments的归属作了改变。
5. Exchange后,空的Partition可以直接DROP,无须带update global index。
分享到:
相关推荐
oracle partition table: range partitioned table. list partitioned table; hash partitioned table
专门介绍sql server 2008分区表和索引策略。
分区的 分区分区为ActiveRecord添加了帮助,以操纵(读取,创建,更新)ActiveRecord模型,该模型表示可能位于许多数据库表之一中的数据... 还通过Partitioned :: Base.create_many和Partitioned :: Base.update_man
第十四讲:oracle Partitioned Tables and Indexes管理 第十五讲:oracle view管理 第十六讲:oracle sequences管理 第十七讲:oracle 触发器管理 第十八讲:oracle 用户管理 第十九讲:oracle 安装部署管理
NULL 博文链接:https://ylzhj02.iteye.com/blog/2051729
ERROR 1505 <HY000> Partition management on a not partitioned table is not possible 正确的方法是新建一个具有分区的表,结构一致,然后用insert into 分区表 select * from 原始表; 测试创建分区表文件 代码...
Speed up the execution of important database...Chapter 6: Partitioned Indexes Chapter 7: Tuning Index Usage Chapter 8: Maintaining Indexes Chapter 9: SQL Tuning Advisor Chapter 10: In-Memory Column Store
Table of Contents Chapter 1. Introduction to Oracle Indexes Chapter 2. B-Tree Indexes Chapter 3. Bitmap Indexes Chapter 4. Index-organized Tables Chapter 5. Specialized Indexes Chapter 6. Partitioned ...
Embedded Linux in a Partitioned Architecture for Aerospace Applications
oracle官方的学习资料,中英文对照 目录如下: 第一部分 何为 Oracle? Chapter 1, Introduction to the Oracle Database 第 1 章,Oracle 数据库简介 Part II Oracle Database Architecture 第二部分 Oracle ...
数据库分区是一种物理数据库设计技术。其主要目的是为了在特定的SQL操作中减少数据读写的总量以缩减sql语句的响应时间,同时对于应用来说分区完全是透明的。 数据库性能的提升和简化数据管理,在扫描操作中MySQL优化...
Oracle 10g r2 Concepts 手册是一个很好的学习 Oracle 的起点,涉及到了你所需要知道的许多重要 Oracle 概念。当然,其中不可能会涵盖每一个技术细节(Oracle 文档提供了技术细节,不过它有 10000 ~ 20000 页),...
Oracle Concepts中英文对照版(10g R2).chm <br>Part I What Is Oracle? 第一部分 何为 Oracle? Chapter 1, Introduction to the Oracle Database 第 1 章,Oracle 数据库简介 Part II Oracle Database ...
第一部分 何为 Oracle? Chapter 1, Introduction to the Oracle Database 第 1 章,Oracle 数据库简介 Part II Oracle Database Architecture 第二部分 Oracle 数据库体系结构 Chapter 2, Data Blocks, Extents,...
I first met the Oracle RDBMS some time in 1988, or possibly 1987, when my manager dumped a small box on my desk and said something like: “There’s this new product called Oracle just coming into the...
Oracle Concepts 中文版 (10g R2) 订阅 RSS <br>-------------------------------------------------------------------------------- <br> Part I What Is Oracle? 第一部分 何为 Oracle? ...
is_partitioned_until
Part I What Is Oracle? 第一部分 何为 Oracle? Chapter 1, Introduction to the Oracle Database 第 1 章,Oracle 数据库简介 Part II Oracle Database Architecture 第二部分 Oracle 数据库体系结构 Chapter 2, ...
Oracle Concepts官方文档,中英文对照版,oracle数据库入门的好材料,不论是从事ORACLE数据库管理还是ORACLE应用开发,都应该读一读。 Part I What Is Oracle? 第一部分 何为 Oracle? Chapter 1, Introduction ...
运行脚本首先,克隆这个 repo 或 : $ git clone https://github.com/dschwertfeger/partitioned-hash-join.git 然后,切换到目录: $ cd partitioned-hash-join 确保脚本是可执行的: $ chmod +x partitioned_hash_...