I have a script that runs every night making a DUMP-file, but after several years without any errors, suddenly the script fails. I use EXP, but get the error:
EXP-00056: ORACLE error 19206 encountered
ORA-19206: Invalid value for query or REF CURSOR parameter
ORA-06512: at "SYS.DBMS_XMLGEN", line 83
ORA-06512: at "SYS.DBMS_METADATA", line 345
ORA-06512: at "SYS.DBMS_METADATA", line 410
ORA-06512: at "SYS.DBMS_METADATA", line 449
ORA-06512: at "SYS.DBMS_METADATA", line 1156
ORA-06512: at "SYS.DBMS_METADATA", line 1141
ORA-06512: at line 1
EXP-00000: Export terminated unsuccessfully
I found a thread about the same error telling me to run the script $ORACLE_HOME/rdbms/admin/catmeta.sql connected as SYS. But that doesn't seems to have any impact.
I have seen this a few times in Oracle 9i databases where XML DB is installed. Exports fail after xmldb catalog corruption. Oracle support has a few notes on it with similar but not exact errors as you reported, fixed in 9206+. Did you recently install XML DB, or recently create XML objects in the database? If so, the fix is not pretty - drop the XMLDB schema and lose all your XML objects, then reload XMLDB (using either DBCA or catalog scripts.) However, doing so in a pre-9206 database will not resolve the problem for very long - it will come back until you upgrade the db.