[英]Oracle SQL - Import data from non-partitioned (regular table) into an empty partitioned table using expdp/impdp
Oracle version - 12.2.0.1 OS version - 7.1 Exadata box. Oracle 版本 - 12.2.0.1 操作系统版本 - 7.1 Exadata 盒。
I have a table with 5 million rows into a regular table (non-partitioned) and my client has created an empty structure of the above table (partitioned by date).我有一个包含 500 万行的表进入常规表(未分区),我的客户创建了上述表的空结构(按日期分区)。 Now, he wants to export(expdp) the data from original table (non-partitioned) and import (impdp) into the partitioned table and wants the data to go into the partitions accordingly.
现在,他想将原始表(非分区)中的数据导出(expdp)并导入(impdp)到分区表中,并希望将 go 的数据相应地放入分区中。 Is this achievable?
这是可以实现的吗?
Please let me know if this is achievable through any method?请让我知道这是否可以通过任何方法实现?
Thank you,谢谢,
A normal datapump with TABLE_EXISTS_ACTION=APPEND will take care of it assuming the table has already been created in the target schema.假设已经在目标模式中创建了表,则具有 TABLE_EXISTS_ACTION=APPEND 的普通数据泵将处理它。
If you have a table that is already loaded and is unpartitioned, there is the 'alter table' option as mentioned, which lets you define the partitionined schema for both table and indexes, and do it online如果您有一个已加载且未分区的表,则可以使用前面提到的“alter table”选项,它允许您为表和索引定义分区模式,并在线执行
SQL> alter table T modify
2 partition by range (object_id) interval (10000)
3 (
4 partition p1 values less than (20000)
5 ) online
6 update indexes
7 ( ix local,
8 ix2 global partition by range (created)
9 (
10 partition ix2_p1 values less than (date '2016-08-01'),
11 partition ix2_p2 values less than (maxvalue)
12 )
13 );
Table altered.
I'm confused, you use the tag oracle10g, but mention 12.2 in the question?我很困惑,您使用标签 oracle10g,但在问题中提到 12.2?
Yes, this will work, on two conditions:是的,这将在两个条件下起作用:
It is clear into which partition each row will be sorted.很清楚每一行将被排序到哪个分区。 Unless you use system partitioning (
PARTITION BY SYSTEM
), that should be fine.除非您使用系统分区(
PARTITION BY SYSTEM
),否则应该没问题。
All the necessary partitions do exist.所有必要的分区确实存在。 Either your client uses interval partitions (for instance
PARTITION BY RANGE (my_date) INTERVAL (NUMTOYMINTERVAL(1,'MONTH'))
), or they set up partitions to cover all dates in the unpartitioned table.您的客户端要么使用间隔分区(例如
PARTITION BY RANGE (my_date) INTERVAL (NUMTOYMINTERVAL(1,'MONTH'))
),要么他们设置分区以覆盖未分区表中的所有日期。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.