用impdp导入数据的一次经历



同事给我发来了windows 平台下的三个 VEASMS__01.DMP,VEASMS__02.DMP,VEASMS__03.DMP文件,让我导入linux中的10g oracle中,我看了他给我发过来导出的日志文件,如下:

连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
启动 "VEBACKUP"."2015-01-05":  vebackup/******** directory=DATABAK_DIRdumpfile=veasms__01.DMP,veasms__02.DMP,veasms__03.DMP SCHEMAS=veasms parallel=3 job_name=2015-01-05 logfile=veasms_.log 
正在使用 BLOCKS 方法进行估计...
处理对象类型 SCHEMA_EXPORT/TABLE/TABLE_DATA
使用 BLOCKS 方法的总估计: 4.968 GB

通过上图标红色字部分,我知道了他用的是expdp导出的,于是我在我的10g数据库中用如下方法进行导入:

1、将VEASMS__01.DMP,VEASMS__02.DMP,VEASMS__03.DMP放入/data/exp目录下。

2、
SQL> create directory DATABAK_DIR as '/data/exp'

3、
SQL> grant dba to VEASMS identified by oracle;

4、
SQL> grant read,write on directory DATABAK_DIR to veasms;

5、
[root@localhost exp]# cat impdp.txt 
userid=veasms/oracle
directory=DATABAK_DIR
job_name=2015-01-05
SCHEMAS=veasms
dumpfile=VEASMS__01.DMP,VEASMS__02.DMP,VEASMS__03.DMP
logfile=veasms_1.log


6、
[oracle@localhost exp]$ impdp parfile=/data/exp/impdp.txt 

Import: Release 10.2.0.1.0 - Production on Monday, 05 January, 2015 21:54:22

Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Master table "VEASMS"."2015-01-05" successfully loaded/unloaded
Starting "VEASMS"."2015-01-05":  parfile=/data/exp/impdp.txt 
Processing object type SCHEMA_EXPORT/USER
ORA-31684: Object type USER:"VEASMS" already exists
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TYPE/TYPE_SPEC
Processing object type SCHEMA_EXPORT/DB_LINK
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
 imported "VEASMS"."T_PT_LOG_HISTORY"                 890.7 MB  124593 rows
. . imported "VEASMS"."T_PT_LOG"                         185.8 MB   27304 rows
. . imported "VEASMS"."TICKET_ALL_LOG"                   276.1 MB  415247 rows
. . imported "VEASMS"."PNR_ERROR"                        219.1 MB   75749 rows
. . imported "VEASMS"."BB_ERROR"                         218.3 MB  331832 rows
. . imported "VEASMS"."JP_ZC_NFD":"P_3"                  65.85 MB   28534 rows
. . imported "VEASMS"."YS_ERROR"                         150.9 MB  151424 rows
. . imported "VEASMS"."KH_KHDDCHANGERECORD"              154.7 MB  480884 rows
. . imported "VEASMS"."HKGS_ALL_HB"                      128.3 MB  432781 rows
. . imported "VEASMS"."KH_KHDDCJR_LOG"                   122.7 MB  423674 rows
. . imported "VEASMS"."TICKET_EXTEND_LOG"                90.85 MB  309660 rows
. . imported "VEASMS"."TRAIN_CC_PJ"                      82.89 MB 1322864 rows
. . imported "VEASMS"."KH_KHDD_EXTEND_LOG"               79.73 MB  226916 rows
. . imported "VEASMS"."JD_WBFX"                          55.84 MB  405884 rows
. . imported "VEASMS"."TICKET_ALL"                       66.63 MB  103658 rows
. . imported "VEASMS"."JD_FX"                            55.22 MB  296340 rows
. . imported "VEASMS"."JD_JDB"                           48.79 MB   51183 rows
. . imported "VEASMS"."KH_KHDD"                          52.87 MB   75197 rows
. . imported "VEASMS"."TICKET_CHANGERECORD"              53.87 MB  208448 rows
. . imported "VEASMS"."ZC_ERROR"                         51.65 MB  383815 rows
. . imported "VEASMS"."B_AIRWAY_CW_HC"                
Processing object type SCHEMA_EXPORT/PACKAGE/COMPILE_PACKAGE/PACKAGE_SPEC/ALTER_PACKAGE_SPEC
Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION
ORA-39082: Object type ALTER_FUNCTION:"VEASMS"."F_GET_HCBZ" created with compilation warnings
ORA-39082: Object type ALTER_FUNCTION:"VEASMS"."F_HXYJ_CHANG" created with compilation warnings
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
ORA-39082: Object type ALTER_PROCEDURE:"VEASMS"."P_LQL_YYB_WC" created with compilation warnings
ORA-39082: Object type ALTER_PROCEDURE:"VEASMS"."PROC_TFD_TJ_CW" created with compilation warnings
ORA-39082: Object type ALTER_PROCEDURE:"VEASMS"."PROC_TICKET_PH" created with compilation warnings
ORA-39082: Object type ALTER_PROCEDURE:"VEASMS"."PROC_OPTIMIZE_INDEX" created with compilation warnings
ORA-39082: Object type ALTER_PROCEDURE:"VEASMS"."PROC_SYNC_INDEX" created with compilation warnings
ORA-39082: Object type ALTER_PROCEDURE:"VEASMS"."PROC_INIT_QW" created with compilation warnings
ORA-39082: Object type ALTER_PROCEDURE:"VEASMS"."PROC_CLOB_QW" created with compilation warnings
ORA-39082: Object type ALTER_PROCEDURE:"VEASMS"."PROC_COMPARE_SOURCE" created with compilation warnings
ORA-39082: Object type ALTER_PROCEDURE:"VEASMS"."PROC_COMPARE_TABLE" created with compilation warnings
Processing object type SCHEMA_EXPORT/VIEW/VIEW
Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_BODY
ORA-39082: Object type PACKAGE_BODY:"VEASMS"."PKG_ZC" created with compilation warnings
ORA-39082: Object type PACKAGE_BODY:"VEASMS"."PKG_ZC_5000" created with compilation warnings
ORA-39082: Object type PACKAGE_BODY:"VEASMS"."PKG_ZC_OLD" created with compilation warnings
ORA-39082: Object type PACKAGE_BODY:"VEASMS"."PKG_ZZ_5000" created with compilation warnings
ORA-39082: Object type PACKAGE_BODY:"VEASMS"."PKG_ZZ_5000_NEW" created with compilation warnings
ORA-39082: Object type PACKAGE_BODY:"VEASMS"."PKG_DATA_MODIFY" created with compilation warnings
ORA-39082: Object type PACKAGE_BODY:"VEASMS"."PKG_LY_PZ" created with compilation warnings
ORA-39082: Object type PACKAGE_BODY:"VEASMS"."PKG_QUERY_NEW_5000" created with compilation warnings
Processing object type SCHEMA_EXPORT/JAVA_SOURCE/JAVA_SOURCE
Processing object type SCHEMA_EXPORT/JAVA_CLASS/JAVA_CLASS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
ORA-39082: Object type TRIGGER:"VEASMS"."T_LJ_B_PC_OUT_ADD" created with compilation warnings
ORA-39082: Object type TRIGGER:"VEASMS"."TRIG_UPDATE_PZ_RETURN" created with compilation warnings
ORA-39082: Object type TRIGGER:"VEASMS"."TRIG_UPDATE_PZ_KHDD" created with compilation warnings
ORA-39082: Object type TRIGGER:"VEASMS"."TRIG_UPDATE_BXDD" created with compilation warnings
ORA-39082: Object type TRIGGER:"VEASMS"."TRIG_T_PTBJ_JCSZ" created with compilation warnings
ORA-39082: Object type TRIGGER:"VEASMS"."TRIG_T_PTBJ_JCSZ" created with compilation warnings
ORA-39082: Object type TRIGGER:"VEASMS"."TRIG_RETURN_PS" created with compilation warnings
ORA-39082: Object type TRIGGER:"VEASMS"."TRIG_GSY_UPDATE_BC_KHDD" created with compilation warnings
Processing object type SCHEMA_EXPORT/TABLE/INDEX/FUNCTIONAL_AND_BITMAP/INDEX
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/INDEX/DOMAIN_INDEX/INDEX
ORA-39083: Object type INDEX failed to create with error:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-50857: oracle error in drvxtab.create_index_tables
ORA-00955: name is already used by an existing object
Failing sql is:
CREATE INDEX "VEASMS"."IDX_LY_XL_QW" ON "VEASMS"."LY_XL_QW" ("QW")  INDEXTYPE IS "CTXSYS"."CONTEXT" PARAMETERS ('DATASTORE CTXSYS.DIRECT_DATASTORE FILTER CTXSYS.INSO_FILTER  LEXER main_lexer WORDLIST mywordlist')PARALLEL 1 
ORA-39083: Object type INDEX failed to create with error:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-50857: oracle error in drvxtab.create_index_tables
ORA-00955: name is already used by an existing object
Failing sql is:
CREATE INDEX "VEASMS"."IDX_LY_TDD_QW" ON "VEASMS"."LY_TDD_QW" ("QW")  INDEXTYPE IS "CTXSYS"."CONTEXT" PARAMETERS ('DATASTORE CTXSYS.DIRECT_DATASTORE FILTER CTXSYS.INSO_FILTER  LEXER main_lexer WORDLIST mywordlist')PARALLEL 1 
ORA-39083: Object type INDEX failed to create with error:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-50857: oracle error in drvxtab.create_index_tables
ORA-00955: name is already used by an existing object
Failing sql is:
CREATE INDEX "VEASMS"."IDX_LY_XLJH_QW" ON "VEASMS"."LY_XLJH_QW" ("QW")  INDEXTYPE IS "CTXSYS"."CONTEXT" PARAMETERS ('DATASTORE CTXSYS.DIRECT_DATASTORE FILTER CTXSYS.INSO_FILTER  LEXER main_lexer WORDLIST mywordlist')PARALLEL 1 
Job "VEASMS"."2015-01-05" completed with 31 error(s) at 00:27:09

 为什么在最后创建存储、函数、触发器、索引时报错了呢,该怎么解决。


另外,我在导入数据的时候发现,闪回恢复区的空间是在急剧增长,所以在导入的时候闪回恢复区的磁盘要有足够的空间或 db_recovery_file_dest_size  参数要指定的足够大。
SQL> show parameter reco

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
db_recovery_file_dest                string      +FLASH
db_recovery_file_dest_size           big integer 5G
recovery_parallelism                 integer     0

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28916011/viewspace-1392535/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/28916011/viewspace-1392535/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要通过 Docker 使用 impdp 导入数据,你可以按照以下步骤进行操作: 1. 首先,确保你已经安装了 Docker 并正确配置了 Docker 环境。 2. 在 Docker 上运行一个 Oracle 数据库容器。你可以使用 `docker run` 命令来启动一个容器,类似于以下示例: ``` docker run -d -p 1521:1521 --name oracle-db -e ORACLE_SID=ORCLCDB -e ORACLE_PDB=ORCLPDB1 oracle/database:12.2.0.1-ee ``` 这将启动一个名为 `oracle-db` 的容器,并将容器内的 `1521` 端口映射到宿主机的 `1521` 端口上。同时,设置了环境变量 `ORACLE_SID` 和 `ORACLE_PDB` 来指定数据库实例和 Pluggable Database 的名称。 3. 将导入数据文件(例如 `.dmp` 文件)复制到正在运行的容器中。可以使用 `docker cp` 命令将文件从宿主机复制到容器中,如下所示: ``` docker cp /path/to/your/file.dmp oracle-db:/path/inside/container/ ``` 这将把宿主机上的 `.dmp` 文件复制到容器内的指定路径。 4. 进入正在运行的容器内部。可以使用 `docker exec` 命令以交互方式进入容器终端,如下所示: ``` docker exec -it oracle-db bash ``` 5. 在容器内部,使用 impdp 命令导入数据。你可以运行以下命令: ``` impdp username/password@//localhost:1521/ORCLCDB directory=DATA_PUMP_DIR dumpfile=file.dmp logfile=import.log ``` 其中,`username` 和 `password` 是数据库用户的凭据,`localhost:1521/ORCLCDB` 是数据库连接信息,`directory` 是指向 `.dmp` 文件所在目录的数据库目录对象,`dumpfile` 是要导入数据文件名,`logfile` 是导入过程中生成的日志文件名。 6. 导入过程完成后,你可以检查日志文件以获取导入的结果。 这些步骤将帮助你使用 Docker 和 impdp 导入数据到 Oracle 数据库。请根据你的具体情况进行相应的调整。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值