--create directory
create directory dump_dir as ‘/splex/dump‘;
grant read,write on directory dump_dir to public;
--export full database schema
expdp user/password content=metadata cluster=no full=y directory=dump_dir dumpfile=expdp_full_schema.dmp logfile=expdp_full_schema.log
--export full database
expdp user/password content=all cluster=no full=y directory=dump_dir dumpfile=expdp_full.dmp logfile=expdp_full.log
--export users schema
expdp user/password schemas=user1,user2,user3 content=metadata cluster=no exclude=statistics directory=dump_dir dumpfile=expdp_users_schema.dmp logfile=expdp_users_schema.log
--export users schema and data
expdp user/password schemas=user1,user2,user3 content=all cluster=no PARALLEL=4 FILESIZE=20480M exclude=statistics directory=dump_dir dumpfile=expdp_users_%U.dmp logfile=expdp_users.log
--export tables schema
expdp user/password tables=tab1,tab2,tab3 content=metadata cluster=no exclude=statistics directory=dump_dir dumpfile=expdp_tables_schema.dmp logfile=expdp_tables_schema.log
--export tables schema and data
expdp user/password tables=tab1,tab2,tab3 content=all cluster=no PARALLEL=4 FILESIZE=20480M exclude=statistics directory=dump_dir dumpfile=expdp_tables_%U.dmp logfile=expdp_tables.log
network_link=dblink_name --export remote database by dblink
--export tables schema and data using compress
expdp user/password tables=tab1,tab2,tab3 content=all cluster=no PARALLEL=4 FILESIZE=20480M exclude=statistics directory=dump_dir dumpfile=expdp_tables_%U.dmp logfile=expdp_tables.log
compress=all --对元数据和表数据进行压缩,11g开始支持
compress=data_only --对表数据进行压缩,11g开始支持
compress=metadata_only --对元数据进行压缩,10g开始支持,默认方式
--import schema or data
impdp user/password directory=dump_dir dumpfile=expdp.dmp logfile=impdp.log ignore=y
--import schema or data using parallel
impdp user/password directory=dump_dir PARALLEL=4 dumpfile=expdp_%U.dmp logfile=impdp.log ignore=y
--REMAP_SCHEMA=schema1:schema2 --不同用户之间的数据迁移
--REMAP_TABLESPACE=tbs1:tbs2 ---不同表空间之间的数据迁移
--REMAP_TABLE=schema1.tab1:tab2 ---相同schema不同表之间的数据迁移
--REMAP_TABLE=schema1.tab1:tab2 REMAP_SCHEMA=schema1:schema2 ---不同schema不同表之间的数据迁移