分区表的导入导出

Oracle-大表改造分区表实施步骤 对于业务交易繁忙的数据库,在运行了一定时间后往往会产生一些数据量较大的表,特别是对于每天新增数据较多的日志表或者流水表,单表数据量通常会达到几十G,甚至是上百G。大表对于日常的运维非常的不方便,特别是在表数据的清理、迁移,查询性能会随着数据量的增大而受到影响,因此,通常对于大表我们需要进行优化拆分,在Oracle数据库,比较常见的大表优化拆分是将大表改造为分区表,这种方式最主要的好处就是对于应用透明,应用层面的改动很少 阅读详情

一、分区级别的导入导出

    可以导出一个或多个分区,也可以导出所有分区(即整个表)。

    可以导入所有分区(即整个表),一个或多个分区以及子分区。

    对于已经存在数据的表,使用imp导入时需要使用参数IGNORE=y,而使用impdp,加table_exists_action=append | replace 参数。

 

二、创建演示环境

    1.查看当前数据库的版本

        SQL> select * from v$version where rownum < 2;

 

        BANNER

        --------------------------------------------------------------------------------

        Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

 

    2.创建一个分区表

        SQL> alter session set nls_date_format='yyyy-mm-dd';

 

        SQL> CREATE TABLE tb_pt (

        sal_date   DATE NOT NULL,

        sal_id NUMBER NOT NULL,

        sal_row    NUMBER(12) NOT NULL)

        partition by range(sal_date)

        (

        partition sal_11 values less than(to_date('2012-01-01','YYYY-MM-DD')) ,

        partition sal_12 values less than(to_date('2013-01-01','YYYY-MM-DD')) ,

        partition sal_13 values less than(to_date('2014-01-01','YYYY-MM-DD')) ,

        partition sal_14 values less than(to_date('2015-01-01','YYYY-MM-DD')) ,

        partition sal_15 values less than(to_date('2016-01-01','YYYY-MM-DD')) ,

        partition sal_16 values less than(to_date('2017-01-01','YYYY-MM-DD')) ,

        partition sal_other values less than (maxvalue)

        ) nologging;

 

    3.创建一个唯一索引

        CREATE UNIQUE INDEX tb_pt_ind1

        ON tb_pt(sal_date) nologging;

   

    4.为分区表生成数据

        SQL> INSERT INTO tb_pt

        SELECT TRUNC(SYSDATE)+ROWNUM, dbms_random.random, ROWNUM

        FROM dual

        CONNECT BY LEVEL<=5000;

 

        SQL> commit;

 

        SQL> select count(1) from tb_pt partition(sal_11);

 

          COUNT(1)

        ----------

               300

 

        SQL> select count(1) from tb_pt partition(sal_other);

 

          COUNT(1)

        ----------

              2873

 

        SQL> select * from tb_pt partition(sal_12) where rownum < 3;

 

        SAL_DATE      SAL_ID    SAL_ROW

        --------- ---------- ----------

        01-JAN-12 -1.356E+09        301

        02-JAN-12 -761530183        302

 

三、使用exp/imp导出导入分区表数据

    1.导出整个分区表

   

        [oracle@node1 ~]$ exp scott/tiger file='/u02/dmp/tb_pt.dmp' log='/u02/dmp/tb_pt.log' tables=tb_pt

        Export: Release 11.2.0.1.0 - Production on Wed Mar 9 13:52:18 2011

        Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

        Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

        With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

        Data Mining and Real Application Testing o

        Export done in US7ASCII character set and AL16UTF16 NCHAR character set

        server uses ZHS16GBK character set (possible charset conversion)

        About to export specified tables via Conventional Path ...

        . . exporting table                          TB_PT

        . . exporting partition                         SAL_11        300 rows exported

        . . exporting partition                         SAL_12        366 rows exported

        . . exporting partition                         SAL_13        365 rows exported

        . . exporting partition                         SAL_14        365 rows exported

        . . exporting partition                         SAL_15        365 rows exported

        . . exporting partition                         SAL_16        366 rows exported

        . . exporting partition                      SAL_OTHER       2873 rows exported

        EXP-00091: Exporting questionable statistics.

        EXP-00091: Exporting questionable statistics.

        Export terminated successfully with warnings.

       

        [oracle@node1 ~]$ oerr exp 00091

        00091, 00000, "Exporting questionable statistics."

        // *Cause:  Export was able export statistics, but the statistics may not be

        //          usuable. The statistics are questionable because one or more of

        //          the following happened during export: a row error occurred, client

        //          character set or NCHARSET does not match with the server, a query

        //          clause was specified on export, only certain partitions or

        //          subpartitions were exported, or a fatal error occurred while

        //          processing a table.

        // *Action: To export non-questionable statistics, change the client character

        //          set or NCHARSET to match the server, export with no query clause,

        //          export complete tables. If desired, import parameters can be

        //          supplied so that only non-questionable statistics will be imported,

        //          and all questionable statistics will be recalculated.

 

        在上面的导出中出现了错误提示,即EXP-00091,该错误表明exp工具所在的环境变量中的NLS_LANG与DB中的NLS_CHARACTERSET不一致

        尽管该错误对最终的数据并无影响,但调整该参数来避免异常还是有必要的。因此需要将其设置为一致即可解决上述的错误提示。

       

        SQL> select userenv('language') from dual;

 

        USERENV('LANGUAGE')

        ----------------------------------------------------

        AMERICAN_AMERICA.ZHS16GBK

 

        [oracle@node1 ~]$ export NLS_LANG='AMERICAN_AMERICA.ZHS16GBK'   

 

        经过上述设置之后再次导出正常,过程略。

 

    2.导出单个分区

 

        [oracle@node1 ~]$ exp scott/tiger file='/u02/dmp/tb_pt_sal_16.dmp' log='/u02/dmp/tb_pt_sal_16.log' tables=tb_pt:sal_16

        Export: Release 11.2.0.1.0 - Production on Wed Mar 9 13:52:38 2011

        Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

        Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

        With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

        Data Mining and Real Application Testing o

        Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set

        About to export specified tables via Conventional Path ...

        . . exporting table                          TB_PT

        . . exporting partition                         SAL_16        366 rows exported

        EXP-00091: Exporting questionable statistics.

        EXP-00091: Exporting questionable statistics.

        Export terminated successfully with warnings

 

        在上面的导出过程中再次出现了统计信息错误的情况,因此采取了对该对象收集统计信息,但并不能解决该错误,但在exp命令行中增

        加statistics=none即可,如下:

        [oracle@node1 ~]$ exp scott/tiger file='/u02/dmp/tb_pt_sal_16.dmp' log='/u02/dmp/tb_pt_sal_16.log' /

        > tables=tb_pt:sal_16 statistics=none

 

        如果要导出多个分区,则在tables参数中增加分区数。如:tables=(tb_pt:sal_15,tb_pt:sal_16)

 

    3.使用imp工具生成创建分区表的DDL语句

        [oracle@node1 ~]$ imp scott/tiger tables=tb_pt indexfile='/u02/dmp/cr_tb_pt.sql' /

        > file='/u02/dmp/tb_pt.dmp' ignore=y

        Export: Release 11.2.0.1.0 - Production on Wed Mar 9 13:54:38 2011

        Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

        Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

        With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

        Data Mining and Real Application Testing o

        Export file created by EXPORT:V11.02.00 via conventional path

        import done in US7ASCII character set and AL16UTF16 NCHAR character set

        import server uses ZHS16GBK character set (possible charset conversion)

        . . skipping partition "TB_PT":"SAL_11"                  

        . . skipping partition "TB_PT":"SAL_12"                  

        . . skipping partition "TB_PT":"SAL_13"                  

        . . skipping partition "TB_PT":"SAL_14"                  

        . . skipping partition "TB_PT":"SAL_15"                  

        . . skipping partition "TB_PT":"SAL_16"                  

        . . skipping partition "TB_PT":"SAL_OTHER"               

        Import terminated successfully without warnings.

 

    4.导入单个分区(使用先前备份的单个分区导入文件)

        SQL> alter table tb_pt truncate partition sal_16;   --导入前先将分区实现truncate

 

        Table truncated.

 

        SQL> select count(1) from tb_pt partition(sal_16);

 

          COUNT(1)

        ----------

                 0

 

        SQL> ho imp scott/tiger tables=tb_pt:sal_16 file='/u02/dmp/tb_pt_sal_16.dmp' ignore=y

        Export: Release 11.2.0.1.0 - Production on Wed Mar 9 13:55:39 2011

        Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

        Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

        With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

        Data Mining and Real Application Testing o

        Export file created by EXPORT:V11.02.00 via conventional path

        import done in US7ASCII character set and AL16UTF16 NCHAR character set

        import server uses ZHS16GBK character set (possible charset conversion)

        . importing SCOTT's objects into SCOTT

        . importing SCOTT's objects into SCOTT

        . . importing partition               "TB_PT":"SAL_16"

        IMP-00058: ORACLE error 1502 encountered

        ORA-01502: index 'SCOTT.TB_PT_IND1' or partition of such index is in unusable state

        Import terminated successfully with warnings.

 

        收到了ORA-01502错误,下面查看索引的状态,并对其重建索引后再执行导入

        SQL> select index_name ,status from dba_indexes where table_name='TB_PT';  --查看索引的状态

 

        INDEX_NAME                     STATUS

        ------------------------------ --------

        TB_PT_IND1                     UNUSABLE

 

        SQL> alter index TB_PT_IND1 rebuild online;                --重建索引

 

        Index altered.

 

        SQL> ho imp scott/tiger tables=tb_pt:sal_16 file='/u02/dmp/tb_pt_sal_16.dmp' ignore=y  --再次导入成功

        Export: Release 11.2.0.1.0 - Production on Wed Mar 9 13:56:15 2011

        Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

        Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

        With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

        Data Mining and Real Application Testing o

        Export file created by EXPORT:V11.02.00 via conventional path

        import done in US7ASCII character set and AL16UTF16 NCHAR character set

        import server uses ZHS16GBK character set (possible charset conversion)

        . importing SCOTT's objects into SCOTT

        . importing SCOTT's objects into SCOTT

        . . importing partition               "TB_PT":"SAL_16"        366 rows imported

        Import terminated successfully without warnings.

       

        SQL> select count(*) from tb_pt partition(sal_16);

 

          COUNT(*)

        ----------

               366

 

    5.导入整个表

        SQL> truncate table tb_pt;    --首先truncate 整个表

 

        Table truncated.

 

        SQL> ho imp scott/tiger tables=tb_pt file='/u02/dmp/tb_pt.dmp' ignore=y indexes=y

        Export: Release 11.2.0.1.0 - Production on Wed Mar 9 13:57:10 2011

        Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

        Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

        With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

        Data Mining and Real Application Testing o

        Export file created by EXPORT:V11.02.00 via conventional path

        import done in US7ASCII character set and AL16UTF16 NCHAR character set

        import server uses ZHS16GBK character set (possible charset conversion)

        . importing SCOTT's objects into SCOTT

        . importing SCOTT's objects into SCOTT

        . . importing partition               "TB_PT":"SAL_11"        298 rows imported

        . . importing partition               "TB_PT":"SAL_12"        366 rows imported

        . . importing partition               "TB_PT":"SAL_13"        365 rows imported

        . . importing partition               "TB_PT":"SAL_14"        365 rows imported

        . . importing partition               "TB_PT":"SAL_15"        365 rows imported

        . . importing partition               "TB_PT":"SAL_16"        366 rows imported

        . . importing partition            "TB_PT":"SAL_OTHER"       2875 rows imported

        Import terminated successfully without warnings.

       

        SQL> select count(1) from tb_pt partition(sal_other);

 

          COUNT(1)

        ----------

              2875

 

四、使用expdp/impdb来实现分区表的导入导出

    1.查看导入导出的目录设置

        SQL> select directory_name,directory_path from dba_directories where directory_name='DMP';

 

        DIRECTORY_NAME                 DIRECTORY_PATH

        ------------------------------ ------------------------------------------------------------

        DMP                            /u02/dmp

 

    2.为分区表创建一个本地索引

        create index tb_pt_local_idx

        on tb_pt(sal_id)

        local

        (partition local1,

        partition local2,

        partition local3,

        partition local4,

        partition local5,

        partition local6,

        partition local7)

        ;

 

    3.导出整个表

        [oracle@node1 ~]$ expdp scott/tiger directory=dmp dumpfile=tb_pt.dmp logfile=tb_pb.log tables=tb_pt parallel=3

        Export: Release 11.2.0.1.0 - Production on Wed Mar 9 14:04:28 2011

        Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

        Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

        With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

        Data Mining and Real Application Testing options

        Starting "SCOTT"."SYS_EXPORT_TABLE_01":  scott/******** directory=dmp dumpfile=tb_pt.dmp logfile=tb_pb.log tables=

            tb_pt parallel=3                                                                  

        Estimate in progress using BLOCKS method...

        Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

        Total estimation using BLOCKS method: 512 KB

        . . exported "SCOTT"."TB_PT":"SAL_OTHER"                 71.63 KB    2875 rows

        . . exported "SCOTT"."TB_PT":"SAL_11"                    12.54 KB     298 rows

        . . exported "SCOTT"."TB_PT":"SAL_12"                    14.22 KB     366 rows

        . . exported "SCOTT"."TB_PT":"SAL_13"                    14.18 KB     365 rows

        . . exported "SCOTT"."TB_PT":"SAL_14"                    14.18 KB     365 rows

        . . exported "SCOTT"."TB_PT":"SAL_15"                    14.19 KB     365 rows

        . . exported "SCOTT"."TB_PT":"SAL_16"                    14.23 KB     366 rows

        Processing object type TABLE_EXPORT/TABLE/TABLE

        Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT

        Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX

        Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

        Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

        Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded

        ******************************************************************************

        Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:

          /u02/dmp/tb_pt.dmp

        Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at 14:04:51

 

    4.导出多个分区

        [oracle@node1 ~]$ expdp scott/tiger directory=dmp dumpfile=tb_pts.dmp logfile=tb_pt.log /

        > tables=(tb_pt:sal_16,tb_pt:sal_other) parallel=2

        Export: Release 11.2.0.1.0 - Production on Wed Mar 9 14:08:06 2011

        Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

        Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

        With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

        Data Mining and Real Application Testing options

        Starting "SCOTT"."SYS_EXPORT_TABLE_01":  scott/******** directory=dmp dumpfile=tb_pts.dmp logfile=tb_pt.log

            tables=(tb_pt:sal_16,tb_pt:sal_other) parallel=2                        --*/

        Estimate in progress using BLOCKS method...

        Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

        Total estimation using BLOCKS method: 192 KB

        . . exported "SCOTT"."TB_PT":"SAL_OTHER"                 71.63 KB    2875 rows

        . . exported "SCOTT"."TB_PT":"SAL_16"                    14.23 KB     366 rows

        Processing object type TABLE_EXPORT/TABLE/TABLE

        Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT

        Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX

        Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

        Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

        Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded

        ******************************************************************************

        Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:

          /u02/dmp/tb_pts.dmp

        Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at 14:08:17

 

    5.截断分区sal_other

        SQL> alter table tb_pt truncate partition(sal_other);

 

        Table truncated.

 

        SQL> select count(*) from tb_pt partition(sal_other);

 

          COUNT(*)

        ----------

                 0

 

        SQL> select index_name,status,partitioned from dba_indexes where table_name='TB_PT'; --查看索引的状态, TB_PT_IND1不可用

 

        INDEX_NAME                     STATUS   PAR

        ------------------------------ -------- ---

        TB_PT_IND1                     UNUSABLE NO

        TB_PT_LOCAL_IDX                N/A      YES

       

        SQL> select index_name ,partition_name, status from dba_ind_partitions where index_owner='SCOTT';

       

        INDEX_NAME                     PARTITION_NAME                 STATUS

        ------------------------------ ------------------------------ --------

        TB_PT_LOCAL_IDX                LOCAL1                         USABLE

        TB_PT_LOCAL_IDX                LOCAL2                         USABLE

        TB_PT_LOCAL_IDX                LOCAL3                         USABLE

        TB_PT_LOCAL_IDX                LOCAL4                         USABLE

        TB_PT_LOCAL_IDX                LOCAL5                         USABLE

        TB_PT_LOCAL_IDX                LOCAL6                         USABLE

        TB_PT_LOCAL_IDX                LOCAL7                         USABLE

       

    6.导入单个分区

        [oracle@node1 ~]$ impdp scott/tiger directory=dmp dumpfile=tb_pts.dmp logfile=tb_pt_imp.log /

        > tables=tb_pt:sal_other skip_unusable_indexes=y table_exists_action=replace

        Import: Release 11.2.0.1.0 - Production on Wed Mar 9 14:13:28 2011

        Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

        Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

        With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

        Data Mining and Real Application Testing options

        Master table "SCOTT"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded

        Starting "SCOTT"."SYS_IMPORT_TABLE_01":  scott/******** directory=dmp dumpfile=tb_pts.dmp logfile=tb_pt_imp.log

            tables=tb_pt:sal_other skip_unusable_indexes=y table_exists_action=replace             --*/

        Processing object type TABLE_EXPORT/TABLE/TABLE

        Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

        . . imported "SCOTT"."TB_PT":"SAL_OTHER"                 71.63 KB    2875 rows

        Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT

        Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX

        Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

        Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

        Job "SCOTT"."SYS_IMPORT_TABLE_01" successfully completed at 14:13:33

 

        SQL> select index_name,status,partitioned from dba_indexes where table_name='TB_PT';

 

        INDEX_NAME                     STATUS   PAR

        ------------------------------ -------- ---

        TB_PT_IND1                     VALID    NO

        TB_PT_LOCAL_IDX                N/A      YES

       

        从上面的导入情况可以看出,尽管执行了truncate partition,然而使用impdp导入工具,并且使用参数table_exists_action=replace

        可以避免使用imp导入时唯一和主键索引需要重建的问题。注意,如果没有使用table_exists_action=replace参数,将会收到ORA-39151

        错误,如下

            ORA-39151: Table "SCOTT"."TB_PT" exists. All dependent metadata and data will be skipped due to

                table_exists_action of skip

 

    7.导入整个表

        [oracle@node1 ~]$ impdp scott/tiger directory=dmp dumpfile=tb_pt.dmp logfile=tb_pt_fullimp.log /

        > tables=tb_pt skip_unusable_indexes=y table_exists_action=replace

        Import: Release 11.2.0.1.0 - Production on Wed Mar 9 14:17:35 2011

        Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

        Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

        With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

        Data Mining and Real Application Testing options

        Master table "SCOTT"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded

        Starting "SCOTT"."SYS_IMPORT_TABLE_01":  scott/******** directory=dmp dumpfile=tb_pt.dmp logfile=tb_pt_fullimp.log

            tables=tb_pt skip_unusable_indexes=y table_exists_action=replace                     --*/

        Processing object type TABLE_EXPORT/TABLE/TABLE

        Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

        . . imported "SCOTT"."TB_PT":"SAL_OTHER"                 71.63 KB    2875 rows

        . . imported "SCOTT"."TB_PT":"SAL_11"                    12.54 KB     298 rows

        . . imported "SCOTT"."TB_PT":"SAL_12"                    14.22 KB     366 rows

        . . imported "SCOTT"."TB_PT":"SAL_13"                    14.18 KB     365 rows

        . . imported "SCOTT"."TB_PT":"SAL_14"                    14.18 KB     365 rows

        . . imported "SCOTT"."TB_PT":"SAL_15"                    14.19 KB     365 rows

        . . imported "SCOTT"."TB_PT":"SAL_16"                    14.23 KB     366 rows

        Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT

        Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX

        Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

        Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

        Job "SCOTT"."SYS_IMPORT_TABLE_01" successfully completed at 14:17:40

 

五、参数skip_unusable_indexes的作用

    SQL> show parameter skip

 

    NAME                                 TYPE        VALUE

    ------------------------------------ ----------- ------------------------------

    skip_unusable_indexes                boolean     TRUE

 

    该参数允许在导入分区数据时延迟对索引的处理,即先将数据导入,导入后再来重建索引分区。

    在命令行导入中未指定导入参数skip_unusable_indexes时,则对于索引相关的问题,根据数据库初始化参数的值来确定。

    在命令行导入中如果指定了参数skip_unusable_indexes时,则该参数的值优先于数据库初始化参数的设定值。

    skip_unusable_indexes=y对unique index不起作用,因为此时的unique index扮演者constraint的作用,所以在insert数据时index必须被

        更新。

    对于单个分区导入时PK,unique index的处理,必须先重建索引然后进行导入。

    使用impdp数据泵实现导入并使用参数table_exists_action=replace可以解决上述问题,即ORA-01502错误。

导入导出 Oracle 分区表数据 阅读详情

相关推荐

学习stm32H7之路开始(STM32H7系列1) 前期准备,HAL库框架

2020.01.07 几个重要的参考网址 1.电子工程世界网 http://tags.eeworld.com.cn/tags/STM32H7 链接: link. 2.转:https://blog.youkuaiyun.com/simon223/article/list/2?t=1 链接: link. ———————————————— 版权声明:本文为优快云博主「Simon223」的原创文章,遵循 CC 4....

kengkengkeng963的博客 3410

用EXPDP方法导出导入分区表

一、分区级别的导入导出     可以导出一个或多个分区,也可以导出所有分区(即整个表)。     可以导入所有分区(即整个表),一个或多个分区以及子分区。     对于已经存在数据的表,使用imp导入时需要使用参数IGNORE=y,而使用impdp,加table_exists_action=append | replace 参数。   示例:使用expdp/impdp   这种方法的步骤是: (1...

Data & Analysis 3695

从ST电机库到TI InstaSPIN:手把手对比两种主流FOC实现中的坐标变换差异

本文深入对比了ST电机库与TI InstaSPIN在FOC实现中的坐标变换差异,包括坐标系定义、变换系数和角度处理等关键点。针对BLDC和PMSM电机控制,提供了从理论到实践的移植方案,帮助工程师快速解决平台切换中的性能问题。特别解析了Clarke/Park变换在两种实现中的微妙差异及其对PI控制的影响。

weixin_28724661的博客 398

分区表的导入导出 expdp&impdp Oracle 11.2.0.4

分区表的导入导出

我的博客 1万+

ComfyUI-Impact-Subpack插件安装避坑指南:为什么你的UltralyticsDetectorProvider节点还是找不到?

本文深入解析了ComfyUI-Impact-Subpack插件的安装与排障问题,特别是针对UltralyticsDetectorProvider节点缺失的常见问题提供了详细的解决方案。从底层机制到高阶应用,涵盖了手动安装、模型配置、性能优化等关键步骤,帮助用户彻底解决插件依赖关系断裂问题。

Jerry的专栏 1152

ENVI5.6+SARscape实战:基于哨兵一号的PS与SBAS时序InSAR地表形变监测全流程解析

本文详细解析了使用ENVI5.6和SARscape软件基于哨兵一号数据进行PS与SBAS时序InSAR地表形变监测的全流程。从数据获取、预处理到PS-InSAR和SBAS-InSAR处理,提供了实用技巧和优化建议,帮助用户高效完成地表形变监测任务。

weixin_29245767的博客 1156

Oracle数据库expdp导出分区表异常缓慢问题分析

通过对问题的深入分析,明确了导致 expdp 导出分区表速度缓慢的主要原因是某个关键SQL语句的执行效率低下。针对这一问题提出了一系列优化措施,包括但不限于优化SQL执行计划、调整 expdp 参数设置以及对数据库补丁进行必要的升级。

安呀智数据坊的博客 1962

kali设置安装burpsuite中文版

工具:通过网盘分享的文件:Burpsuite 链接:提取码: jay1。

m0_74786138的博客 5202

Oracle 数据泵导入导出分区表及避坑指南

Oracle 数据泵导入导出分区表及避坑指南 分区表的导入导出 首先根据emp表创建一个分区表,emp表如下: SCOTT@dborcl1> alter session set nls_date_format='YYYY-MM-DD HH24:MI:SS'; SCOTT@dborcl1> desc emp; Name Null? Type ------------------------------------------------------------

ChunkWen的博客 3680

Far planner 代码系列(14)

MatchContourWithNavGraph(3) this->EnclosePolygonsCheck(); //可能有些ctnode的is_contour_necessary属性变成了true // 这说明我的contour_graph是一个local层级的 才会从这里面 get new vertices new_convex_vertices.clear(); //! 把contour_graph_里符

博客 900

【即插即用模块】Transformer篇 | TCSVT 2025 | DAFM:双注意力聚合+反向跨模态筛选,特征精准捕捉并融合!

本文提出了一种双模态注意力融合模块(DAFM),用于增强多模态图像融合任务中的特征交互。该模块通过双注意力聚合机制,结合自注意力与跨模态注意力,有效提升特征融合效果。DAFM采用可学习平衡因子动态调整注意力权重,并运用深度卷积降低计算复杂度。实验结果表明,该模块能显著提升多模态图像融合质量,适用于RGB-红外等双模态视觉任务。模块代码实现简洁,可直接集成到现有网络中作为特征融合层使用。

主要更新底层视觉(去噪、超分等)相关的科研内容,形式为【论文精读】+【论文复现】 176

对分区表导入导出的水平,垂直切分

在工作中有时候碰到一些分区表,业务数据量很大,可能几百G,上T的规模,而且做数据的导入导出的时候,会感觉到exp/expdp的时候生成的dump文件太大了,做导入的时候也是很重的负担。比如500G的dump,你在使用imp做导入的时候,别无选择,只能看着日志里partition里的数据一个一个被导入。impdp可能稍微好点,还能指定个并行,但是问题又来了,一个500G的dump。impdp是在最后

小二 754

【WRFDA教程】客观分析(OBSGRID)详解

客观分析(OBSGRID)详解

WW、forever的博客 1133
上一篇: 数据库数据文件转移方法1
下一篇: any,some,all的用法和区别
201609
博客等级 码龄10年 5粉丝 11原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值