+ -
当前位置:首页 → 问答吧 → expdp 导出失败

expdp 导出失败

时间:2011-12-26

来源:互联网

最近遇到一个新问题 求助大家:
我在导出数据的时候
expdp g16_11g_5x5/g16_11g_5x5@gg150 directory=dump dumpfile=abc.dmp

提示的错误为:
ora-39001:参数值无效
ora-00980:同义词转换不再有效


请教各位专家这是怎么会是

作者: singzero   发布时间: 2011-12-26


  使用EXPDP工具时,其转储文件只能被存放在DIRECTORY对象对应的OS目录中,而不能直接指定转储文件所在的OS目录.因此使用EXPDP工具时,必须首先建立DIRECTORY对象.并且需要为数据库用户授予使用DIRECTORY对象权限.

  首先得建DIRECTORY:

  SQL> conn /as sysdba

  SQL> CREATE OR REPLACE DIRECTORY dir_dump AS '/u01/backup/';

  SQL> GRANT read,write ON DIRECTORY dir_dump TO public;

  1) 导出scott整个schema

  --默认导出登陆账号的schema

  $ expdp scott/tiger@db_esuite parfile=/orahome/expdp.par

  expdp.par内容:

  DIRECTORY=dir_dump

  DUMPFILE=scott_full.dmp

  LOGFILE=scott_full.log

  --其他账号登陆, 在参数中指定schemas

  $ expdp system/oracle@db_esuite parfile=/orahome/expdp.par

  expdp.par内容:

  DIRECTORY=dir_dump

  DUMPFILE=scott_full.dmp

  LOGFILE=scott_full.log

  SCHEMAS=SCOTT

  2) 导出scott下的dept,emp表

  $ expdp scott/tiger@db_esuite parfile=/orahome/expdp.par

  expdp.par内容:

  DIRECTORY=dir_dump

  DUMPFILE=scott.dmp

  LOGFILE=scott.log

  TABLES=DEPT,EMP

  3) 导出scott下除emp之外的表

  $ expdp scott/tiger@db_esuite parfile=/orahome/expdp.par

  expdp.par内容:

  DIRECTORY=dir_dump

  DUMPFILE=scott.dmp

  LOGFILE=scott.log

  EXCLUDE=TABLE:"='EMP'"

  4) 导出scott下的存储过程

  $ expdp scott/tiger@db_esuite parfile=/orahome/expdp.par

  expdp.par内容:

  DIRECTORY=dir_dump

  DUMPFILE=scott.dmp

  LOGFILE=scott.log

  INCLUDE=PROCEDURE

  5) 导出scott下以'E'开头的表

  $ expdp scott/tiger@db_esuite parfile=/orahome/expdp.par

  expdp.par内容:

  DIRECTORY=dir_dump

  DUMPFILE=scott.dmp

  LOGFILE=scott.log

  INCLUDE=TABLE:"LIKE 'E%'" //可以改成NOT LIKE,就导出不以E开头的表

  6) 带QUERY导出

  $ expdp scott/tiger@db_esuite parfile=/orahome/expdp.par

  expdp.par内容:

  DIRECTORY=dir_dump

  DUMPFILE=scott.dmp

  LOGFILE=scott.log

  TABLES=EMP,DEPT

  QUERY=EMP:"where empno>=8000"

  QUERY=DEPT:"where deptno>=10 and deptno<=40"

作者: zyuc_wangxw   发布时间: 2011-12-26

热门下载

更多