This discussion is archived
2 Replies Latest reply: Nov 16, 2011 12:46 AM by Pyrocks RSS

DBMS_DATAPUMP.GET_DUMPFILE_INFO doesn't return complete info table

Pyrocks Explorer
Currently Being Moderated
Hi,

I'm testing the DBMS_DATAPUMP.GET_DUMPFILE_INFO procedure to verify the header of a newly created datapump export file.

According to the documentation [http://download.oracle.com/docs/cd/E11882_01/appdev.112/e25788/d_datpmp.htm#BABJBADB], the info table should consist of the following values:
The item codes, which can easily be extended to provide more information as needed, are currently defined as follows (prepended with the package name, DBMS_DATAPUMP.):

KU$_DFHDR_FILE_VERSION CONSTANT NUMBER := 1;
KU$_DFHDR_MASTER_PRESENT CONSTANT NUMBER := 2;
KU$_DFHDR_GUID CONSTANT NUMBER := 3;
KU$_DFHDR_FILE_NUMBER CONSTANT NUMBER := 4;
KU$_DFHDR_CHARSET_ID CONSTANT NUMBER := 5;
KU$_DFHDR_CREATION_DATE CONSTANT NUMBER := 6;
KU$_DFHDR_FLAGS CONSTANT NUMBER := 7;
KU$_DFHDR_JOB_NAME CONSTANT NUMBER := 8;
KU$_DFHDR_PLATFORM CONSTANT NUMBER := 9;
KU$_DFHDR_INSTANCE CONSTANT NUMBER := 10;
KU$_DFHDR_LANGUAGE CONSTANT NUMBER := 11;
KU$_DFHDR_BLOCKSIZE CONSTANT NUMBER := 12;
KU$_DFHDR_DIRPATH CONSTANT NUMBER := 13;
KU$_DFHDR_METADATA_COMPRESSED CONSTANT NUMBER := 14;
KU$_DFHDR_DB_VERSION CONSTANT NUMBER := 15;
KU$_DFHDR_MAX_ITEM_CODE CONSTANT NUMBER := 20;
KU$_DFHDR_MASTER_PIECE_COUNT CONSTANT NUMBER := 16;
KU$_DFHDR_MASTER_PIECE_NUMBER CONSTANT NUMBER := 17;
KU$_DFHDR_DATA_COMPRESSED CONSTANT NUMBER := 18;
KU$_DFHDR_METADATA_ENCRYPTED CONSTANT NUMBER := 19;
KU$_DFHDR_DATA_ENCRYPTED CONSTANT NUMBER := 20;

and now here's my code:
...
   DBMS_DATAPUMP.GET_DUMPFILE_INFO(iDumpfileName,vDirName,voInfoTable, voFileType);
   
   --voFileType possible values:
   --0 - not a valid dumpfile
   --1 - datapump dumpfile
   --2 - original export dumpfile
   if voFileType != 1 then
      raise_application_error(-20001,'Dumpfile ' ||iPath || vSeparator || iDumpfileName || ' is not a datapump valid file');
   end if;
   
   dbms_output.put_line('FILE_VERSION: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_FILE_VERSION).Value);
   dbms_output.put_line('MASTER_PRESENT: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_MASTER_PRESENT).Value);
   dbms_output.put_line('GUID: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_GUID).Value);
   dbms_output.put_line('FILE_NUMBER: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_FILE_NUMBER).Value);
   dbms_output.put_line('CHARSET_ID: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_CHARSET_ID).Value);
   dbms_output.put_line('CREATION_DATE: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_CREATION_DATE).Value);
   dbms_output.put_line('FLAGS: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_FLAGS).Value);
   dbms_output.put_line('JOB_NAME: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_JOB_NAME).Value);
   dbms_output.put_line('PLATFORM: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_PLATFORM).Value);
   dbms_output.put_line('INSTANCE: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_INSTANCE).Value);
   dbms_output.put_line('LANGUAGE: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_LANGUAGE).Value);
   dbms_output.put_line('BLOCKSIZE: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_BLOCKSIZE).Value);
   dbms_output.put_line('DIRPATH: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_DIRPATH).Value);
   dbms_output.put_line('METADATA_COMPRESSED: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_METADATA_COMPRESSED).Value);
   dbms_output.put_line('DB_VERSION: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_DB_VERSION).Value);
   dbms_output.put_line('MAX_ITEM_CODE: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_MAX_ITEM_CODE).Value);
   dbms_output.put_line('MASTER_PIECE_COUNT: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_MASTER_PIECE_COUNT).Value);
   dbms_output.put_line('MASTER_PIECE_NUMBER: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_MASTER_PIECE_NUMBER).Value);
   dbms_output.put_line('DATA_COMPRESSED: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_DATA_COMPRESSED).Value);
   dbms_output.put_line('METADATA_ENCRYPTED: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_METADATA_ENCRYPTED).Value);
   dbms_output.put_line('DATA_ENCRYPTED: ' || voInfoTable(DBMS_DATAPUMP.KU$_DFHDR_DATA_ENCRYPTED).Value);
   
end;
/ 
I get the following output, which does not match the documentation:
FILE_VERSION: 3.1
MASTER_PRESENT: 11.02.00.00.00
GUID: 1
FILE_NUMBER: 2
CHARSET_ID: 080F9642312B43088015C73FA8760DFF
CREATION_DATE: 873
FLAGS: 1
JOB_NAME: "SCHEMA_EXPORTER"."SYS_EXPORT_SCHEMA_10"
PLATFORM: IBMPC/WIN_NT64-9.1.0
INSTANCE: magnolia
LANGUAGE: AL32UTF8
BLOCKSIZE: Tue Nov 15 10:39:19 2011
DIRPATH: 4096
METADATA_COMPRESSED: 1
DB_VERSION: 0

it stops after number 15, and throws ORA-06533 subscript beyound count.
I'm on 11.2.0.2, windows 2008 64bit
Can anyone tell me why?

Edited by: Pyrocks on Nov 15, 2011 11:33 AM - added DB version and OS

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points