expdp导出
确保已经创建数据备份路径,若没有则按照准备工作中的说明进行创建。(注意:若CPU资源充足强烈推荐开启并行参数,可以大大节省导入、导出的时间)
第一种:“full=y”,全量导出数据库:
expdp user/passwd@orcl dumpfile=expdp.dmp directory=data_dir full=y logfile=expdp.log;
第二种:schemas按用户导出:
expdp user/passwd@orcl schemas=user dumpfile=expdp.dmp directory=data_dir logfile=expdp.log;
导出SCOTT用户下的emp和dept表
expdp scott/oracle directory=dump_dir dumpfile=scotttab.dmp tables=emp,dept
第三种:按表空间导出:
expdp sys/passwd@orcl tablespace=tbs1,tbs2 dumpfile=expdp.dmp directory=data_dir logfile=expdp.log;
第四种:导出表:
expdp user/passwd@orcl tables=table1,table2 dumpfile=expdp.dmp directory=data_dir logfile=expdp.log;
第五种:按查询条件导:
expdp user/passwd@orcl tables=table1='where number=1234' dumpfile=expdp.dmp directory=data_dir logfile=expdp.log;