oracle分区表导入导出

把生产环境的备份拿到公司,搭建测试环境。

分区表恢复方法:

1:正常使用expdp导出数据

2:使用Impdp导入数据,方法:

impdp itsm_sac/itsm directory=itsm dumpfile=itsm-2013-11-28-10-22.dmp logfile=12-24.log  partition_options=merge

这样的结果,分区表会回退到正常的表


impdp itsm_sac/itsm directory=itsm dumpfile=itsm-2013-11-28-10-22.dmp logfile=12-24.log  partition_options=none



这样的结果:需要创建生产环境分区的表空间,然后导入的表和生产环境一样,都是分区表



得出结论:如果生产库的数据崩溃了,把数据备份拿出来

在备份库上创建分区表对应的表空间,使用impdp导入备份库,导入参数加入一个partition_options=none,这样就OK了


oracle data pump在导入分区表的时候有三个选项:


Specifies how table partitions should be created during an import operation.

Syntax and Description

PARTITION_OPTIONS={none | departition | merge}


这样的意思是:none:会产生和生产环境一样的分区表,表的不同分区会放到不同分区对应的表空间里,需要在目标表空间中创建和生产环境相同的分区对应的表空间。

departition:不需要创建表空间,但是表的不同分区的名字会改变,会产生的东西是:

tablename_parition,这是新的表的名字:

A value of none creates tables as they existed on the system from which the export operation was performed. You cannot use the none option or the merge option if the export was performed with the transportable method, along with a partition or subpartition filter. In such a case, you must use the departition option.

A value of departition promotes each partition or subpartition to a new individual table. The default name of the new table will be the concatenation of the table and partition name or the table and subpartition name, as appropriate.

A value of merge combines all partitions and subpartitions into one table.

merge:数据泵导入的信息会回退到普通的表中。

你可能感兴趣的:(oracle,partition,分区表导入导出)