impdp 使用參數文件

os: centos 7.4
db: oracle 11.2.0.4

directory

# su - oracle
$ mkdir peiyb
$ cd peiyb
$ pwd
/home/oracle/peiyb

SQL> set lines 300;
set pages 300;
col owner format a10;
col directory_name format a30;
col directory_path format a70;

SQL> 
SQL> select * from dba_directories;

OWNER	   DIRECTORY_NAME		  DIRECTORY_PATH
---------- ------------------------------ ----------------------------------------------------------------------
SYS	       SUBDIR			      /u01/app/oracle/product/11.2.0/db_1/demo/schema/order_entry//2002/Sep
SYS	       SS_OE_XMLDIR 		  /u01/app/oracle/product/11.2.0/db_1/demo/schema/order_entry/
SYS	       LOG_FILE_DIR 		  /u01/app/oracle/product/11.2.0/db_1/demo/schema/log/
SYS	       MEDIA_DIR			  /u01/app/oracle/product/11.2.0/db_1/demo/schema/product_media/
SYS	       DATA_FILE_DIR		  /u01/app/oracle/product/11.2.0/db_1/demo/schema/sales_history/
SYS	       XMLDIR			      /u01/app/oracle/product/11.2.0/db_1/rdbms/xml
SYS	       ORACLE_OCM_CONFIG_DIR  /u01/app/oracle/product/11.2.0/db_1/ccr/hosts/node1/state
SYS	       DATA_PUMP_DIR		  /u01/app/oracle/product/11.2.0/db_1/rdbms/log/
SYS	       ORACLE_OCM_CONFIG_DIR2 /u01/app/oracle/product/11.2.0/db_1/ccr/state

9 rows selected.

SQL> create directory PEIYB_DATA_PUMP_DIR as '/home/oracle/peiyb/';

Directory created.

<<expdp 使用參數文件>> 已經導出了,現在導入

impdp

$ vi impdp.par

userid='/ as sysdba'
directory=PEIYB_DATA_PUMP_DIR
dumpfile=expdp_20200227_%U.dmp
job_name=impdp_20200227
logfile=impdp_20200227.log
table_exists_action=append
cluster=n
parallel=4
remap_table=scott2.tmp_t0:scott2:tmp_t1

使用 nohup ,預防連接斷開

$ nohup impdp parfile=impdp.par & 

$ tail -f nohup.out 

Import: Release 11.2.0.4.0 - Production on Wed Feb 26 13:55:38 2020

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
Master table "SYS"."IMPDP_20200227" successfully loaded/unloaded
Starting "SYS"."IMPDP_20200227":  /******** AS SYSDBA parfile=impdp.par 
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "SCOTT2"."TMP_T1"                           6.148 KB    1000 rows
Job "SYS"."IMPDP_20200227" successfully completed at Wed Feb 26 13:56:05 2020 elapsed 0 00:00:24

$ ls -l
total 52
-rw-r----- 1 oracle asmadmin 12288 Feb 26 13:51 expdp_20200227_01.dmp
-rw-r----- 1 oracle asmadmin 20480 Feb 26 13:51 expdp_20200227_02.dmp
-rw-r--r-- 1 oracle asmadmin  1044 Feb 26 13:51 expdp_20200227.log
-rw-r--r-- 1 oracle oinstall   222 Feb 26 13:48 expdp.par
-rw-r--r-- 1 oracle asmadmin   750 Feb 26 13:56 impdp_20200227.log
-rw-r--r-- 1 oracle oinstall   221 Feb 26 13:54 impdp.par
-rw------- 1 oracle oinstall  1780 Feb 26 13:56 nohup.out

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章