首页 > Linux操作系统 > Linux操作系统 > EXPDP、IMPDP
create directory dump_dir as 'f:\backup\expdp';
grant read,write on directory dump_dir to scott;
一、导出
1、导出表
expdp scott/password directory=dump_dir dumpfile=tab.dmp logfile=tab.log tables=dept,emp
2、导出方案
expdp system/password directory=dump_dir dumpfile=schema.dmp logfile=schema.log schemas=system,scott
3、导出表空间
expdp system/password directory=dump_dir dumpfile=tablespace.dmp logfile=tablespace.log tablespaces=users
4、导出数据库
expdp system/password directory=dump_dir dumpfile=full.dmp logfile=full.log full=y
相关参数
content={all | data_only | metadata_only}
flashback_scn=scn_value
flashback_time="to_timestamp(time_value)"
expdp help=y
query='"where deptno=20"'
二、导入
1、导入表
impdp scott/password directory=dump_dir dumpfile=tab.dmp tables=dept,emp
impdp system/password directory=dump_dir dumpfile=tab.dmp tables=scott.dept,scott.emp remap_schema=scott:system
2、导入方案
impdp scott/password directory=dump_dir dumpfile=schema.dmp schemas=scott
impdp system/password directory=dump_dir dumpfile=schema.dmp schemas=scott remap_schema=scott:system
3、导入表空间
impdp system/password dircetory=dump_dir dumpfile=tablespace.dmp tablespace=users
4、导入数据库
impdp system/password directory=dump_dir dumpfile=full.dmp full=y
相关参数
table_exists_action={skip | append | truncate | replace}
三、搬移表空间
1、确定自包含表空间集合
conn system/password
execute sys.dbms_tts.transport_set_check('users',true)
select * from sys.transport_set_violations;
若有记录,则须删除。
drop index scott.dept_emp_idx;
2、生成搬移表空间集合
alter tablespace users read only;
host expdp system/password directory=dump_dir dumpfile=transport.dmp transport_tablespaces=users
host copy D:\Oracle\Oracle_10g\oradata\ora10\users.dbf D:\Oracle\Oracle_10g\oradata\test\users.dbf
3、插入表空间到目标数据库
alter system set da_cache_size=20M;
alter system set db_4k_cache_size=4M;
host impdp system/password@test directory=dump_dir dumpfile=transport.dmp transport_datafiles=D:\Oracle\Oracle_10g\oradata\test\users.dbf remap_schema=scott:test
alter tablespace users read write;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/17012874/viewspace-693302/ ,如需转载,请注明出处,否则将追究法律责任。