You are on page 1of 6

[备份恢复] AIX 到 linux 的数据库迁移的问题

发表于 2013-8-27 11:20 | 只看该作者 | |


源数据库
版本 操作系统平台 字节顺序
11.2.0.2.0 AIX-Based Systems(64-bit) Big
服务器端国家字符集 AMERICAN_AMERICA.ZHS16GBK

目标数据库
版本 操作系统平台 字节顺序
11.2.0.3.0 Linux x86 64-bit Little
服务器端国家字符集 AMERICAN_AMERICA.ZHS16GBK

由于要对数据库进行迁移,数据量比较大,想通过表空间传输
想问下能否使用表空间传输,还有传输有什么细节需要注意?

oracle 11g expdp impdp 跨平台迁移数据


原创 chj1028 2013-06-17 12:02:12 评论(0) 1131 人阅读
以下只在 AIX 6.1 和 RedHat 5.4 上实验成功

迁出环境:AIX 6.1 ORACLE 11.2.0.1


迁入环境:REDHAT 5.4 ORACLE 11.2.0.3

一.导出用户 greenlive 的数据


1.创建 green_back 目录用于存放导出来的数据
create directory green_back as '/oradata';

2.为 green_back 赋于目录读写权限


grant read, write on directory green_back to greenlive;

3.检查下创建的目录是否成功
select * from dba_directories;

上述操作代码如下示:
1SQL> create directory green_back as '/oradata';
2Directory created.
3SQL> grant read, write on directory green_back to greenlive;
4Grant succeeded.
5SQL> select * from dba_directories;
6OWNER DIRECTORY_NAME DIRECTORY_PATH
7SYS GREEN_BACK /oradata

4.执行导出操作
expdp usename/password directory=green_back dumpfile=greenlive20130616.dmp logfile=greenlive20130616.log schemas=greenlive

1 $ expdp greenlive/******** directory=green_back dumpfile=greenlive20130616.dmp logfile=greenlive20130616.log


2 schemas=greenlive
3 Export: Release 11.2.0.1.0 - Production on Sun Jun 16 14:04:54 2013
4 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
5 Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
6 With the Partitioning, OLAP, Data Mining and Real Application Testing options
7 FLASHBACK automatically enabled to preserve database integrity.
8 Starting "GREENLIVE"."SYS_EXPORT_SCHEMA_01": greenlive/******** directory=green_back dumpfile=greenlive20130616.dmp
9 logfile=greenlive20130616.log schemas=greenlive
10Estimate in progress using BLOCKS method...
11Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
12Total estimation using BLOCKS method: 2.840 GB
13Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
14Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
15Processing object type SCHEMA_EXPORT/TABLE/TABLE
16Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
17Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
18Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
19Processing object type SCHEMA_EXPORT/TABLE/COMMENT
20Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
21. . exported "GREENLIVE"."C_IMAGE" 2.692 GB 5708 rows
22. . exported "GREENLIVE"."MEMBERINFO" 11.04 MB 100787 rows
23. . exported "GREENLIVE"."MEMBERINFO_1206" 10.86 MB 94757 rows
24. . exported "GREENLIVE"."G_GOODSTOCNO" 6.454 MB 125992 rows
25. . exported "GREENLIVE"."G_IMAGE" 5.301 MB 781 rows
26. . exported "GREENLIVE"."USERTEST" 6.905 MB 43129 rows
27. . exported "GREENLIVE"."G_ACCCHGDETAIL" 5.275 MB 83079 rows
28. . exported "GREENLIVE"."G_ACCOUNT" 4.586 MB 197072 rows
29. . exported "GREENLIVE"."IMAGE" 4.066 MB 90 rows
30. . exported "GREENLIVE"."C_FAMILYINFO" 2.914 MB 79829 rows
31. . exported "GREENLIVE"."C_CARBONHISTORY" 2.129 MB 30553 rows
32. . exported "GREENLIVE"."C_MEMBERSCHOOL" 2.353 MB 79831 rows
33. . exported "GREENLIVE"."MMB" 2.234 MB 51327 rows
34. . exported "GREENLIVE"."G_MEMBERTOPROJECT" 1.265 MB 36696 rows
35. . exported "GREENLIVE"."T1" 1.033 MB 43089 rows
36. . exported "GREENLIVE"."NEWS" 567.2 KB 8 rows
37. . exported "GREENLIVE"."C_SHOOLINFO" 714.0 KB 19478 rows
38. . exported "GREENLIVE"."C_PACKER" 325.5 KB 5033 rows
39. . exported "GREENLIVE"."C_TRENDS" 234.3 KB 90 rows
40. . exported "GREENLIVE"."ANNOUNCEMENT" 88.75 KB 2 rows
41. . exported "GREENLIVE"."C_MEMBERPAPER" 268.2 KB 14994 rows
42. . exported "GREENLIVE"."TB_COMPANY" 126.0 KB 4 rows
43. . exported "GREENLIVE"."C_NEWS" 104.5 KB 39 rows
44. . exported "GREENLIVE"."C_KNOWLEDGE" 34.63 KB 11 rows
45. . exported "GREENLIVE"."CITY" 16.67 KB 426 rows
46. . exported "GREENLIVE"."C_ADMININFO" 10.03 KB 2 rows
47. . exported "GREENLIVE"."C_DOWNLOAD" 18.41 KB 6 rows
48. . exported "GREENLIVE"."C_OPTIONS" 16.48 KB 225 rows
49. . exported "GREENLIVE"."C_PROMISE" 8.570 KB 7 rows
50. . exported "GREENLIVE"."C_QANDA" 11.50 KB 53 rows
51. . exported "GREENLIVE"."C_TESTPAPER" 8 KB 2 rows
52. . exported "GREENLIVE"."GROUPS" 5.898 KB 2 rows
53. . exported "GREENLIVE"."G_ADDRESSLIST" 14.78 KB 73 rows
54. . exported "GREENLIVE"."G_CLIST" 6.632 KB 31 rows
55. . exported "GREENLIVE"."G_GOODSINFO" 21.96 KB 9 rows
56. . exported "GREENLIVE"."G_GOODSTOPROJECT" 7.179 KB 3 rows
57. . exported "GREENLIVE"."G_LOGISTICS" 10.01 KB 8 rows
58. . exported "GREENLIVE"."G_ORDERINFO" 45.98 KB 481 rows
59. . exported "GREENLIVE"."G_ORDERLIST" 20.47 KB 485 rows
60. . exported "GREENLIVE"."G_POSTCOMPANY" 7.929 KB 1 rows
61. . exported "GREENLIVE"."G_POSTFEE" 17.52 KB 426 rows
62. . exported "GREENLIVE"."G_PROJECTINFO" 8.085 KB 1 rows
63. . exported "GREENLIVE"."G_SHOPCART" 26.64 KB 988 rows
64. . exported "GREENLIVE"."G_SUPPLIERS" 7.609 KB 1 rows
65. . exported "GREENLIVE"."G_SYSPARM" 7.968 KB 2 rows
66. . exported "GREENLIVE"."PROVINCE" 6.078 KB 34 rows
67. . exported "GREENLIVE"."RESOURCEGROUP" 16.75 KB 537 rows
68. . exported "GREENLIVE"."RESOURCES" 9.679 KB 85 rows
69. . exported "GREENLIVE"."TB_STAR" 10.56 KB 6 rows
70. . exported "GREENLIVE"."USERGROUP" 5.976 KB 2 rows
71. . exported "GREENLIVE"."USERLOG" 7.75 KB 12 rows
72. . exported "GREENLIVE"."USERS" 12.14 KB 2 rows
73. . exported "GREENLIVE"."BANNER" 0 KB 0 rows
74. . exported "GREENLIVE"."C_BANNER" 0 KB 0 rows
75. . exported "GREENLIVE"."C_POINTS_RULE" 0 KB 0 rows
76. . exported "GREENLIVE"."C_PRIZE" 0 KB 0 rows
77. . exported "GREENLIVE"."G_MEMBER_COMMUNITY" 0 KB 0 rows
78. . exported "GREENLIVE"."G_MEMBER_SZ" 0 KB 0 rows
79. . exported "GREENLIVE"."NEWSIMAGES" 0 KB 0 rows
80Master table "GREENLIVE"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
81******************************************************************************
82Dump file set for GREENLIVE.SYS_EXPORT_SCHEMA_01 is:
/oradata/greenlive20130616.dmp
Job "GREENLIVE"."SYS_EXPORT_SCHEMA_01" successfully completed at 14:09:20

二.导入数据
1.创建数据用户“greenlive”
可以用命令行也可以用诸如 plsqldev 工具创建

2.创建 greenlive 目录用于存放复制来的数据


create directory greenlive as '/opt/oracle/oradata';

3.为 greenlive 赋于目录读写权限


grant read, write on directory greenlive to greenlive;

4.复制数据到/opt/oracle/oradata(注意复制来的数据权属于 oracle 用户)

1 SQL> create directory greenlive as '/opt/oracle/oradata';


2 Directory created.
3 SQL> grant read, write on directory greenlive to greenlive;
4 Grant succeeded.
5 SQL> exit
6 Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
7 With the Partitioning, OLAP, Data Mining and Real Application Testing options
8 [oracle@host1 oradata]$ ls
9 orcl
10[oracle@host1 oradata]$ cp /soft/greenlive20130616/greenlive20130616.log /opt/oracle/oradata/
11[oracle@host1 oradata]$ ls
12greenlive20130616.dmp greenlive20130616.log orcl
13[oracle@host1 oradata]$ ll
14总计 2898476
15-rwxr-xr-x 1 oracle oinstall 2965127168 06-17 08:50 greenlive20130616.dmp
16-rwxr-xr-x 1 oracle oinstall 6164 06-17 08:50 greenlive20130616.log
17drwxr-x--- 2 oracle oinstall 4096 05-13 10:48 orcl
5.执行导入操作

impdp username/password@orcl directory=greenlive dumpfile=greenlive20130616.dmp logfile=greenlive20130616.log


schemas=greenlive

1 [oracle@host1 oradata]$ impdp greenlive/********@orcl directory=greenlive dumpfile=greenlive20130616.dmp


2 logfile=greenlive20130616.log schemas=greenlive
3 Import: Release 11.2.0.3.0 - Production on Mon Jun 17 08:54:37 2013
4 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
5 Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
6 With the Partitioning, OLAP, Data Mining and Real Application Testing options
7 Master table "GREENLIVE"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded
8 Starting "GREENLIVE"."SYS_IMPORT_SCHEMA_01": greenlive/********@orcl directory=greenlive dumpfile=greenlive20130616.dmp
9 logfile=greenlive20130616.log schemas=greenlive
10Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
11Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
12Processing object type SCHEMA_EXPORT/TABLE/TABLE
13ORA-39083: Object type TABLE:"GREENLIVE"."T1" failed to create with error:
14ORA-00959: tablespace 'SLCARD_TABS01' does not exist
15Failing sql is:
16CREATE TABLE "GREENLIVE"."T1" ("T_NUM" NUMBER(3,0), "T_MAIL" VARCHAR2(100 BYTE)) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED
1740 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE
180 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "SLC
19Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
20. . imported "GREENLIVE"."C_IMAGE" 2.692 GB 5708 rows
21. . imported "GREENLIVE"."MEMBERINFO" 11.04 MB 100787 rows
22. . imported "GREENLIVE"."MEMBERINFO_1206" 10.86 MB 94757 rows
23. . imported "GREENLIVE"."G_GOODSTOCNO" 6.454 MB 125992 rows
24. . imported "GREENLIVE"."G_IMAGE" 5.301 MB 781 rows
25. . imported "GREENLIVE"."USERTEST" 6.905 MB 43129 rows
26. . imported "GREENLIVE"."G_ACCCHGDETAIL" 5.275 MB 83079 rows
27. . imported "GREENLIVE"."G_ACCOUNT" 4.586 MB 197072 rows
28. . imported "GREENLIVE"."IMAGE" 4.066 MB 90 rows
29. . imported "GREENLIVE"."C_FAMILYINFO" 2.914 MB 79829 rows
30. . imported "GREENLIVE"."C_CARBONHISTORY" 2.129 MB 30553 rows
31. . imported "GREENLIVE"."C_MEMBERSCHOOL" 2.353 MB 79831 rows
32. . imported "GREENLIVE"."MMB" 2.234 MB 51327 rows
33. . imported "GREENLIVE"."G_MEMBERTOPROJECT" 1.265 MB 36696 rows
34. . imported "GREENLIVE"."NEWS" 567.2 KB 8 rows
35. . imported "GREENLIVE"."C_SHOOLINFO" 714.0 KB 19478 rows
36. . imported "GREENLIVE"."C_PACKER" 325.5 KB 5033 rows
37. . imported "GREENLIVE"."C_TRENDS" 234.3 KB 90 rows
38. . imported "GREENLIVE"."ANNOUNCEMENT" 88.75 KB 2 rows
39. . imported "GREENLIVE"."C_MEMBERPAPER" 268.2 KB 14994 rows
40. . imported "GREENLIVE"."TB_COMPANY" 126.0 KB 4 rows
41. . imported "GREENLIVE"."C_NEWS" 104.5 KB 39 rows
42. . imported "GREENLIVE"."C_KNOWLEDGE" 34.63 KB 11 rows
43. . imported "GREENLIVE"."CITY" 16.67 KB 426 rows
44. . imported "GREENLIVE"."C_ADMININFO" 10.03 KB 2 rows
45. . imported "GREENLIVE"."C_DOWNLOAD" 18.41 KB 6 rows
46. . imported "GREENLIVE"."C_OPTIONS" 16.48 KB 225 rows
47. . imported "GREENLIVE"."C_PROMISE" 8.570 KB 7 rows
48. . imported "GREENLIVE"."C_QANDA" 11.50 KB 53 rows
49. . imported "GREENLIVE"."C_TESTPAPER" 8 KB 2 rows
50. . imported "GREENLIVE"."GROUPS" 5.898 KB 2 rows
51. . imported "GREENLIVE"."G_ADDRESSLIST" 14.78 KB 73 rows
52. . imported "GREENLIVE"."G_CLIST" 6.632 KB 31 rows
53. . imported "GREENLIVE"."G_GOODSINFO" 21.96 KB 9 rows
54. . imported "GREENLIVE"."G_GOODSTOPROJECT" 7.179 KB 3 rows
55. . imported "GREENLIVE"."G_LOGISTICS" 10.01 KB 8 rows
56. . imported "GREENLIVE"."G_ORDERINFO" 45.98 KB 481 rows
57. . imported "GREENLIVE"."G_ORDERLIST" 20.47 KB 485 rows
58. . imported "GREENLIVE"."G_POSTCOMPANY" 7.929 KB 1 rows
59. . imported "GREENLIVE"."G_POSTFEE" 17.52 KB 426 rows
60. . imported "GREENLIVE"."G_PROJECTINFO" 8.085 KB 1 rows
61. . imported "GREENLIVE"."G_SHOPCART" 26.64 KB 988 rows
62. . imported "GREENLIVE"."G_SUPPLIERS" 7.609 KB 1 rows
63. . imported "GREENLIVE"."G_SYSPARM" 7.968 KB 2 rows
64. . imported "GREENLIVE"."PROVINCE" 6.078 KB 34 rows
65. . imported "GREENLIVE"."RESOURCEGROUP" 16.75 KB 537 rows
66. . imported "GREENLIVE"."RESOURCES" 9.679 KB 85 rows
67. . imported "GREENLIVE"."TB_STAR" 10.56 KB 6 rows
68. . imported "GREENLIVE"."USERGROUP" 5.976 KB 2 rows
69. . imported "GREENLIVE"."USERLOG" 7.75 KB 12 rows
70. . imported "GREENLIVE"."USERS" 12.14 KB 2 rows
71. . imported "GREENLIVE"."BANNER" 0 KB 0 rows
72. . imported "GREENLIVE"."C_BANNER" 0 KB 0 rows
73. . imported "GREENLIVE"."C_POINTS_RULE" 0 KB 0 rows
74. . imported "GREENLIVE"."C_PRIZE" 0 KB 0 rows
75. . imported "GREENLIVE"."G_MEMBER_COMMUNITY" 0 KB 0 rows
76. . imported "GREENLIVE"."G_MEMBER_SZ" 0 KB 0 rows
77. . imported "GREENLIVE"."NEWSIMAGES" 0 KB 0 rows
78Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
79Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
80Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
ORA-39112: Dependent object type TABLE_STATISTICS skipped, base object type TABLE:"GREENLIVE"."T1" creation failed
Job "GREENLIVE"."SYS_IMPORT_SCHEMA_01" completed with 2 error(s) at 08:57:05

这里有两个报错 ORA-39083 ORA-00959,关于 ORA-39083 这个报错网上有一大堆处理的办法,


我这里主要是因为有个表空间没建好,我们这个数据比较特殊,所以这个报错没影响,就没去处理

___________________________________________________________________________
当导出库与导入库表空间不一致时,可以使用 remap_tablespace 参数,如下示
impdp slwebtest/slwebtest directory=slwebtest dumpfile=slwebtest0828.dmp logfile=slwebtest0828.log schemas=slwebtest
remap_tablespace=slwebtest_tabs01:users remap_tablespace=slweb_tabs01:users
ORACLE EXPDP 命令使用详细
原创 2011 年 05 月 03 日 15:26:00

ORACLE EXPDP 命令使用详细


相关参数以及导出示例:

1. DIRECTORY
指定转储文件和日志文件所在的目录
DIRECTORY=directory_object
Directory_object 用于指定目录对象名称.需要注意,目录对象是使用 CREATE DIRECTORY 语句建立的对象,而不是 OS 目录
Expdp scott/tiger DIRECTORY= DMP DUMPFILE=a.dump

create or replace directory dmp


as 'd:/dmp'

expdp zftang/zftang@zftang directory=dmp dumpfile=test.dmp content=metadata_only

2. CONTENT
该选项用于指定要导出的内容.默认值为 ALL
CONTENT={ALL | DATA_ONLY | METADATA_ONLY}
当设置 CONTENT 为 ALL 时,将导出对象定义及其所有数据.为 DATA_ONLY 时,只导出对象数据,为 METADATA_ONLY 时,只导出对象定义

expdp zftang/zftang@zftang directory=dmp dumpfile=test.dmp content=metadata_only


----------只导出对象定义
expdp zftang/zftang@zftang directory=dmp dumpfile=test.dmp content=data_only
----------导出出所有数据
3. DUMPFILE
用于指定转储文件的名称,默认名称为 expdat.dmp
DUMPFILE=[directory_object:]file_name [,….]
Directory_object 用于指定目录对象名,file_name 用于指定转储文件名.需要注意,如果不指定 directory_object,导出工具会自动使用
DIRECTORY 选项指定的目录对象

expdp zftang/zftang@zftang directory=dmp dumpfile=test1.dmp

数据泵工具导出的步骤:
1、创建 DIRECTORY
create directory dir_dp as 'D:/oracle/dir_dp';
2、授权
Grant read,write on directory dir_dp to zftang;
--查看目录及权限
SELECT privilege, directory_name, DIRECTORY_PATH FROM user_tab_privs t, all_directories d
WHERE t.table_name(+) = d.directory_name ORDER BY 2, 1;
3、执行导出
expdp zftang/zftang@fgisdb schemas=zftang directory=dir_dp dumpfile =expdp_test1.dmp logfile=expdp_test1.log;

连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1


With the Partitioning, OLAP and Data Mining options
启动 "ZFTANG"."SYS_EXPORT_SCHEMA_01": zftang/********@fgisdb sch
ory=dir_dp dumpfile =expdp_test1.dmp logfile=expdp_test1.log; */
备注:
1、directory=dir_dp 必须放在前面,如果将其放置最后,会提示 ORA-39002: 操作无效
ORA-39070: 无法打开日志文件。
ORA-39087: 目录名 DATA_PUMP_DIR; 无效

2、在导出过程中,DATA DUMP 创建并使用了一个名为 SYS_EXPORT_SCHEMA_01 的对象,此对象就是 DATA DUMP 导出过程中所用的 JOB 名字,
如果在执行这个命令时如果没有指定导出的 JOB 名字那么就会产生一个默认的 JOB 名字,如果在导出过程中指定 JOB 名字就为以指定名字出现
如下改成:
expdp zftang/zftang@fgisdb schemas=zftang directory=dir_dp dumpfile =expdp_test1.dmp
logfile=expdp_test1.log,job_name=my_job1;
3、导出语句后面不要有分号,否则如上的导出语句中的 job 表名为‘my_job1;’,而不是 my_job1。因此导致 expdp zftang/zftang
attach=zftang.my_job1 执行该命令时一直提示找不到 job 表

数据泵导出的各种模式:
1、 按表模式导出:
expdp zftang/zftang@fgisdb tables=zftang.b$i_exch_info,zftang.b$i_manhole_info dumpfile =expdp_test2.dmp
logfile=expdp_test2.log directory=dir_dp job_name=my_job

2、按查询条件导出:
expdp zftang/zftang@fgisdb tables=zftang.b$i_exch_info dumpfile =expdp_test3.dmp logfile=expdp_test3.log directory=dir_dp
job_name=my_job query='"where rownum<11"'

3、按表空间导出:
Expdp zftang/zftang@fgisdb dumpfile=expdp_tablespace.dmp tablespaces=GCOMM.DBF logfile=expdp_tablespace.log
directory=dir_dp job_name=my_job

4、导出方案
Expdp zftang/zftang DIRECTORY=dir_dp DUMPFILE=schema.dmp SCHEMAS=zftang,gwm

5、导出整个数据库:
expdp zftang/zftang@fgisdb dumpfile =full.dmp full=y logfile=full.log directory=dir_dp job_name=my_job

impdp 导入模式:
1、按表导入
p_street_area.dmp 文件中的表,此文件是以 gwm 用户按 schemas=gwm 导出的:
impdp gwm/gwm@fgisdb dumpfile =p_street_area.dmp logfile=imp_p_street_area.log directory=dir_dp tables=p_street_area
job_name=my_job

2、按用户导入(可以将用户信息直接导入,即如果用户信息不存在的情况下也可以直接导入)
impdp gwm/gwm@fgisdb schemas=gwm dumpfile =expdp_test.dmp logfile=expdp_test.log directory=dir_dp job_name=my_job

3、不通过 expdp 的步骤生成 dmp 文件而直接导入的方法:


--从源数据库中向目标数据库导入表 p_street_area
impdp gwm/gwm directory=dir_dp NETWORK_LINK=igisdb tables=p_street_area logfile=p_street_area.log job_name=my_job
igisdb 是目的数据库与源数据的链接名,dir_dp 是目的数据库上的目录

4、更换表空间
采用 remap_tablespace 参数
--导出 gwm 用户下的所有数据
expdp system/orcl directory=data_pump_dir dumpfile=gwm.dmp SCHEMAS=gwm
注:如果是用 sys 用户导出的用户数据,包括用户创建、授权部分,用自身用户导出则不含这些内容
--以下是将 gwm 用户下的数据全部导入到表空间 gcomm(原来为 gmapdata 表空间下)下
impdp system/orcl directory=data_pump_dir dumpfile=gwm.dmp remap_tablespace=gmapdata:gcomm

【农商行实例】
定义空间为 700G 的 sjfx ewd 数据库,expdp 估计 dmp file=390G, 实际为 280G, RDL 用户 full(全库导出,包括了 SYSMAN, 系统表等)
Ewd oracle 建在虚拟机上,io 速度可达 200M/s 左右(最快 10G/min) ,实际上,expdp 导出 280G/1h22=82 分, 约为 3.5G/min