Datapump can't run in stored procedure [message #171086] |
Mon, 08 May 2006 05:37 |
alex.tam
Messages: 2 Registered: May 2006
|
Junior Member |
|
|
The following script can be executed successfully:
Declare
hand number;
Begin
hand :=
dbms_datapump.OPEN (operation => 'EXPORT',
job_mode => 'FULL',
job_name => 'TEST',
VERSION => 'COMPATIBLE'
);
End;
/
However, when I put these code into stored procedure and run it:
PROCEDURE exportdump
IS
hand NUMBER;
BEGIN
hand :=
dbms_datapump.OPEN (operation => 'EXPORT',
job_mode => 'FULL',
job_name => 'TEST',
VERSION => 'COMPATIBLE'
);
END;
it gives the following error:
ORA-31626: job does not exist
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.DBMS_DATAPUMP", line 911
ORA-06512: at "SYS.DBMS_DATAPUMP", line 4356
ORA-06512: at "GOEX_ADMIN.BO_TEST_ALEX_PKG", line 8
ORA-06512: at line 2
what's wrong with it?
I'm using Oracle 10G R2
|
|
|
|
|
|
Re: Datapump can't run in stored procedure [message #240232 is a reply to message #171192] |
Thu, 24 May 2007 07:42 |
dbnewlon
Messages: 1 Registered: May 2007
|
Junior Member |
|
|
I got this same error. The resolution is to give the user create table in their schema. I use a script like this...
drop directory dpump_dir1;
create directory dpump_dir1 as '/some/path/name';
grant create session, create table, create procedure, exp_full_database, imp_full_database to user;
grant read, write on directory dpump_dir1 to user;
After doing this I was able to run exports with dbms_datapump from a proc owned by this user.
|
|
|
|