Wednesday 24 July 2013

EXP-00056 and ORA-00932 in oracle 10g while export

The Errors are :
EXP-00056: ORACLE error 932 encountered
ORA-00932: inconsistent datatypes: expected BLOB, CLOB got CHAR

After the investigation I came to know that the problem lies with accessing the XDB object views. This is because XDB object views were created with dummy SQL statements.
SQL> SELECT schema_val FROM sys.ku$_xmlschema_view;
SELECT schema_val FROM sys.ku$_xmlschema_view
       *
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected BLOB, CLOB got CHAR

SQL> SELECT text FROM dba_views
  2  WHERE view_name = 'KU$_XMLSCHEMA_VIEW';

TEXT
-------------------------------------------------------------------------------
select '1','0', 0, NULL, NULL, NULL, 0, NULL, NULL
    from dual where 1=0
Here is how the above fake XDB object views were created. The script “catproc.sql” has been executed while creating the database. The script “catproc.sql” calls “catmeta.sql” which contains the fake object view names which are required for XDB objects. Interestingly, the real views can be created by executing the script “catmex.sql”. While enabling the XMLDB, the script “catmex.sql” will be invoked by “catxdbv.sql” and that is invoked by “catqm.sql”
To resolve the issue, connect as user SYS and execute “catmetx.sql”.
If the database “NLS_LENGTH_SEMANTICS” parameter is set to “CHAR”, while executing the “catmetx.sql” we may get ORA-22973 error message. This is because the script is attempting to compile INVALID object SYS.KU$_XMLSCHEMA_VIEW and internal name size for an OID (Object Identifier) is not sufficient to hold the names of several XDB types and sub-types.
SQL> @?/rdbms/admin/catmetx.sql
create or replace force view sys.ku$_xmlschema_view of sys.ku$_xmlschema_t
*
ERROR at line 1:
ORA-22973: size of object identifier exceeds maximum size allowed
Hence set database parameter NLS_LENGTH_SEMANTICS=BYTE before executing the “catmetx.sql”
SQL> ALTER SYSTEM SET nls_length_semantics=byte;
SQL> @?/rdbms/admin/catmetx.sql
SQL> @?/rdbms/admin/utlrp.sql


Now I am able to execute the SELECT statement on object view “SYS.KU$_XMLSCHEMA_VIEW” without any errors and also I am able to export the full database dump.
Refer metalink notes: Note – 339938.1Note – 393156.1 andBug 2743295