您好,欢迎访问一九零五行业门户网

expdp&impdp

1 创建逻辑目录,该命令不会在操作系统创建真正的目录,最好以system等管理员创建。 create directory dpdata1 as '/opt/oracle/dpdata1'; create directory expdata as '/ora_arch/expdata'; 2 查看管理理员目录(同时查看操作系统是否存在,因为oracle并不
1 创建逻辑目录,该命令不会在操作系统创建真正的目录,最好以system等管理员创建。
create directory dpdata1 as '/opt/oracle/dpdata1';
create directory expdata as '/ora_arch/expdata';
2 查看管理理员目录(同时查看操作系统是否存在,因为oracle并不关心该目录是否存在,如果不存在,则出错)
select * from dba_directories;
3 给scott用户赋予在指定目录的操作权限,最好以system等管理员赋予。
grant read,write on directory expdata to ardb;
4 导出数据
1)按用户导
expdp billingcdrdb/billingcdrdb@prodbillingcdrdb schemas=billingcdrdb dumpfile=prodbillingcdrdb.dmp directory=dpdata1 logfile=prodbillingcdrdb.log;
expdp billingcdrdb/billingcdrdb@prodbillingcdrdb schemas=billingcdrdb dumpfile=prodbillingcdrdb.dmp directory=dumpdir content=metadata_only logfile=prodbillingcdrdb.log;
2)并行进程parallel
expdp scott/tiger@orcl directory=dpdata1 dumpfile=scott3.dmp parallel=40 job_name=scott3
3)按表名导
expdp ardb/ardb tables=log_trx_detail dumpfile=log_trx_detail.dmp directory=expdata;
4)按查询条件导
expdp scott/tiger@orcl directory=dpdata1 dumpfile=expdp.dmp tables=emp query='where deptno=20';
5)按表空间导
expdp system/manager directory=dpdata1 dumpfile=tablespace.dmp tablespaces=temp,example;
6)导整个数据库
expdp system/manager directory=dpdata1 dumpfile=full.dmp full=y;
5 还原数据
1)导到指定用户下
impdp scott/tiger directory=dpdata1 dumpfile=expdp.dmp schemas=scott;
2)改变表的owner
impdp system/manager directory=dpdata1 dumpfile=expdp.dmp tables=scott.dept remap_schema=scott:system;
3)导入表空间
impdp system/manager directory=dpdata1 dumpfile=tablespace.dmp tablespaces=example;
4)导入数据库
impdb system/manager directory=dump_dir dumpfile=full.dmp full=y;
5)追加数据
impdp system/manager directory=dpdata1 dumpfile=expdp.dmp schemas=system table_exists_action
drop user algeria cascade ;
create user algeria identified by algeria default tablespace algeria ;
grant connect , resource to algeria ;
grant create synonym , create view to algeria ;
create directory algeria as 'd:\algeria';
impdp billingcdrdb1/billingcdrdb1 directory=dpdata1 dumpfile=prodbillingcdrdb.dmp remap_schema=billingcdrdb:billingcdrdb1 logfile=impdp.log
其它类似信息

推荐信息