oracle 从sqldeveloper创建数据泵导出作业时出现问题

gudnpqoy  于 2023-10-16  发布在  Oracle
关注(0)|答案(1)|浏览(162)

我试图创建数据泵导出使用oracle sql开发向导下面是提供给用户的赠款,我试图设置数据泵导出

grant create session, create table, create procedure, exp_full_database, imp_full_database to TESTE;
grant read, write on directory DOCUMENTS to TESTE;
grant read, write on directory DATA_PUMP_DIR to TESTE;

但完成向导后,我得到下面的错误

...
 END IF;
EXCEPTION 
WHEN OTHERS THEN 
    NULL;
END;
dbms_output.put_line('REMOVE FINAL TRACE TEXT');
 Raise;
END;
Error report -
ORA-31626: job does not exist
ORA-06512: at line 77
31626. 00000 -  "job does not exist"
*Cause:    An invalid reference to a job which is no longer executing,
       is not executing on the instance where the operation was
       attempted, or that does not have a valid Master Table.
       Refer to any following error messages for clarification.
*Action:   Start a new job, or attach to an existing job that has a
       valid Master Table.

下面是向导在最后生成的plsql代码

set scan off
set serveroutput on
set escape off
whenever sqlerror exit 
DECLARE
h1 number;
errorvarchar varchar2(100):= 'ERROR';
tryGetStatus number := 0;
begin
    h1 := dbms_datapump.open (operation => 'EXPORT', job_mode => 'SCHEMA',             job_name => 'EXPORT_JOB_SQLDEV_944', version => 'COMPATIBLE'); 
tryGetStatus := 1;
dbms_datapump.set_parallel(handle => h1, degree => 1); 
dbms_datapump.add_file(handle => h1, filename => 'EXPDAT-'||to_char(sysdate,'yyyy-mm-dd-hh24_mi_ss')||'.LOG', directory => 'DATA_PUMP_DIR', filetype => 3); 
dbms_datapump.set_parameter(handle => h1, name => 'KEEP_MASTER', value => 1); 
dbms_datapump.metadata_filter(handle => h1, name => 'SCHEMA_EXPR', value => 'IN(''MERCHANDISER'')'); 
dbms_datapump.add_file(handle => h1, filename => 'EXPDAT%U-'||to_char(sysdate,'yyyy-mm-dd-hh24_mi_ss')||'.DMP', directory => 'DATA_PUMP_DIR', filesize => '100M',  filetype => 1); 
dbms_datapump.set_parameter(handle => h1, name => 'INCLUDE_METADATA', value => 1); 
dbms_datapump.set_parameter(handle => h1, name => 'DATA_ACCESS_METHOD', value => 'AUTOMATIC'); 
dbms_datapump.set_parameter(handle => h1, name => 'ESTIMATE', value => 'BLOCKS'); 
dbms_datapump.start_job(handle => h1, skip_current => 0, abort_step => 0); 
dbms_datapump.detach(handle => h1); 
errorvarchar := 'NO_ERROR'; 
EXCEPTION
    WHEN OTHERS THEN
BEGIN 
    IF ((errorvarchar = 'ERROR')AND(tryGetStatus=1)) THEN 
        DBMS_DATAPUMP.DETACH(h1);
    END IF;
EXCEPTION 
WHEN OTHERS THEN 
    NULL;
END;
RAISE;
END;
/

我也试过bash中的below command

expdp TESTE/TESTEr@localhost schemas=TESTE directory=documents dumpfile=test.dmp logfile=test.log

并得到低于误差

Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
ORA-31626: job does not exist
ORA-31637: cannot create job SYS_EXPORT_SCHEMA_06 for user MERCHANDISER
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPV$FT_INT", line 798
ORA-06550: line 1, column 7:
PLS-00331: illegal reference to SYS.SYS
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

知道是什么导致了问题吗

c9x0cxw0

c9x0cxw01#

数据库权限问题。
至少这是我两天后发现的。

相关问题