1. 首先建立directory -- expdir(导入导出都要建立,对应的C:/exp文件夹如果不存在,需要手工建立)
sql> connect sys/123456 as sysdba
sql> create or replace directory expdir as 'C:/exp';
sql> grant read,write on directory expdir to public;
sql> select * from dab_directories;
sql> commit;
2. 使用expdp命令导出某个用户的数据
expdp kliu_voi5/1234@orcl schemas=kliu_voi5 dumpfile=kliu_voi5.dmp directory=expdir
其中kliu_voi5/1234是用户名密码,orcl是oracle的sid。该命令完成后在c:\exp下会有kilu_voi5.dmp文件
expdp kliu_voi5/1234@orcl schemas=kliu_voi5 dumpfile=kliu_voi5.dmp directory=expdir include=table:\"like \'CT%\'\"
二、导入impdp工具使用方法:
1. 首先建立directory -- db_bak
sql> connect sys/123456 as sysdba
sql> create or replace directory db_bak as 'd:/db_bak';
sql> grant read,write on directory db_bak to public;
sql> select * from dab_directories;
sql> commit;
sql> connect sys/123456 as sysdba
sql> create user kliu_voi5 identified by "1234";
sql> grant dba to kliu_voi5;
sql> commit;
3. 使用impdp命令导入某个用户的数据impdp kliu_voi5/1234@orcl directory=db_bak dumpfile=kliu_voi5.dmp full=y
参考资料:
http://blog.csdn.net/giianhui/article/details/7788550
原文链接:https://www.f2er.com/oracle/212150.html