| DBMS_DATAPUMP.ADD_FILE : ORA-39001 [message #226182] |
Thu, 22 March 2007 14:26  |
tplank
Messages: 7 Registered: March 2007
|
Junior Member |
|
|
I have a stored proc that is giving me an "ORA-39001: invalid argument value" message when I execute the ADD_FILE. I'll put the proc at the bottom. I've tried every option. I've double checked that the user Oracle can read and write to the file system directory. I've double checked the persmissions. I've tried to execute using the user SYS. I've tried it with and without the extra default parameters. I'm stuck. Does anyone have any clues about this?
It is the first ADD_FILE which is throwing the exception.
--------------------------------------------------
CREATE OR REPLACE PROCEDURE import_test_data (p_filename IN VARCHAR2) AS
l_handle NUMBER;
l_temp NUMBER;
l_state VARCHAR2(20);
l_date VARCHAR2(20);
l_date_started DATE;
ind NUMBER;
percent_done NUMBER;
job_state VARCHAR2(30);
le ku$_LogEntry;
js ku$_JobStatus;
jd ku$_JobDesc;
sts ku$_Status;
BEGIN
l_date_started := SYSDATE;
l_date := to_char(l_date_started,'YYYYMMDD-HH24MI');
l_handle := DBMS_DATAPUMP.OPEN ('IMPORT','TABLE', NULL, 'TESTDATA'||l_date);
DBMS_DATAPUMP.ADD_FILE (l_handle, p_filename,'TESTDATA', NULL, DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE);
DBMS_DATAPUMP.ADD_FILE (l_handle, p_filename||'.log','TESTDATA', NULL, DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
DBMS_DATAPUMP.SET_PARAMETER (l_handle, 'INCLUDE_METADATA', 0);
DBMS_DATAPUMP.SET_PARAMETER (l_handle, 'TABLE_EXISTS_ACTION', 'APPEND');
DBMS_DATAPUMP.METADATA_FILTER (l_handle,'NAME_LIST','''RT_MESSAGES''',NULL,'TABLE');
DBMS_DATAPUMP.START_JOB (l_handle);
DBMS_DATAPUMP.WAIT_FOR_JOB (l_handle, l_state);
END;
|
|
|
|
| Re: DBMS_DATAPUMP.ADD_FILE : ORA-39001 [message #226250 is a reply to message #226182] |
Fri, 23 March 2007 01:35   |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
| Quote: | ORA-39001: invalid argument value
Cause: The user specified API parameters were of the wrong type or value range. Subsequent messages supplied by DBMS_DATAPUMP.GET_STATUS will further describe the error.
Action: Correct the bad argument and retry the API.
|
Could be a starting point to call get_status
Also found this reference
[Edit: added link]
[Updated on: Fri, 23 March 2007 01:37] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
| Re: DBMS_DATAPUMP.ADD_FILE : ORA-39001 [message #233103 is a reply to message #226182] |
Tue, 24 April 2007 13:34  |
discojohnson
Messages: 1 Registered: April 2007
|
Junior Member |
|
|
below is an example of what i use to catch the difficult exceptions thrown by the datapump.
PROCEDURE estimate_space(in_schema IN VARCHAR2, in_dblink IN VARCHAR2)
IS
v_handle NUMBER;
v_job_state VARCHAR2(4000);
v_status ku$_Status1010;
v_logs ku$_LogEntry1010;
v_row PLS_INTEGER;
BEGIN
...
EXCEPTION
WHEN OTHERS THEN
dbms_datapump.get_status(NULL, 8, 0, v_job_state, v_status);
v_logs := v_status.error;
v_row := v_logs.FIRST;
LOOP
EXIT WHEN v_row IS NULL;
debugwriter('logLineNumber='||v_logs(v_row).logLineNumber);
debugwriter('errorNumber='||v_logs(v_row).errorNumber);
debugwriter('LogText='||v_logs(v_row).LogText);
v_row := v_logs.NEXT (v_row);
END LOOP;
END;
|
|
|
|